chiark
/
gitweb
/
~ianmdlvl
/
dgit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Provide --force-unrepresentable.
[dgit.git]
/
dgit
diff --git
a/dgit
b/dgit
index 5ee61ef95567a5d851f7d8ae4f0f81525ce04cf8..5fa500c65cc7ff2393d0ceb6fdce458b52446954 100755
(executable)
--- a/
dgit
+++ b/
dgit
@@
-73,6
+73,8
@@
our $tagformat_want;
our $tagformat;
our $tagformatfn;
our $tagformat;
our $tagformatfn;
+our %forceopts = map { $_=>0 } qw(unrepresentable);
+
our %format_ok = map { $_=>1 } ("1.0","3.0 (native)","3.0 (quilt)");
our $suite_re = '[-+.0-9a-z]+';
our %format_ok = map { $_=>1 } ("1.0","3.0 (native)","3.0 (quilt)");
our $suite_re = '[-+.0-9a-z]+';
@@
-86,7
+88,7
@@
our $splitbraincache = 'dgit-intern/quilt-cache';
our (@git) = qw(git);
our (@dget) = qw(dget);
our (@git) = qw(git);
our (@dget) = qw(dget);
-our (@curl) = qw(curl
-f
);
+our (@curl) = qw(curl);
our (@dput) = qw(dput);
our (@debsign) = qw(debsign);
our (@gpg) = qw(gpg);
our (@dput) = qw(dput);
our (@debsign) = qw(debsign);
our (@gpg) = qw(gpg);
@@
-222,6
+224,12
@@
END {
sub badcfg { print STDERR "$us: invalid configuration: @_\n"; exit 12; }
sub badcfg { print STDERR "$us: invalid configuration: @_\n"; exit 12; }
+sub forceable_fail ($$) {
+ my ($forceoptsl, $msg) = @_;
+ fail $msg unless grep { $forceopts{$_} } @$forceoptsl;
+ print STDERR "warning: overriding problem due to --force:\n". $msg;
+}
+
sub no_such_package () {
print STDERR "$us: package $package does not exist in suite $isuite\n";
exit 4;
sub no_such_package () {
print STDERR "$us: package $package does not exist in suite $isuite\n";
exit 4;
@@
-955,7
+963,7
@@
sub pool_dsc_subpath ($$) {
sub archive_api_query_cmd ($) {
my ($subpath) = @_;
sub archive_api_query_cmd ($) {
my ($subpath) = @_;
- my @cmd =
qw(curl -sS
);
+ my @cmd =
(@curl, qw(-sS)
);
my $url = access_cfg('archive-query-url');
if ($url =~ m#^https://([-.0-9a-z]+)/#) {
my $host = $1;
my $url = access_cfg('archive-query-url');
if ($url =~ m#^https://([-.0-9a-z]+)/#) {
my $host = $1;
@@
-989,7
+997,16
@@
sub api_query ($$) {
badcfg "ftpmasterapi archive query method takes no data part"
if length $data;
my @cmd = archive_api_query_cmd($subpath);
badcfg "ftpmasterapi archive query method takes no data part"
if length $data;
my @cmd = archive_api_query_cmd($subpath);
+ my $url = $cmd[$#cmd];
+ push @cmd, qw(-w %{http_code});
my $json = cmdoutput @cmd;
my $json = cmdoutput @cmd;
+ unless ($json =~ s/\d+\d+\d$//) {
+ failedcmd_report_cmd undef, @cmd;
+ fail "curl failed to print 3-digit HTTP code";
+ }
+ my $code = $&;
+ fail "fetch of $url gave HTTP code $code"
+ unless $url =~ m#^file://# or $code =~ m/^2/;
return decode_json($json);
}
return decode_json($json);
}
@@
-1321,7
+1338,7
@@
sub check_for_git () {
my $suffix = access_cfg('git-check-suffix','git-suffix',
'RETURN-UNDEF') // '.git';
my $url = "$prefix/$package$suffix";
my $suffix = access_cfg('git-check-suffix','git-suffix',
'RETURN-UNDEF') // '.git';
my $url = "$prefix/$package$suffix";
- my @cmd = (
qw(curl
-sS -I), $url);
+ my @cmd = (
@curl, qw(
-sS -I), $url);
my $result = cmdoutput @cmd;
$result =~ s/^\S+ 200 .*\n\r?\n//;
# curl -sS -I with https_proxy prints
my $result = cmdoutput @cmd;
$result =~ s/^\S+ 200 .*\n\r?\n//;
# curl -sS -I with https_proxy prints
@@
-2007,7
+2024,7
@@
sub complete_file_from_dsc ($$) {
$furl .= "/$f";
die "$f ?" unless $f =~ m/^\Q${package}\E_/;
die "$f ?" if $f =~ m#/#;
$furl .= "/$f";
die "$f ?" unless $f =~ m/^\Q${package}\E_/;
die "$f ?" if $f =~ m#/#;
- runcmd_ordryrun_local @curl,qw(-o),$tf,'--',"$furl";
+ runcmd_ordryrun_local @curl,qw(-
f -
o),$tf,'--',"$furl";
return 0 if !act_local();
$downloaded = 1;
}
return 0 if !act_local();
$downloaded = 1;
}
@@
-4596,7
+4613,7
@@
END
if (@unrepres) {
print STDERR "dgit: cannot represent change: $_->[1]: $_->[0]\n"
foreach @unrepres;
if (@unrepres) {
print STDERR "dgit: cannot represent change: $_->[1]: $_->[0]\n"
foreach @unrepres;
- f
ail
<<END;
+ f
orceable_fail [qw(unrepresentable)],
<<END;
HEAD has changes to .orig[s] which are not representable by `3.0 (quilt)'
END
}
HEAD has changes to .orig[s] which are not representable by `3.0 (quilt)'
END
}
@@
-4608,7
+4625,7
@@
END
push @failsuggestion, "This might be a patches-applied branch.";
}
push @failsuggestion, "Maybe you need to specify one of".
push @failsuggestion, "This might be a patches-applied branch.";
}
push @failsuggestion, "Maybe you need to specify one of".
- " --
quilt=gbp --quilt=
dpm --quilt=unapplied ?";
+ " --
[quilt=]gbp --[quilt=]
dpm --quilt=unapplied ?";
if (quiltmode_splitbrain()) {
quiltify_splitbrain($clogp, $unapplied, $headref,
if (quiltmode_splitbrain()) {
quiltify_splitbrain($clogp, $unapplied, $headref,
@@
-5010,6
+5027,7
@@
sub cmd_archive_api_query {
badusage "need only 1 subpath argument" unless @ARGV==1;
my ($subpath) = @ARGV;
my @cmd = archive_api_query_cmd($subpath);
badusage "need only 1 subpath argument" unless @ARGV==1;
my ($subpath) = @ARGV;
my @cmd = archive_api_query_cmd($subpath);
+ push @cmd, qw(-f);
debugcmd ">",@cmd;
exec @cmd or fail "exec curl: $!\n";
}
debugcmd ">",@cmd;
exec @cmd or fail "exec curl: $!\n";
}
@@
-5142,6
+5160,9
@@
sub parseopts () {
($om = $opts_opt_map{$1})) {
push @ropts, $_;
push @$om, $2;
($om = $opts_opt_map{$1})) {
push @ropts, $_;
push @$om, $2;
+ } elsif (m/^--(gbp|dpm)$/s) {
+ push @ropts, "--quilt=$1";
+ $quilt_mode = $1;
} elsif (m/^--ignore-dirty$/s) {
push @ropts, $_;
$ignoredirty = 1;
} elsif (m/^--ignore-dirty$/s) {
push @ropts, $_;
$ignoredirty = 1;
@@
-5163,6
+5184,10
@@
sub parseopts () {
} elsif (m/^--deliberately-($deliberately_re)$/s) {
push @ropts, $_;
push @deliberatelies, $&;
} elsif (m/^--deliberately-($deliberately_re)$/s) {
push @ropts, $_;
push @deliberatelies, $&;
+ } elsif (m/^--force-(.*)/ && defined $forceopts{$1}) {
+ push @ropts, $&;
+ $forceopts{$1} = 1;
+ $_='';
} elsif (m/^--dgit-tag-format=(old|new)$/s) {
# undocumented, for testing
push @ropts, $_;
} elsif (m/^--dgit-tag-format=(old|new)$/s) {
# undocumented, for testing
push @ropts, $_;