summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2022-05-28 21:15:15 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2022-05-28 21:56:10 +0100
commit090ba001a795f4f123152dd5c53809ae6a0a954b (patch)
tree46790e98e12f2ddbab10f74c3fd7c909955b058c
parentc4bf35e9b876522417ff6c0e9ea669583f24280c (diff)
dgit: Move .pc aside while running gbp pq import
The new --ignore-new mode (which is now the default) trips on .pc, which gbp doesn't expect to see. Part of #1005873. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rwxr-xr-xdgit28
1 files changed, 21 insertions, 7 deletions
diff --git a/dgit b/dgit
index 24ed457..d39dc4b 100755
--- a/dgit
+++ b/dgit
@@ -324,6 +324,16 @@ sub gbp_pq {
return opts_opt_multi_cmd [], @gbp_pq;
}
+sub gbp_pq_pc_aside (&) {
+ my ($f) = @_;
+ my $undo = rename ".pc", "../pc-aside";
+ confess "$!" unless $undo || $!==ENOENT;
+ $f->();
+ if ($undo) {
+ rename "../pc-aside", ".pc", or confess $!;
+ }
+}
+
sub dgit_privdir () {
our $dgit_privdir_made //= ensure_a_playground 'dgit';
}
@@ -2679,12 +2689,14 @@ END
my @showcmd = (gbp_pq, qw(import));
my @realcmd = shell_cmd
'exec >/dev/null 2>>../../gbp-pq-output', @showcmd;
- debugcmd "+",@realcmd;
- if (system @realcmd) {
- die f_ "%s failed: %s\n",
- +(shellquote @showcmd),
- failedcmd_waitstatus();
- }
+ gbp_pq_pc_aside(sub {
+ debugcmd "+",@realcmd;
+ if (system @realcmd) {
+ die f_ "%s failed: %s\n",
+ +(shellquote @showcmd),
+ failedcmd_waitstatus();
+ }
+ });
my $gapplied = git_rev_parse('HEAD');
my $gappliedtree = cmdoutput @git, qw(rev-parse HEAD:);
@@ -5536,7 +5548,9 @@ ENDU
if ($quilt_mode =~ m/gbp|unapplied|baredebian/ &&
($diffbits->{O2A} & 01)) { # some patches
progress __ "dgit view: creating patches-applied version using gbp pq";
- runcmd shell_cmd 'exec >/dev/null', gbp_pq, qw(import);
+ gbp_pq_pc_aside(sub {
+ 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);
runcmd @git, qw(checkout -q dgit-view);