SVN: toys/rsget.pl/RSGet/Curl.pm
sparky
sparky at pld-linux.org
Wed Sep 16 19:06:21 CEST 2009
Author: sparky
Date: Wed Sep 16 19:06:20 2009
New Revision: 10611
Modified:
toys/rsget.pl/RSGet/Curl.pm
Log:
- fix continuing download when workdir is specified
Modified: toys/rsget.pl/RSGet/Curl.pm
==============================================================================
--- toys/rsget.pl/RSGet/Curl.pm (original)
+++ toys/rsget.pl/RSGet/Curl.pm Wed Sep 16 19:06:20 2009
@@ -81,14 +81,16 @@
# if file exists try to continue
my $fn = $get_obj->{_opts}->{fname};
- my $fp = filepath( $settings{workdir}, $get_obj->{_opts}->{dir}, $fn );
- if ( $fp and -r $fp ) {
- my $got = (stat(_))[7];
- #p "File '$fn' already exists, trying to continue at $got";
- $curl->setopt( CURLOPT_RANGE, "$got-" );
+ if ( $fn ) {
+ my $fp = filepath( $settings{workdir}, $get_obj->{_opts}->{dir}, $fn );
+ if ( -r $fp ) {
+ my $got = (stat(_))[7];
+ #p "File '$fn' already exists, trying to continue at $got";
+ $curl->setopt( CURLOPT_RANGE, "$got-" );
- $supercurl->{fname} = $fn;
- $supercurl->{filepath} = $fp
+ $supercurl->{fname} = $fn;
+ $supercurl->{filepath} = $fp
+ }
}
my $fs = $get_obj->{_opts}->{fsize};
More information about the pld-cvs-commit
mailing list