chiark
/
gitweb
/
~ianmdlvl
/
dgit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Infra: pass $distrodir to policy hook (as yet unused, intended for config)
[dgit.git]
/
infra
/
dgit-repos-server
diff --git
a/infra/dgit-repos-server
b/infra/dgit-repos-server
index 634f91edab17ee52103433f1e1790f3f92b14dba..9387ee3b8e9d2e06a86b5e50e821f56e0dfb3140 100755
(executable)
--- 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
# --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
#
# 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:
# 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 [...]
# 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 $suitesfile;
our $policyhook;
our $dgitlive;
+our $distrodir;
our $destrepo;
our $workrepo;
our $keyrings;
our $destrepo;
our $workrepo;
our $keyrings;
@@
-270,7
+271,7
@@
sub policyhook {
my ($policyallowbits, @polargs) = @_;
# => ($exitstatuspolicybitmap);
die if $policyallowbits & ~0x3e;
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;
debugcmd '+',@cmd;
my $r = system @cmd;
die "system: $!" if $r < 0;
@@
-821,7
+822,8
@@
our %indistrodir = (
'dgit-live' => \$dgitlive,
);
'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
# workrepo and destrepo handled ad-hoc
@@
-919,7
+921,7
@@
sub parseargsdispatch () {
}
$distro = $ENV{'DGIT_DRS_DISTRO'} = argval();
}
$distro = $ENV{'DGIT_DRS_DISTRO'} = argval();
-
my $distrodir
= argval();
+
$distrodir
= argval();
$keyrings = $ENV{'DGIT_DRS_KEYRINGS'} = argval();
foreach my $dk (keys %indistrodir) {
$keyrings = $ENV{'DGIT_DRS_KEYRINGS'} = argval();
foreach my $dk (keys %indistrodir) {