From: Jo-Philipp Wich Date: Tue, 2 Jul 2019 16:25:00 +0000 (+0200) Subject: scripts: sha2rsync.pl: handle usign signatures as well X-Git-Tag: v1~89 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=63cfcba2fa0700b255e3fcc2374a012d6cffd6c7;p=buildbot.git scripts: sha2pl: handle usign signatures as well - Also consider sha256sums.sig and Packages.sig files - Avoid operation on closed handle when remote list does not exist - Only add existing additional files to rsync list Signed-off-by: Jo-Philipp Wich --- diff --git a/scripts/sha2rsync.pl b/scripts/sha2rsync.pl index f71437b..de286a1 100755 --- a/scripts/sha2rsync.pl +++ b/scripts/sha2rsync.pl @@ -44,10 +44,10 @@ my $torsync_fh = undef; open($torsync_fh, ">", $torsync) or die("can't create output file!"); open($llist_fh, "<", $llist) or die("can't read local list!"); -open($rlist_fh, "<", $rlist); +open($rlist_fh, "<", $rlist) or $rlist_fh = undef; my $lline = readline($llist_fh); -my $rline = readline($rlist_fh); +my $rline = defined($rlist_fh) ? readline($rlist_fh) : undef; MAINLOOP: while () { @@ -97,9 +97,21 @@ while (defined($lline)) { # unconditionally add some mandatory files to rsynclist # add them last so they're transferred last: if everything else transferred correctly -add_file("packages/Packages.asc"); -add_file("sha256sums.asc"); -add_file("sha256sums"); +my @additional_files = qw( + packages/Packages.asc + packages/Packages.sig + sha256sums.asc + sha256sums.sig + sha256sums +); + +(my $basedir = $llist) =~ s!/[^/]+$!!; + +foreach my $file (@additional_files) { + if (-f "$basedir/$file") { + add_file($file); + } +} exit (0);