From: Ian Jackson Date: Mon, 11 May 2015 08:35:16 +0000 (+0100) Subject: Infra: pass $distrodir to policy hook (as yet unused, intended for config) X-Git-Tag: debian/0.30~174 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=ac3fd2f34f0e3c9555afcd8fc71b90f04b27e658 Infra: pass $distrodir to policy hook (as yet unused, intended for config) --- diff --git a/infra/dgit-repos-policy-debian b/infra/dgit-repos-policy-debian index 7d12b6ef..1e32d391 100755 --- a/infra/dgit-repos-policy-debian +++ b/infra/dgit-repos-policy-debian @@ -20,6 +20,7 @@ enabledebuglevel $ENV{'DGIT_DRS_DEBUG'}; our $distro = shift @ARGV // die "need DISTRO"; our $repos = shift @ARGV // die "need DGIT-REPOS-DIR"; our $dgitlive = shift @ARGV // die "need DGIT-LIVE-DIR"; +our $distrodir = shift @ARGV // die "need DISTRO-DIR"; our $action = shift @ARGV // die "need ACTION"; our $publicmode = 02775; diff --git a/infra/dgit-repos-server b/infra/dgit-repos-server index 634f91ed..9387ee3b 100755 --- a/infra/dgit-repos-server +++ b/infra/dgit-repos-server @@ -9,7 +9,7 @@ # --suites=SUITES-FILE default DISTRO-DIR/suites # --policy-hook=POLICY-HOOK default DISTRO-DIR/policy-hook # --dgit-live=DGIT-LIVE-DIR default DISTRO-DIR/dgit-live -# (DISTRO-DIR is not used other than as default) +# (DISTRO-DIR is not used other than as default and to pass to policy hook) # internal usage: # .../dgit-repos-server --pre-receive-hook PACKAGE # @@ -117,7 +117,7 @@ $SIG{__WARN__} = sub { die $_[0]; }; # cleanup to do # # Policy hook script is invoked like this: -# POLICY-HOOK-SCRIPT DISTRO DGIT-REPOS-DIR DGIT-LIVE-DIR ACTION... +# POLICY-HOOK-SCRIPT DISTRO DGIT-REPOS-DIR DGIT-LIVE-DIR DISTRO-DIR ACTION... # ie. # POLICY-HOOK-SCRIPT ... check-list [...] # POLICY-HOOK-SCRIPT ... check-package PACKAGE [...] @@ -179,6 +179,7 @@ our $distro; our $suitesfile; our $policyhook; our $dgitlive; +our $distrodir; our $destrepo; our $workrepo; our $keyrings; @@ -270,7 +271,7 @@ sub policyhook { my ($policyallowbits, @polargs) = @_; # => ($exitstatuspolicybitmap); die if $policyallowbits & ~0x3e; - my @cmd = ($policyhook,$distro,$dgitrepos,$dgitlive,@polargs); + my @cmd = ($policyhook,$distro,$dgitrepos,$dgitlive,$distrodir,@polargs); debugcmd '+',@cmd; my $r = system @cmd; die "system: $!" if $r < 0; @@ -821,7 +822,8 @@ our %indistrodir = ( 'dgit-live' => \$dgitlive, ); -our @hookenvs = qw(distro suitesfile policyhook dgitlive keyrings dgitrepos); +our @hookenvs = qw(distro suitesfile policyhook + dgitlive keyrings dgitrepos distrodir); # workrepo and destrepo handled ad-hoc @@ -919,7 +921,7 @@ sub parseargsdispatch () { } $distro = $ENV{'DGIT_DRS_DISTRO'} = argval(); - my $distrodir = argval(); + $distrodir = argval(); $keyrings = $ENV{'DGIT_DRS_KEYRINGS'} = argval(); foreach my $dk (keys %indistrodir) {