summaryrefslogtreecommitdiff
path: root/dgit
diff options
context:
space:
mode:
Diffstat (limited to 'dgit')
-rwxr-xr-xdgit59
1 files changed, 31 insertions, 28 deletions
diff --git a/dgit b/dgit
index fe38f71..68e80df 100755
--- a/dgit
+++ b/dgit
@@ -4656,7 +4656,7 @@ END
my $host = access_cfg('upload-host','RETURN-UNDEF');
my @hostarg = defined($host) ? ($host,) : ();
runcmd_ordryrun @dput, @hostarg, $changesfile;
- printdone "pushed and uploaded $cversion";
+ printdone f_ "pushed and uploaded %s", $cversion;
supplementary_message('');
responder_send_command("complete");
@@ -4668,7 +4668,7 @@ sub pre_clone () {
sub cmd_clone {
parseopts();
my $dstdir;
- badusage "-p is not allowed with clone; specify as argument instead"
+ badusage __ "-p is not allowed with clone; specify as argument instead"
if defined $package;
if (@ARGV==1) {
($package) = @ARGV;
@@ -4679,13 +4679,13 @@ sub cmd_clone {
} elsif (@ARGV==3) {
($package,$isuite,$dstdir) = @ARGV;
} else {
- badusage "incorrect arguments to dgit clone";
+ badusage __ "incorrect arguments to dgit clone";
}
notpushing();
$dstdir ||= "$package";
if (stat_exists $dstdir) {
- fail "$dstdir already exists";
+ fail f_ "%s already exists", $dstdir;
}
my $cwd_remove;
@@ -4695,15 +4695,16 @@ sub cmd_clone {
return unless defined $cwd_remove;
if (!chdir "$cwd_remove") {
return if $!==&ENOENT;
- die "chdir $cwd_remove: $!";
+ confess "chdir $cwd_remove: $!";
}
printdebug "clone rmonerror removing $dstdir\n";
if (stat $dstdir) {
- rmtree($dstdir) or die "remove $dstdir: $!\n";
+ rmtree($dstdir) or fail f_ "remove %s: %s\n", $dstdir, $!;
} elsif (grep { $! == $_ }
(ENOENT, ENOTDIR, EACCES, EPERM, ELOOP)) {
} else {
- print STDERR "check whether to remove $dstdir: $!\n";
+ print STDERR f_ "check whether to remove %s: %s\n",
+ $dstdir, $!;
}
};
}
@@ -4740,7 +4741,7 @@ sub fetchpullargs () {
} elsif (@ARGV==1) {
($isuite) = @ARGV;
} else {
- badusage "incorrect arguments to dgit fetch or dgit pull";
+ badusage __ "incorrect arguments to dgit fetch or dgit pull";
}
notpushing();
}
@@ -4756,8 +4757,8 @@ sub cmd_pull {
fetchpullargs();
if (quiltmode_splitbrain()) {
my ($format, $fopts) = get_source_format();
- madformat($format) and fail <<END
-dgit pull not yet supported in split view mode (--quilt=$quilt_mode)
+ madformat($format) and fail f_ <<END, $quilt_mode
+dgit pull not yet supported in split view mode (--quilt=%s)
END
}
pull();
@@ -4766,7 +4767,7 @@ END
sub cmd_checkout {
parseopts();
package_from_d_control();
- @ARGV==1 or badusage "dgit checkout needs a suite argument";
+ @ARGV==1 or badusage __ "dgit checkout needs a suite argument";
($isuite) = @ARGV;
notpushing();
@@ -4828,17 +4829,17 @@ sub cmd_update_vcs_git () {
my @cmd;
my $orgurl = cfg 'remote.vcs-git.url', 'RETURN-UNDEF';
if (!defined $orgurl) {
- print STDERR "setting up vcs-git: $url\n";
+ print STDERR f_ "setting up vcs-git: %s\n", $url;
@cmd = (@git, qw(remote add vcs-git), $url);
} elsif ($orgurl eq $url) {
- print STDERR "vcs git already configured: $url\n";
+ print STDERR f_ "vcs git already configured: %s\n", $url;
} else {
- print STDERR "changing vcs-git url to: $url\n";
+ print STDERR f_ "changing vcs-git url to: %s\n", $url;
@cmd = (@git, qw(remote set-url vcs-git), $url);
}
runcmd_ordryrun_local @cmd;
if ($dofetch) {
- print "fetching (@ARGV)\n";
+ print f_ "fetching (%s)\n", "@ARGV";
runcmd_ordryrun_local @git, qw(fetch vcs-git), @ARGV;
}
}
@@ -4853,7 +4854,7 @@ sub prep_push () {
} elsif (@ARGV==1) {
($specsuite) = (@ARGV);
} else {
- badusage "incorrect arguments to dgit $subcommand";
+ badusage f_ "incorrect arguments to dgit %s", $subcommand;
}
if ($new_package) {
local ($package) = $existing_package; # this is a hack
@@ -4864,8 +4865,9 @@ sub prep_push () {
if (defined $specsuite &&
$specsuite ne $isuite &&
$specsuite ne $csuite) {
- fail "dgit $subcommand: changelog specifies $isuite ($csuite)".
- " but command line specifies $specsuite";
+ fail f_ "dgit %s: changelog specifies %s (%s)".
+ " but command line specifies %s",
+ $subcommand, $isuite, $csuite, $specsuite;
}
}
@@ -4901,9 +4903,9 @@ sub pre_remote_push_build_host {
$vsnwant =~ m{^(?:.*,)?$_(?:,.*)?$}
} @rpushprotovsn_support;
- fail "build host has dgit rpush protocol versions ".
- (join ",", @rpushprotovsn_support).
- " but invocation host has $vsnwant"
+ fail f_ "build host has dgit rpush protocol versions %s".
+ " but invocation host has %s",
+ (join ",", @rpushprotovsn_support), $vsnwant
unless defined $protovsn;
changedir $dir;
@@ -4980,7 +4982,8 @@ sub cmd_rpush {
if (defined $initiator_tempdir) {
rmtree $initiator_tempdir;
- mkdir $initiator_tempdir, 0700 or die "$initiator_tempdir: $!";
+ mkdir $initiator_tempdir, 0700
+ or fail f_ "create %s: %s", $initiator_tempdir, $!;
$i_tmp = $initiator_tempdir;
} else {
$i_tmp = tempdir();
@@ -5017,10 +5020,10 @@ sub i_resp_complete {
printdebug "waiting for build host child $pid...\n";
my $got = waitpid $pid, 0;
die $! unless $got == $pid;
- die "build host child failed $?" if $?;
+ fail f_ "build host child failed: %s", waitstatusmsg() if $?;
i_cleanup();
- printdebug "all done\n";
+ printdebug __ "all done\n";
finish 0;
}
@@ -5029,7 +5032,7 @@ sub i_resp_file ($) {
my $localname = i_method "i_localname", $keyword;
my $localpath = "$i_tmp/$localname";
stat_exists $localpath and
- badproto \*RO, "file $keyword ($localpath) twice";
+ badproto \*RO, f_ "file %s (%s) twice", $keyword, $localpath;
protocol_receive_file \*RO, $localpath;
i_method "i_file", $keyword;
}
@@ -5037,15 +5040,15 @@ sub i_resp_file ($) {
our %i_param;
sub i_resp_param ($) {
- $_[0] =~ m/^(\S+) (.*)$/ or badproto \*RO, "bad param spec";
+ $_[0] =~ m/^(\S+) (.*)$/ or badproto \*RO, __ "bad param spec";
$i_param{$1} = $2;
}
sub i_resp_previously ($) {
$_[0] =~ m#^(refs/tags/\S+)=(\w+)$#
- or badproto \*RO, "bad previously spec";
+ or badproto \*RO, __ "bad previously spec";
my $r = system qw(git check-ref-format), $1;
- die "bad previously ref spec ($r)" if $r;
+ confess "bad previously ref spec ($r)" if $r;
$previously{$1} = $2;
}