From: Don Armstrong Date: Tue, 3 Apr 2012 21:46:47 +0000 (-0700) Subject: default to + for affects if there are packages, = otherwise X-Git-Tag: release/2.6.0~399 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=6fefac7e03aba582caeb4535a5939dbbf170b4bb;p=debbugs.git default to + for affects if there are packages, = otherwise --- diff --git a/scripts/service b/scripts/service index 1cf0e40d..29d14af7 100755 --- a/scripts/service +++ b/scripts/service @@ -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,