bin/rpi
branchrsync
changeset 45 19639ba80436
parent 42 73cb1d7a1bd8
--- a/bin/rpi	Thu Apr 19 21:28:37 2012 +0200
+++ b/bin/rpi	Fri Aug 04 15:44:30 2017 +0200
@@ -37,6 +37,13 @@
 my $hostname = hostname_long;
 for (*STDERR, *STDOUT) { select $_; $| = 1; }
 
+my $rci = "$repo/conf/incoming";
+my $i   = parse_incoming($rci)->{$ruleset}->{'IncomingDir'};
+die
+  "Can't find IncomingDir for ruleset [$ruleset] in configuration file: [$rci]\n"
+  unless defined $i;
+my @changes = @ARGV or glob("$i/*.changes");
+
 # see man reprepro
 # used as argument to the -b option of reprepro
 my $repo = "$ENV{HOME}/repo";
@@ -116,28 +123,22 @@
     "There have been errors!"
   ) . '$';
 
-my $rci = "$repo/conf/incoming";
-my $i   = parse_incoming($rci)->{$ruleset}->{'IncomingDir'};
-die
-  "Can't find IncomingDir for ruleset [$ruleset] in configuration file: [$rci]\n"
-  unless defined $i;
-
 # we need to determine uploaders before running reprepro, because it will
 # remove the *.changes files before we are going to parse its output
-my $uploaders = { map { $_ => uploader($_) } glob("$i/*.changes") };
+my $uploaders = { map { $_ => uploader($_) } @changes };
 if ($opt{'run-lintian'}) {
     for my $c (keys %{$uploaders}) {
         sendmails({ $uploaders->{$c} => scalar qx{lintian $c 2>&1} },
             $valid_receivers, $fallback, $hostname,
             "[$hostname] Lintian Report");
+        my $messages =
+        run_command_and_parse_output([@cmd, $c], $uploaders, $important, $unimportant,
+            $log_uncaught, $log_raw);
+        sendmails($messages, $valid_receivers, $fallback, $hostname,
+            "[$hostname] Import Report");
+
     }
 }
-my $messages =
-  run_command_and_parse_output([@cmd], $uploaders, $important, $unimportant,
-    $log_uncaught, $log_raw);
-sendmails($messages, $valid_receivers, $fallback, $hostname,
-    "[$hostname] Import Report");
-
 # determine 'uploader' of changes file; 'uploader' means here: either the
 # signer of the changes file or the changer or the maintainer in that order of
 # preference; the 'changer' means what is extracted from the 'Changed-By' field