This idiom is terse, but quite confusing. Instead, handle the undef
case explicitly.
While we are editing these:
* Change two internal errors from die to confess
* Fix a die in git-debrebase which ought to be badusage
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
dgit (6.2~) unstable; urgency=medium
dgit (6.2~) unstable; urgency=medium
+ * dgit: Minor code cleanup.
- die "$access_forpush ?" if ($access_forpush // 1) ne 1;
+ confess 'internal error '.Dumper($access_forpush)," ?" if
+ defined $access_forpush and !$access_forpush;
badcfg "pushing but distro is configured readonly"
if access_forpush_config() eq '0';
$access_forpush = 1;
badcfg "pushing but distro is configured readonly"
if access_forpush_config() eq '0';
$access_forpush = 1;
responder_send_command("param isuite $isuite");
responder_send_command("param tagformat $tagformat");
if (defined $maintviewhead) {
responder_send_command("param isuite $isuite");
responder_send_command("param tagformat $tagformat");
if (defined $maintviewhead) {
- die unless ($protovsn//4) >= 4;
+ confess "internal error (protovsn=$protovsn)"
+ if defined $protovsn and $protovsn < 4;
responder_send_command("param maint-view $maintviewhead");
}
responder_send_command("param maint-view $maintviewhead");
}
foreach my $name (qw(PIPE CHLD)) {
my $signame = "SIG$name";
my $signum = eval "POSIX::$signame" // die;
foreach my $name (qw(PIPE CHLD)) {
my $signame = "SIG$name";
my $signum = eval "POSIX::$signame" // die;
- ($SIG{$name} // 'DEFAULT') eq 'DEFAULT' or
- die "$signame is set to something other than SIG_DFL\n";
+ die "$signame is set to something other than SIG_DFL\n"
+ if defined $SIG{$name} and $SIG{$name} ne 'DEFAULT';
$blocked->ismember($signum) and
die "$signame is blocked\n";
}
$blocked->ismember($signum) and
die "$signame is blocked\n";
}
- die if ($ARGV[0]//'') =~ m/^-/;
+ badusage "analyse does not support any options"
+ if @ARGV and $ARGV[0] =~ m/^-/;
badusage "too many arguments to analyse" if @ARGV>1;
my ($old) = @ARGV;
if (defined $old) {
badusage "too many arguments to analyse" if @ARGV>1;
my ($old) = @ARGV;
if (defined $old) {