chiark / gitweb /
dgit-repos-policy-debian: Fix add_taint
[dgit.git] / infra / dgit-ssh-dispatch
index b515edad988391635275fd4c54c7400a2eb7e9aa..f29515f53e073c8b19e7345f950a278dad58e896 100755 (executable)
@@ -3,6 +3,8 @@
 use strict;
 use POSIX;
 
+use Debian::Dgit;
+
 open DEBUG, '>/dev/null' or die $!;
 if (@ARGV && $ARGV[0] eq '-D') {
     shift @ARGV;
@@ -16,22 +18,23 @@ $authrune //= join ':',
     '@/keyrings/debian-keyring.gpg,a',
     '@/keyrings/debian-maintainers.gpg,m@/dm.txt';
 
-our $lre = '[0-9a-z][-+.0-9a-z]*';
+our $lre = $package_re;
 our $qre = '["'."']?";
 
-# $dispatchdir should contain
+# $dispatchdir/distro=DISTRO should contain
 #    dgit-live   a clone of dgit
-#    repos/
-#    suites
 #    diverts
+#    repos/             }  by virtue of
+#    suites             }    dgit-repos-server's defaults relating to
+#    policy-hook        }    dispatch-dir
 # plus files required by the authrune (by default, keyrings/ and dm.txt)
 #
 # diverts should be list of
 #  <pat> [<divert-to>]
 # where <pat> is a package name pattern which may contain * or literals.
 
-our ($distro,$pkg);
-our ($dgitlive,$repos,$suites,$diverts,$repo);
+our ($distro,$pkg, $d);
+our ($dgitlive,$repos,$suites,$diverts,$policyhook,$repo);
 
 sub checkdivert ($) {
     my ($df) = @_;
@@ -70,7 +73,7 @@ sub selectpackage ($$;$) {
     my $divertfn;
     ($distro,$pkg, $divertfn) = @_; # $distro,$pkg must have sane syntax
 
-    my $d = "$dispatchdir/distro=$distro";
+    $d = "$dispatchdir/distro=$distro";
 
     if (!stat $d) {
        die $! unless $!==ENOENT;
@@ -80,6 +83,7 @@ sub selectpackage ($$;$) {
     $dgitlive=    "$d/dgit-live";
     $repos=       "$d/repos";
     $suites=      "$d/suites";
+    $policyhook=  "$d/policy-hook";
 
     $authrune =~ s/\@/$d/g;
 
@@ -121,7 +125,7 @@ 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, $d, $authrune, qw(--ssh);
            die "exec $s: $!";
        } elsif ($cmd eq 'upload-pack') {
            $repo='$repos/_empty' unless hasrepo;