]> git.donarmstrong.com Git - debbugs.git/commitdiff
default to + for affects if there are packages, = otherwise
authorDon Armstrong <don@donarmstrong.com>
Tue, 3 Apr 2012 21:46:47 +0000 (14:46 -0700)
committerDon Armstrong <don@donarmstrong.com>
Tue, 3 Apr 2012 21:46:47 +0000 (14:46 -0700)
scripts/service

index 1cf0e40d58925a680fd90654f83d3f3e16d30854..29d14af789619d8a4dace8cdfad511bb8a2af909 100755 (executable)
@@ -962,8 +962,19 @@ END
     } elsif (m/^affects?\s+\#?(-?\d+)(?:\s+((?:[=+-])?)\s*(\S.*)?)?\s*$/i) {
        $ok++;
         $ref = $1;
-       my $add_remove = $2 || '';
-       my $packages = $3 || '';
+       my $add_remove = $2;
+       my $packages = $3;
+       # if there isn't a package given, assume that we should unset
+       # affects; otherwise default to adding
+       if (not defined $packages or
+           not length $packages) {
+           $packages = '';
+           $add_remove ||= '=';
+       }
+       elsif (not defined $add_remove or
+              not length $add_remove) {
+           $add_remove = '+';
+       }
        $ref = $clonebugs{$ref} if exists $clonebugs{$ref};
        eval {
             affects(@common_control_options,