summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog2
-rwxr-xr-xdgit36
2 files changed, 38 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 24f2ea6..a288558 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -16,6 +16,8 @@ dgit (2.9~) unstable; urgency=low
timestamp-dependent FTBFS bugs (eg #842452).
* Support dgit --delayed= push (with a warning in the manpage
about possible skew).
+ * dgit gbp-build will arrange to let gbp buildpackage generate
+ .orig tarballs if it seems applicable. Closes:#841094.
--
diff --git a/dgit b/dgit
index ca907f3..fa713fa 100755
--- a/dgit
+++ b/dgit
@@ -5176,6 +5176,24 @@ sub pre_gbp_build {
}
sub cmd_gbp_build {
+ build_prep_early();
+
+ # gbp can make .origs out of thin air. In my tests it does this
+ # even for a 1.0 format package, with no origs present. So I
+ # guess it keys off just the version number. We don't know
+ # exactly what .origs ought to exist, but let's assume that we
+ # should run gbp if: the version has an upstream part and the main
+ # orig is absent.
+ my $upstreamversion = upstreamversion $version;
+ my $origfnpat = srcfn $upstreamversion, '.orig.tar.*';
+ my $gbp_make_orig = $version =~ m/-/ && !(() = glob "../$origfnpat");
+
+ if ($gbp_make_orig) {
+ clean_tree();
+ $cleanmode = 'none'; # don't do it again
+ $need_split_build_invocation = 1;
+ }
+
my @dbp = @dpkgbuildpackage;
my $wantsrc = massage_dbp_args \@dbp, \@ARGV;
@@ -5191,6 +5209,24 @@ sub cmd_gbp_build {
push @cmd, (qw(-us -uc --git-no-sign-tags), "--git-builder=@dbp");
+ if ($gbp_make_orig) {
+ ensuredir '.git/dgit';
+ my $ok = '.git/dgit/origs-gen-ok';
+ unlink $ok or $!==&ENOENT or die $!;
+ my @origs_cmd = @cmd;
+ push @origs_cmd, qw(--git-cleaner=true);
+ push @origs_cmd, "--git-prebuild=touch $ok .git/dgit/no-such-dir/ok";
+ push @origs_cmd, @ARGV;
+ if (act_local()) {
+ debugcmd @origs_cmd;
+ system @origs_cmd;
+ do { local $!; stat_exists $ok; }
+ or failedcmd @origs_cmd;
+ } else {
+ dryrun_report @origs_cmd;
+ }
+ }
+
if ($wantsrc > 0) {
build_source();
midbuild_checkchanges_vanilla $wantsrc;