chiark / gitweb /
Introduce policy-hook script into dgit-ssh-dispatch and dgit-repos-server, but do...
[dgit.git] / infra / dgit-ssh-dispatch
index b515edad988391635275fd4c54c7400a2eb7e9aa..ed1e6ef9924e4f421d353388d97b552fbcd0cff5 100755 (executable)
@@ -24,6 +24,7 @@ our $qre = '["'."']?";
 #    repos/
 #    suites
 #    diverts
+#    policy-hook
 # plus files required by the authrune (by default, keyrings/ and dm.txt)
 #
 # diverts should be list of
@@ -31,7 +32,7 @@ our $qre = '["'."']?";
 # where <pat> is a package name pattern which may contain * or literals.
 
 our ($distro,$pkg);
-our ($dgitlive,$repos,$suites,$diverts,$repo);
+our ($dgitlive,$repos,$suites,$diverts,$policyhook,$repo);
 
 sub checkdivert ($) {
     my ($df) = @_;
@@ -80,6 +81,7 @@ sub selectpackage ($$;$) {
     $dgitlive=    "$d/dgit-live";
     $repos=       "$d/repos";
     $suites=      "$d/suites";
+    $policyhook=  "$d/policy-hook";
 
     $authrune =~ s/\@/$d/g;
 
@@ -121,7 +123,8 @@ sub dispatch () {
        selectpackage $2,$3;
        if ($cmd eq 'receive-pack') {
            my $s = "$dgitlive/infra/dgit-repos-server";
-           exec $s, $suites, $authrune, $repos, qw(--ssh);
+           exec $s, $distro, $suites, $authrune, $repos,
+                   $policyhook, qw(--ssh);
            die "exec $s: $!";
        } elsif ($cmd eq 'upload-pack') {
            $repo='$repos/_empty' unless hasrepo;