summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2016-07-16 17:59:07 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2016-07-17 13:46:14 +0100
commit611f11cc4c99ee77b24606ddb43afffe4af681c7 (patch)
tree36ed072ba275cd0a6208ae711814d9627ed401df
parent60690f11257949161344ac1392b365179dc763de (diff)
quilt innards: Change calling convention for quilt_check_splitbrain_cache
-rwxr-xr-xdgit31
1 files changed, 16 insertions, 15 deletions
diff --git a/dgit b/dgit
index 835366e..1e6be23 100755
--- a/dgit
+++ b/dgit
@@ -2994,15 +2994,10 @@ END
sub quilt_check_splitbrain_cache ($$) {
my ($headref, $upstreamversion) = @_;
- # Checks to see if we are in (potentially) split brain mode.
- # If so, computes the cache key and looks in the cache.
- # If split brain is not applicable, returns (undef,0).
- # Otherwise returns ($cachekey,HIT) where
- # HIT=0: miss; HIT=1: hit, needs different commit; HIT=2: same commit OK
-
- quilt_make_fake_dsc($upstreamversion);
-
- return (undef,0) unless quiltmode_splitbrain();
+ # Called only if we are in (potentially) split brain mode.
+ # Called in $ud.
+ # Computes the cache key and looks in the cache.
+ # Returns ($dgit_view_commitid, $cachekey) or (undef, $cachekey)
my $splitbrain_cachekey;
@@ -3052,16 +3047,16 @@ sub quilt_check_splitbrain_cache ($$) {
progress "dgit view: found cached (commit id $cachehit)";
runcmd @git, qw(checkout -q -b dgit-view), $cachehit;
$split_brain = 1;
- return ($splitbrain_cachekey, 1);
+ return ($cachehit, $splitbrain_cachekey);
}
progress "dgit view: found cached, no changes required";
- return ($splitbrain_cachekey, 2);
+ return ($headref, $splitbrain_cachekey);
}
die $! if GC->error;
failedcmd unless close GC;
printdebug "splitbrain cache miss\n";
- return ($splitbrain_cachekey, 0);
+ return (undef, $splitbrain_cachekey);
}
sub quilt_fixup_multipatch ($$$) {
@@ -3138,10 +3133,16 @@ sub quilt_fixup_multipatch ($$$) {
# afterwards with dpkg-source --before-build. That lets us save a
# tree object corresponding to .origs.
- my ($splitbrain_cachekey,$cachehit) =
- quilt_check_splitbrain_cache($headref, $upstreamversion);
+ my $splitbrain_cachekey;
+
+ quilt_make_fake_dsc($upstreamversion);
- return if $splitbrain_cachekey && $cachehit;
+ if (quiltmode_splitbrain()) {
+ my $cachehit;
+ ($cachehit, $splitbrain_cachekey) =
+ quilt_check_splitbrain_cache($headref, $upstreamversion);
+ return if $cachehit;
+ }
runcmd qw(sh -ec),
'exec dpkg-source --no-check --skip-patches -x fake.dsc >/dev/null';