From 25f567819dab569d2f9bbe31626f32197b799e7d Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 9 Oct 2013 07:49:34 +0100 Subject: wip changes for remote push - split off sign_changes --- dgit | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/dgit b/dgit index 83bed54..9d2d876 100755 --- a/dgit +++ b/dgit @@ -1127,6 +1127,16 @@ END return ($tagobjfn); } +sub sign_changes ($) { + my ($changesfile) = @_; + if ($sign) { + my @debsign_cmd = @debsign; + push @debsign_cmd, "-k$keyid" if defined $keyid; + push @debsign_cmd, $changesfile; + runcmd_ordryrun @debsign_cmd; + } +} + sub dopush () { print DEBUG "actually entering push\n"; prep_ud(); @@ -1222,19 +1232,15 @@ sub dopush () { } } - if ($sign) { - if ($we_are_responder) { - my $dryrunsuffix = $dryrun ? ".tmp" : ""; - responder_receive_files('signed-changes-dsc', - "$changesfile$dryrunsuffix", - "../$dscfn$dryrunsuffix"); - } else { - my @debsign_cmd = @debsign; - push @debsign_cmd, "-k$keyid" if defined $keyid; - push @debsign_cmd, $changesfile; - runcmd_ordryrun @debsign_cmd; - } + if ($we_are_responder) { + my $dryrunsuffix = $dryrun ? ".tmp" : ""; + responder_receive_files('signed-dsc-changes', + "../$dscfn$dryrunsuffix", + "$changesfile$dryrupnsuffix"); + } else { + sign_changes $changesfile; } + runcmd_ordryrun @git, qw(push),access_giturl(),"refs/tags/$tag"; my $host = access_cfg('upload-host','RETURN-UNDEF'); my @hostarg = defined($host) ? ($host,) : (); -- cgit v1.2.3