chiark
/
gitweb
/
~ianmdlvl
/
dgit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Build system substitutions, for absurdities
[dgit.git]
/
dgit
diff --git
a/dgit
b/dgit
index 19a0835a09096809f788bc96d346e6d96805d391..344d006692e40a80b40517d58e83502c16284020 100755
(executable)
--- a/
dgit
+++ b/
dgit
@@
-41,6
+41,7
@@
use Carp;
use Debian::Dgit;
our $our_version = 'UNRELEASED'; ###substituted###
use Debian::Dgit;
our $our_version = 'UNRELEASED'; ###substituted###
+our $absurdity = undef; ###substituted###
our @rpushprotovsn_support = qw(4 3 2); # 4 is new tag format
our $protovsn;
our @rpushprotovsn_support = qw(4 3 2); # 4 is new tag format
our $protovsn;
@@
-73,6
+74,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]+';
@@
-144,6
+147,11
@@
our @ourdscfield = qw(Dgit Vcs-Dgit-Master);
our $csuite;
our $instead_distro;
our $csuite;
our $instead_distro;
+if (!defined $absurdity) {
+ $absurdity = $0;
+ $absurdity =~ s{/[^/]+$}{/absurd} or die;
+}
+
sub debiantag ($$) {
my ($v,$distro) = @_;
return $tagformatfn->($v, $distro);
sub debiantag ($$) {
my ($v,$distro) = @_;
return $tagformatfn->($v, $distro);
@@
-222,6
+230,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;
@@
-989,7
+1003,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);
}
@@
-4596,7
+4619,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
}
@@
-5167,6
+5190,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, $_;