From: Ian Jackson Date: Mon, 9 Jan 2017 16:07:15 +0000 (+0000) Subject: dgit: $isuite handling: Defer calls to access_* until first `want' X-Git-Tag: archive/debian/3.0~6 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=65c5679375e4c1b05bb621624bc9686cab422561;p=dgit.git dgit: $isuite handling: Defer calls to access_* until first `want' pushing, rpush_handle_protovsn_bothends, and quiltmode, all depend on access_*. For that we need $isuite, but we only get that (in the form of $csuite) from the build host. We can move all of these calls into i_resp_want, which is called the first time the build host actually wants something from us. Signed-off-by: Ian Jackson --- diff --git a/dgit b/dgit index 11f473ca..f677562d 100755 --- a/dgit +++ b/dgit @@ -4440,7 +4440,6 @@ sub i_method { } sub cmd_rpush { - pushing(); my $host = nextarg; my $dir; if ($host =~ m/^((?:[^][]|\[[^][]*\])*)\:/) { @@ -4475,11 +4474,6 @@ sub cmd_rpush { die "$protovsn ?" unless grep { $_ eq $protovsn } @rpushprotovsn_support; $supplementary_message = '' unless $protovsn >= 3; - fail "rpush negotiated protocol version $protovsn". - " which does not support quilt mode $quilt_mode" - if quiltmode_splitbrain; - - rpush_handle_protovsn_bothends(); for (;;) { my ($icmd,$iargs) = initiator_expect { m/^(\S+)(?: (.*))?$/; @@ -4543,6 +4537,17 @@ our %i_wanted; sub i_resp_want ($) { my ($keyword) = @_; die "$keyword ?" if $i_wanted{$keyword}++; + + defined $i_param{'csuite'} or badproto \*RO, "premature desire, no csuite"; + $isuite = $i_param{'csuite'}; + + pushing(); + rpush_handle_protovsn_bothends(); + + fail "rpush negotiated protocol version $protovsn". + " which does not support quilt mode $quilt_mode" + if quiltmode_splitbrain; + my @localpaths = i_method "i_want", $keyword; printdebug "[[ $keyword @localpaths\n"; foreach my $localpath (@localpaths) {