SVN: toys/rsget.pl: RSGet/FileList.pm rsget.pl
sparky
sparky at pld-linux.org
Mon Sep 21 14:51:06 CEST 2009
Author: sparky
Date: Mon Sep 21 14:51:05 2009
New Revision: 10625
Modified:
toys/rsget.pl/RSGet/FileList.pm
toys/rsget.pl/rsget.pl
Log:
- create empty get.list automatically if no list is specified
Modified: toys/rsget.pl/RSGet/FileList.pm
==============================================================================
--- toys/rsget.pl/RSGet/FileList.pm (original)
+++ toys/rsget.pl/RSGet/FileList.pm Mon Sep 21 14:51:05 2009
@@ -23,8 +23,18 @@
sub set_file
{
$file = shift;
+ unless ( defined $file ) {
+ $file = 'get.list';
+ unless ( -r $file ) {
+ p "Creating empty file list '$file'";
+ open F_OUT, '>', $file;
+ print F_OUT "# empty list\n";
+ close F_OUT;
+ }
+ } else {
+ p "Using '$file' file list\n";
+ }
die "Can't read '$file'\n" unless -r $file;
- p "Using '$file' file list\n";
my $make_swp = $settings{list_lock};
$file_swp = eval "\"$make_swp\"";
p "Using '$file_swp' as file lock\n";
Modified: toys/rsget.pl/rsget.pl
==============================================================================
--- toys/rsget.pl/rsget.pl (original)
+++ toys/rsget.pl/rsget.pl Mon Sep 21 14:51:05 2009
@@ -37,7 +37,7 @@
# read options
my $http = undef;
-my $flist = 'get.list';
+my $flist = undef;
while ( my $arg = shift @ARGV ) {
if ( $arg eq '-i' ) {
my $ifs = shift @ARGV || die "argument missing";
More information about the pld-cvs-commit
mailing list