]> git.pld-linux.org Git - packages/perl-libwww.git/commitdiff
- allow passing a directory as a second argument to lwp-download
authorradek <radek@pld-linux.org>
Fri, 10 Dec 2004 20:20:14 +0000 (20:20 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    perl-libwww-lwp_download_dest_dir_support.patch -> 1.1

perl-libwww-lwp_download_dest_dir_support.patch [new file with mode: 0644]

diff --git a/perl-libwww-lwp_download_dest_dir_support.patch b/perl-libwww-lwp_download_dest_dir_support.patch
new file mode 100644 (file)
index 0000000..1141f1e
--- /dev/null
@@ -0,0 +1,35 @@
+--- bin/lwp-download   2004-11-14 07:36:25.000000000 +0100
++++ bin/lwp-download   2004-12-10 21:12:41.136510344 +0100
+@@ -91,7 +91,13 @@
+   sub {
+       unless($file) {
+         my $res = $_[1];
+-        unless ($argfile) {
++
++        my $directory;
++        if (defined $argfile && -d $argfile) {
++            ($directory, $argfile) = ($argfile, undef);
++        }
++
++        unless (defined $argfile && length $argfile) {
+             # must find a suitable name to use.  First thing
+             # to do is to look for the "Content-Disposition"
+             # header defined by RFC1806.  This is also supported
+@@ -130,6 +136,11 @@
+                 }
+             }
++            if (defined $directory) {
++                require File::Spec;
++                $file = File::Spec->catfile($directory, $file);
++            }
++
+             # Check if the file is already present
+             if (-f $file && -t) {
+                 $shown = 1;
+@@ -292,3 +303,5 @@
+ {
+     die "Usage: $progname [-a] <url> [<lpath>]\n";
+ }
++
++# vi: ts=8 sw=4
This page took 0.143902 seconds and 4 git commands to generate.