diff -Nru dupload-2.9.3/debian/changelog dupload-2.9.4/debian/changelog --- dupload-2.9.3/debian/changelog 2019-02-03 00:01:59.000000000 +0000 +++ dupload-2.9.4/debian/changelog 2019-02-27 05:12:56.000000000 +0000 @@ -1,3 +1,20 @@ +dupload (2.9.4) unstable; urgency=medium + + * Add missing newline when printing queuedir move. + * When using the scpb method print that instead of scp. + * Add verb to the first job print, see #181476. + * Fix current working directory for postupload hooks. + Fixes . + Based on patch by Ignacy Gawędzki . + * Fallback to getpwuid($<) in case getlogin() fails. + Fixes . + * Do not use sendmail if it is not available. We are checking whether + sendmail is present, to then override the check with the value coming + from the config file. We should not try to use sendmail if we have found + it is not available. Fixes . + + -- Guillem Jover Wed, 27 Feb 2019 06:12:56 +0100 + dupload (2.9.3) unstable; urgency=medium * Remove trailing spaces from changelog file. diff -Nru dupload-2.9.3/dupload dupload-2.9.4/dupload --- dupload-2.9.3/dupload 2019-02-03 00:01:59.000000000 +0000 +++ dupload-2.9.4/dupload 2019-02-27 05:12:56.000000000 +0000 @@ -40,7 +40,7 @@ my $version = '2.x'; my $progname = basename($0); -my $user = getlogin || $ENV{LOGNAME} || $ENV{USER}; +my $user = getlogin || getpwuid($<) || $ENV{LOGNAME} || $ENV{USER}; my $myhost = qx(hostname --fqdn); chomp $myhost; my $cwd = cwd(); @@ -158,11 +158,6 @@ $myhost or fatal('Who am I? (cannot get hostname)'); $cwd or fatal('Where am I? (cannot get current directory)'); -unless (-x $sendmail) { - $nomail = 1; - w("mail options disabled, cannot run '$sendmail': $!\n"); -} - # # Main # @@ -257,6 +252,11 @@ exit 0; } +unless (-x $sendmail) { + $nomail = 1; + w("mail options disabled, cannot run '$sendmail': $!\n"); +} + # Get the configuration for that host global, job independent information. $host or fatal('Need host to upload to. (See --to option or the default_host configuration variable)'); @@ -374,7 +374,7 @@ } p("Uploading ($method) to $fqdn:$incoming"); -p("and moving to $fqdn:$queuedir") if $queuedir; +p("\nand moving to $fqdn:$queuedir") if $queuedir; p("\n"); *STDOUT->autoflush(); @@ -406,7 +406,7 @@ # Preupload code for source package. preupload_hook('sourcepackage', [ basename($package) . " $version" ]); - p("[ job $job from $cf"); + p("[ Preparing job $job from $cf"); # Scan the log file (iff any) for the files we have already put to the # host and the announcements already done. @@ -621,7 +621,7 @@ } } } continue { - chdir $cwd or fatal("Cannot change directory back to $cwd"); + chdir $cwd or fatal("Cannot change directory back to $cwd: $!"); } chdir $cwd or fatal("Cannot change directory to $cwd: $!"); @@ -649,7 +649,7 @@ p("+ ftp::cwd($incoming\n"); } } elsif ($method eq 'scp' || $method eq 'scpb') { - p("Uploading (scp) to $host ($fqdn)\n"); + p("Uploading ($method) to $host ($fqdn)\n"); } elsif ($method eq 'rsync') { p("Uploading (rsync) to $host ($fqdn)\n"); } elsif ($method eq 'copy') { @@ -674,7 +674,6 @@ $incoming =~ s/_upstream_/$upstream/g; $incoming =~ s/_debian_/$debian/g; - chdir $cwd or fatal("Cannot change directory to $cwd: $!"); chdir $dir{$job} or fatal("Cannot change directory to $dir{$job}: $!"); p("[ Uploading job $job"); @@ -870,8 +869,12 @@ p("\n+ log successful upload\n"); } p(" ]\n"); +} continue { + chdir $cwd or fatal("Cannot change directory back to $cwd: $!"); } +chdir $cwd or fatal("Cannot change directory to $cwd: $!"); + if ($method eq 'ftp') { unless ($dry) { $ftp->close();