summaryrefslogtreecommitdiff
path: root/dgit
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2019-05-26 12:48:59 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2019-06-28 12:45:38 +0100
commit1a2569eb0561793ae8b5d8c5dab9f90f2fd3fcfa (patch)
treed02cfd1275ba8dd1b193c478e25d6c7319d28c0e /dgit
parente473bf523d358431f9eac1356b3807636a951f85 (diff)
dgit: quilt_need_fake_dsc: Make idempotent
No overall functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'dgit')
-rwxr-xr-xdgit15
1 files changed, 10 insertions, 5 deletions
diff --git a/dgit b/dgit
index b0c60c4..ef5fc19 100755
--- a/dgit
+++ b/dgit
@@ -4495,7 +4495,7 @@ END
if (quiltmode_splitbrain()) {
$do_split_brain = 1;
changedir $playground;
- quilt_make_fake_dsc($upstreamversion);
+ quilt_need_fake_dsc($upstreamversion);
my $cachekey;
($dgithead, $cachekey) =
quilt_check_splitbrain_cache($actualhead, $upstreamversion);
@@ -5926,9 +5926,14 @@ sub quilt_fixup_singlepatch ($$$) {
commit_quilty_patch();
}
-sub quilt_make_fake_dsc ($) {
+sub quilt_need_fake_dsc ($) {
+ # cwd should be playground
my ($upstreamversion) = @_;
+ return if stat_exists "fake.dsc";
+ # ^ OK to test this as a sentinel because if we created it
+ # we must either have done the rest too, or crashed.
+
my $fakeversion="$upstreamversion-~~DGITFAKE";
my $fakedsc=new IO::File 'fake.dsc', '>' or confess "$!";
@@ -5972,7 +5977,7 @@ END
sub quilt_fakedsc2unapplied ($$) {
my ($headref, $upstreamversion) = @_;
# must be run in the playground
- # quilt_make_fake_dsc must have been called
+ # quilt_need_fake_dsc must have been called
runcmd qw(sh -ec),
'exec dpkg-source --no-check --skip-patches -x fake.dsc >/dev/null';
@@ -6125,7 +6130,7 @@ sub quilt_fixup_multipatch ($$$) {
my $splitbrain_cachekey;
- quilt_make_fake_dsc($upstreamversion);
+ quilt_need_fake_dsc($upstreamversion);
if (quiltmode_splitbrain()) {
my $cachehit;
@@ -6894,7 +6899,7 @@ sub cmd_print_unapplied_treeish {
prep_ud();
changedir $playground;
my $uv = upstreamversion $version;
- quilt_make_fake_dsc($uv);
+ quilt_need_fake_dsc($uv);
my $u = quilt_fakedsc2unapplied($headref, $uv);
print $u, "\n" or confess "$!";
}