use strict;
use POSIX;
+use Debian::Dgit;
+
open DEBUG, '>/dev/null' or die $!;
if (@ARGV && $ARGV[0] eq '-D') {
shift @ARGV;
'@/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
# repos/
# suites
# diverts
+# policy-hook
# plus files required by the authrune (by default, keyrings/ and dm.txt)
#
# diverts should be list of
# 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) = @_;
$dgitlive= "$d/dgit-live";
$repos= "$d/repos";
$suites= "$d/suites";
+ $policyhook= "$d/policy-hook";
$authrune =~ s/\@/$d/g;
selectpackage $2,$3;
if ($cmd eq 'receive-pack') {
my $s = "$dgitlive/infra/dgit-repos-server";
- exec $s, $distro, $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;