Package: dupload
Version: 2.6.3
Followup-For: Bug #98949
Hi,
I needed to limit the bandwith usage of dupload and didn't find any
options for this. So I went ahead and added an "options" field into
the config that will be passed on verbatim to scp and rsync. I'm
adding the patch here since it applies to adding --progress just as
well as any other set of options.
MfG
Goswin
-- System Information:
Debian Release: 3.1
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.8-frosties-1
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Versions of packages dupload depends on:
ii perl 5.8.4-5 Larry Wall's Practical Extraction
ii perl-modules [libnet-perl] 5.8.4-5 Core Perl modules
-- no debconf information
--- /usr/bin/dupload~ 2004-05-15 01:19:37.000000000 +0200
+++ /usr/bin/dupload 2005-02-08 05:37:00.076646792 +0100
@@ -40,6 +40,7 @@
my $method = "ftp"; # transfer method
my $login = "anonymous"; # default login
my $passwd = "[EMAIL PROTECTED]"; # ...
+my $options = ""; # extra options for rsync or scp
my $sendmail = "/usr/sbin/sendmail";
@@ -144,6 +145,7 @@
{
my $nick = $config::cfg{$host};
$method = $nick->{method} || $method;
+ $options = $nick->{options} || $options;
$fqdn = $nick->{fqdn} or fatal("Nothing known about host $host\n");
$incoming = $nick->{incoming} or fatal("No Incoming dir\n");
$queuedir = $nick->{queuedir};
@@ -513,7 +515,7 @@
} elsif ($method eq "scp") {
$mode = (stat($file))[2];
unless ($dry) {
- system("scp -p -q $file [EMAIL
PROTECTED]:$incoming");
+ system("scp -p -q $options $file [EMAIL
PROTECTED]:$incoming");
fatal("scp $file failed\n") if $?;
$t = time() - $t;
# Small optimization
@@ -522,7 +524,7 @@
fatal("ssh ... chmod 0644 failed\n") if $?;
}
} else {
- p "\n+ scp -p -q $file [EMAIL
PROTECTED]:$incoming";
+ p "\n+ scp -p -q $options $file [EMAIL
PROTECTED]:$incoming";
if ($mode != 33188) { # rw-r--r-- aka 0644
p "\n+ ssh -x -l $login $fqdn chmod 0644
$incoming/$file";
}
@@ -591,7 +593,7 @@
"'";
unless ($dry) {
p "\n";
- system("scp $scpfiles [EMAIL PROTECTED]:$incoming");
+ system("scp $options $scpfiles [EMAIL
PROTECTED]:$incoming");
if ($?) {
unlink $log{$job};
fatal("scp $scpfiles failed\n");
@@ -601,7 +603,7 @@
}
fatal("$cmd failed\n") if $?;
} else {
- p "\n+ scp $scpfiles [EMAIL PROTECTED]:$incoming";
+ p "\n+ scp $options $scpfiles [EMAIL
PROTECTED]:$incoming";
p "\n+ $cmd";
}
$allfiles = $scpfiles;
@@ -613,7 +615,7 @@
"'";
unless ($dry) {
p "\n";
- system("rsync --partial -zave ssh -x $rsyncfiles
$login" . "@" . "$fqdn:$incoming");
+ system("rsync --partial -zave ssh $options -x
$rsyncfiles $login" . "@" . "$fqdn:$incoming");
if ($?) {
unlink $log{$job};
fatal("rsync $rsyncfiles failed\n");
@@ -623,7 +625,7 @@
}
fatal("$cmd failed\n") if $?;
} else {
- p "\n+ rsync --partial -zave ssh -x $rsyncfiles $login"
. "@" . "$fqdn:$incoming";
+ p "\n+ rsync --partial -zave ssh $options -x
$rsyncfiles $login" . "@" . "$fqdn:$incoming";
p "\n+ $cmd";
}
$allfiles = $rsyncfiles;