X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=dgit;h=2ac6d51c6506af9980dc418c767e7cfe4fa0720c;hp=fe38f710bf4b6953b3f8b85631529b6119a12f41;hb=66b0259a66150cf67d5219400f8f89849c7d3c06;hpb=7c3fc6b786c71c2fdd6a72dcf896fa9ea38b24f9 diff --git a/dgit b/dgit index fe38f710..2ac6d51c 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 <{$_} or - fail "buildinfo contains $_" + fail f_ "buildinfo contains forbidden field %s", $_ foreach qw(Changes Changed-by Distribution); } push @i_buildinfos, $bi; @@ -5150,7 +5154,7 @@ sub i_want_signed_tag { return push_mktags $i_clogp, $i_dscfn, - $i_changesfn, 'remote changes', + $i_changesfn, (__ 'remote changes file'), \@tagwants; } @@ -5176,7 +5180,7 @@ sub quiltify_dpkg_commit ($$$;$) { mkpath '.git/dgit'; # we are in playtree my $descfn = ".git/dgit/quilt-description.tmp"; - open O, '>', $descfn or die "$descfn: $!"; + open O, '>', $descfn or confess "$descfn: $!"; $msg =~ s/\n+/\n\n/; print O <{O2H} & 01)) { - my $msg = - "--quilt=$quilt_mode specified, implying patches-unapplied git tree\n". - " but git tree differs from orig in upstream files."; + my $msg = f_ + "--quilt=%s specified, implying patches-unapplied git tree\n". + " but git tree differs from orig in upstream files.", + $quilt_mode; $msg .= $fulldiffhint->($unapplied, 'HEAD'); if (!stat_exists "debian/patches") { - $msg .= + $msg .= __ "\n ... debian/patches is missing; perhaps this is a patch queue branch?"; } fail $msg; } if ($quilt_mode =~ m/dpm/ && ($diffbits->{H2A} & 01)) { - fail <($oldtiptree,'HEAD'); ---quilt=$quilt_mode specified, implying patches-applied git tree + fail +(f_ <($oldtiptree,'HEAD'); +--quilt=%s specified, implying patches-applied git tree but git tree differs from result of applying debian/patches to upstream END } if ($quilt_mode =~ m/gbp|unapplied/ && ($diffbits->{O2A} & 01)) { # some patches quiltify_splitbrain_needed(); - progress "dgit view: creating patches-applied version using gbp pq"; + progress __ "dgit view: creating patches-applied version using gbp pq"; runcmd shell_cmd 'exec >/dev/null', gbp_pq, qw(import); # gbp pq import creates a fresh branch; push back to dgit-view runcmd @git, qw(update-ref refs/heads/dgit-view HEAD); @@ -5331,8 +5337,8 @@ END } if ($quilt_mode =~ m/gbp|dpm/ && ($diffbits->{O2A} & 02)) { - fail <{O2H} & 02) && # user has modified .gitignore !($diffbits->{O2A} & 02)) { # patches do not change .gitignore quiltify_splitbrain_needed(); - progress "dgit view: creating patch to represent .gitignore changes"; + progress __ + "dgit view: creating patch to represent .gitignore changes"; ensuredir "debian/patches"; my $gipatch = "debian/patches/auto-gitignore"; - open GIPATCH, ">>", "$gipatch" or die "$gipatch: $!"; - stat GIPATCH or die "$gipatch: $!"; - fail "$gipatch already exists; but want to create it". - " to record .gitignore changes" if (stat _)[7]; - print GIPATCH <>", "$gipatch" or confess "$gipatch: $!"; + stat GIPATCH or confess "$gipatch: $!"; + fail f_ "%s already exists; but want to create it". + " to record .gitignore changes", + $gipatch + if (stat _)[7]; + print GIPATCH <>$gipatch", @git, qw(diff), $unapplied, $headref, "--", sort keys %$editedignores; @@ -5368,11 +5378,12 @@ END print SERIES "auto-gitignore\n" or die $!; close SERIES or die $!; runcmd @git, qw(add -f -- debian/patches/series), $gipatch; - commit_admin <($notp); - my $c = $notp->{Child}; - $s .= "..".$abbrev->($c) if $c; - $s .= ": ".$notp->{Whynot}; - return $s; - }; if ($quilt_mode eq 'linear') { print STDERR "\n$us: error: quilt fixup cannot be linear. Stopped at:\n"; my $all_gdr = !!@nots; foreach my $notp (@nots) { - print STDERR "$us: ", $reportnot->($notp), "\n"; + my $c = $notp->{Child}; + my $cprange = $abbrev->($notp); + $cprange .= "..".$abbrev->($c) if $c; + print STDERR "$us: $cprange: $notp->{Whynot}\n"; $all_gdr &&= $notp->{Child} && (git_cat_file $notp->{Child}{Commit}, 'commit') =~ m{^\[git-debrebase(?! split[: ]).*\]$}m; @@ -5589,7 +5595,7 @@ sub quiltify ($$$$) { die "contains leading punctuation\n" if m{^\W} || m{/\W}; die "contains bad character(s)\n" if m{[^-a-z0-9_.+=~/]}i; die "is series file\n" if m{$series_filename_re}o; - die "too long" if length > 200; + die "too long\n" if length > 200; }; return $_ unless $@; print STDERR "quiltifying commit $cc:". @@ -5757,11 +5763,12 @@ sub unpack_playtree_linkorigs ($$) { sub quilt_fixup_delete_pc () { runcmd @git, qw(rm -rqf .pc); - commit_admin <