my $i_arch_v = pseudomerge_version_check($clogp, $archive_hash);
if (!defined $overwrite_version) {
- progress "Checking that HEAD inciudes all changes in archive...";
+ progress __ "Checking that HEAD inciudes all changes in archive...";
}
return $dgitview if is_fast_fwd $archive_hash, $dgitview;
if (defined $overwrite_version) {
} elsif (!eval {
my $t_dep14 = debiantag_maintview $i_arch_v->[0], access_nomdistro;
- my $i_dep14 = infopair_lrf_tag_lookup($t_dep14, "maintainer view tag");
+ my $i_dep14 = infopair_lrf_tag_lookup($t_dep14,
+ __ "maintainer view tag");
my $t_dgit = debiantag_new $i_arch_v->[0], access_nomdistro;
- my $i_dgit = infopair_lrf_tag_lookup($t_dgit, "dgit view tag");
- my $i_archive = [ $archive_hash, "current archive contents" ];
+ my $i_dgit = infopair_lrf_tag_lookup($t_dgit, __ "dgit view tag");
+ my $i_archive = [ $archive_hash, __ "current archive contents" ];
printdebug "splitbrain_pseudomerge i_archive @$i_archive\n";
1;
}) {
$@ =~ s/^\n//; chomp $@;
- print STDERR <<END;
+ print STDERR <<END.(__ <<ENDT);
$@
-| Not fast forward; maybe --overwrite is needed ? Please see dgit(1).
END
+| Not fast forward; maybe --overwrite is needed ? Please see dgit(1).
+ENDT
finish -1;
}
my $r = pseudomerge_make_commit
$clogp, $dgitview, $archive_hash, $i_arch_v,
"dgit --quilt=$quilt_mode",
- (defined $overwrite_version ? <<END_OVERWR : <<END_MAKEFF);
-Declare fast forward from $arch_v
-END_OVERWR
-Make fast forward from $arch_v
-END_MAKEFF
+ (defined $overwrite_version
+ ? f_ "Declare fast forward from %s\n", $arch_v
+ : f_ "Make fast forward from %s\n", $arch_v);
maybe_split_brain_save $maintview, $r, "pseudomerge";
- progress "Made pseudo-merge of $arch_v into dgit view.";
+ progress f_ "Made pseudo-merge of %s into dgit view.", $arch_v;
return $r;
}
return $head if is_fast_fwd $archive_hash, $head;
- my $m = "Declare fast forward from $i_arch_v->[0]";
+ my $m = f_ "Declare fast forward from %s", $i_arch_v->[0];
my $r = pseudomerge_make_commit
$clogp, $head, $archive_hash, $i_arch_v,
runcmd git_update_ref_cmd $m, 'HEAD', $r, $head;
- progress "Make pseudo-merge of $i_arch_v->[0] into your HEAD.";
+ progress f_ "Make pseudo-merge of %s into your HEAD.", $i_arch_v->[0];
return $r;
}
my $clogpackage = getfield $clogp, 'Source';
$package //= $clogpackage;
- fail "-p specified $package but changelog specified $clogpackage"
+ fail f_ "-p specified %s but changelog specified %s",
+ $package, $clogpackage
unless $package eq $clogpackage;
my $cversion = getfield $clogp, 'Version';
my $dversion = getfield $dsc, 'Version';
my $dscpackage = getfield $dsc, 'Source';
($dscpackage eq $package && $dversion eq $cversion) or
- fail "$dscfn is for $dscpackage $dversion".
- " but debian/changelog is for $package $cversion";
+ fail f_ "%s is for %s %s but debian/changelog is for %s %s",
+ $dscfn, $dscpackage, $dversion,
+ $package, $cversion;
}
sub push_tagwants ($$$$) {
my $changes = parsecontrol($changesfile,$changesfilewhat);
foreach my $field (qw(Source Distribution Version)) {
$changes->{$field} eq $clogp->{$field} or
- fail "changes field $field \`$changes->{$field}'".
- " does not match changelog \`$clogp->{$field}'";
+ fail f_ "changes field %s \`%s' does not match changelog \`%s'",
+ $field, $changes->{$field}, $clogp->{$field};
}
my $cversion = getfield $clogp, 'Version';
END
if ($tw->{View} eq 'dgit') {
+ print TO f_ <<ENDT, $package, $cversion, $clogsuite, $csuite
+%s release %s for %s (%s) [dgit]
+ENDT
+ or die $!;
print TO <<END or die $!;
-$package release $cversion for $clogsuite ($csuite) [dgit]
[dgit distro=$declaredistro$delibs]
END
foreach my $ref (sort keys %previously) {
END
}
} elsif ($tw->{View} eq 'maint') {
- print TO <<END or die $!;
-$package release $cversion for $clogsuite ($csuite)
-(maintainer view tag generated by dgit --quilt=$quilt_mode)
+ print TO f_ <<END, $package, $cversion, $clogsuite, $csuite,
+%s release %s for %s (%s)
+(maintainer view tag generated by dgit --quilt=%s)
END
+ $quilt_mode
+ or die $!;
} else {
- die Dumper($tw)."?";
+ confess Dumper($tw)."?";
}
close TO or die $!;
sub dopush () {
printdebug "actually entering push\n";
- supplementary_message(<<'END');
+ supplementary_message(__ <<'END');
Push failed, while checking state of the archive.
You can retry the push, after fixing the problem, if you like.
END
my $archive_hash = fetch_from_archive();
if (!$archive_hash) {
$new_package or
- fail "package appears to be new in this suite;".
- " if this is intentional, use --new";
+ fail __ "package appears to be new in this suite;".
+ " if this is intentional, use --new";
}
- supplementary_message(<<'END');
+ supplementary_message(__ <<'END');
Push failed, while preparing your push.
You can retry the push, after fixing the problem, if you like.
END
my $dscpath = "$buildproductsdir/$dscfn";
stat_exists $dscpath or
- fail "looked for .dsc $dscpath, but $!;".
- " maybe you forgot to build";
+ fail f_ "looked for .dsc %s, but %s; maybe you forgot to build",
+ $dscpath, $!;
responder_send_file('dsc', $dscpath);
if (branch_is_gdr_unstitched_ff($symref, $actualhead, $archive_hash)) {
if (quiltmode_splitbrain()) {
my ($ffq_prev, $gdrlast) = branch_gdr_info($symref, $actualhead);
- fail <<END;
-Branch is managed by git-debrebase ($ffq_prev
-exists), but quilt mode ($quilt_mode) implies a split view.
+ fail f_ <<END, $ffq_prev, $quilt_mode;
+Branch is managed by git-debrebase (%s
+exists), but quilt mode (%s) implies a split view.
Pass the right --quilt option or adjust your git config.
Or, maybe, run git-debrebase forget-was-ever-debrebase.
END
my $cachekey;
($dgithead, $cachekey) =
quilt_check_splitbrain_cache($actualhead, $upstreamversion);
- $dgithead or fail
- "--quilt=$quilt_mode but no cached dgit view:
- perhaps HEAD changed since dgit build[-source] ?";
+ $dgithead or fail f_
+ "--quilt=%s but no cached dgit view:
+ perhaps HEAD changed since dgit build[-source] ?",
+ $quilt_mode;
$split_brain = 1;
$dgithead = splitbrain_pseudomerge($clogp,
$actualhead, $dgithead,
} elsif (deliberately_not_fast_forward) {
$forceflag = '+';
} else {
- fail "dgit push: HEAD is not a descendant".
+ fail __ "dgit push: HEAD is not a descendant".
" of the archive's version.\n".
"To overwrite the archive's contents,".
" pass --overwrite[=VERSION].\n".
}
changedir $playground;
- progress "checking that $dscfn corresponds to HEAD";
+ progress f_ "checking that %s corresponds to HEAD", $dscfn;
runcmd qw(dpkg-source -x --),
$dscpath =~ m#^/# ? $dscpath : "$maindir/$dscpath";
my ($tree,$dir) = mktree_in_ud_from_only_subdir("source package");
}
}
if (@mode_changes) {
- fail <<END.(join '', @mode_changes).<<END;
-HEAD specifies a different tree to $dscfn:
+ fail +(f_ <<ENDT, $dscfn).<<END
+HEAD specifies a different tree to %s:
+ENDT
$diffs
END
+ .(join '', @mode_changes)
+ .(f_ <<ENDT, $tree, $referent);
There is a problem with your source tree (see dgit(7) for some hints).
-To see a full diff, run git diff $tree $referent
-END
+To see a full diff, run git diff %s %s
+ENDT
}
- fail <<END;
-HEAD specifies a different tree to $dscfn:
+ fail +(f_ <<ENDT, $dscfn).<<END.(f_ <<ENDT, $tree, $referent);
+HEAD specifies a different tree to %s:
+ENDT
$diffs
+END
Perhaps you forgot to build. Or perhaps there is a problem with your
source tree (see dgit(7) for some hints). To see a full diff, run
- git diff $tree $referent
-END
+ git diff %s %s
+ENDT
} else {
failedcmd @diffcmd;
}
if (!$changesfile) {
my $pat = changespat $cversion;
my @cs = glob "$buildproductsdir/$pat";
- fail "failed to find unique changes file".
- " (looked for $pat in $buildproductsdir);".
- " perhaps you need to use dgit -C"
+ fail f_ "failed to find unique changes file".
+ " (looked for %s in %s);".
+ " perhaps you need to use dgit -C",
+ $pat, $buildproductsdir
unless @cs==1;
($changesfile) = @cs;
} else {
if ($sourceonlypolicy eq 'ok') {
} elsif ($sourceonlypolicy eq 'always') {
forceable_fail [qw(uploading-binaries)],
- "uploading binaries, although distroy policy is source only"
+ __ "uploading binaries, although distroy policy is source only"
if $hasdebs;
} elsif ($sourceonlypolicy eq 'never') {
forceable_fail [qw(uploading-source-only)],
- "source-only upload, although distroy policy requires .debs"
+ __ "source-only upload, although distroy policy requires .debs"
if !$hasdebs;
} elsif ($sourceonlypolicy eq 'not-wholly-new') {
forceable_fail [qw(uploading-source-only)],
- "source-only upload, even though package is entirely NEW\n".
- "(this is contrary to policy in ".(access_nomdistro()).")"
+ f_ "source-only upload, even though package is entirely NEW\n".
+ "(this is contrary to policy in %s)",
+ access_nomdistro()
if !$hasdebs
&& $new_package
&& !(archive_query('package_not_wholly_new', $package) // 1);
} else {
- badcfg "unknown source-only-uploads policy \`$sourceonlypolicy'";
+ badcfg f_ "unknown source-only-uploads policy \`%s'",
+ $sourceonlypolicy;
}
# Perhaps adjust .dsc to contain right set of origs
dgit_privdir()."/tag");
my @tagobjfns;
- supplementary_message(<<'END');
+ supplementary_message(__ <<'END');
Push failed, while signing the tag.
You can retry the push, after fixing the problem, if you like.
END
$changesfile,$changesfile,
\@tagwants);
}
- supplementary_message(<<'END');
+ supplementary_message(__ <<'END');
Push failed, *after* signing the tag.
If you want to try again, you should use a new version number.
END
@git, qw(update-ref), "refs/tags/$tag", $tag_obj_hash;
}
- supplementary_message(<<'END');
+ supplementary_message(__ <<'END');
Push failed, while updating the remote git repository - see messages above.
If you want to try again, you should use a new version number.
END
qw(-c push.followTags=false push), access_giturl(), @pushrefs;
runcmd_ordryrun git_update_ref_cmd 'dgit push', lrref(), $dgithead;
- supplementary_message(<<'END');
+ supplementary_message(__ <<'END');
Push failed, while obtaining signatures on the .changes and .dsc.
If it was just that the signature failed, you may try again by using
debsign by hand to sign the changes file (see the command dgit tried,
if (act_local()) {
rename "$dscpath.tmp",$dscpath or die "$dscfn $!";
} else {
- progress "[new .dsc left in $dscpath.tmp]";
+ progress f_ "[new .dsc left in %s.tmp]", $dscpath;
}
sign_changes $changesfile;
}
- supplementary_message(<<END);
+ supplementary_message(f_ <<END, $changesfile);
Push failed, while uploading package(s) to the archive server.
You can retry the upload of exactly these same files with dput of:
- $changesfile
+ %s
If that .changes file is broken, you will need to use a new version
number for your next attempt at the upload.
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");
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;
} 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;
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, $!;
}
};
}
} 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();
}
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();
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();
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;
}
}
} 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
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;
}
}
$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;
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();
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;
}
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;
}
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;
}