X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=Debian%2FDgit.pm;h=e177a83950e0eb6fa8ee516f946fcb312fe00623;hp=e2f8edd05848c76f74e13c65d6561e39df1d1e48;hb=1c6183785fa3a9f6fe60a55bb9ff200963b4e791;hpb=996984bbcc5c1c7b4ed734fdb7a3dd844f2ff567 diff --git a/Debian/Dgit.pm b/Debian/Dgit.pm index e2f8edd0..e177a839 100644 --- a/Debian/Dgit.pm +++ b/Debian/Dgit.pm @@ -1,10 +1,12 @@ -# +# -*- perl -*- package Debian::Dgit; use strict; use warnings; +use POSIX; + BEGIN { use Exporter (); our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); @@ -14,7 +16,7 @@ BEGIN { @EXPORT = qw(debiantag server_branch server_ref stat_exists git_for_each_ref $package_re $branchprefix); - %EXPORT_TAGS = ( policyflags => qw() ); + %EXPORT_TAGS = ( policyflags => [qw()] ); @EXPORT_OK = qw(); } @@ -23,17 +25,12 @@ our @EXPORT_OK; our $package_re = '[0-9a-z][-+.0-9a-z]*'; our $branchprefix = 'dgit'; - # policy hook exit status bits -# any unexpected bits mean failure, and then known set bits are ignored - +# see dgit-repos-server head comment for documentation +# 1 is reserved in case something fails with `exit 1' sub NOFFCHECK () { return 2; } -# suppress dgit-repos-server's ff check ("push" only) - sub FRESHREPO () { return 4; } -# blow away repo right away (ie, as if before push or fetch) -# ("check-package" and "push" only) - +# 128 is reserved sub debiantag ($) { my ($v) = @_; @@ -56,7 +53,7 @@ sub git_for_each_ref ($$) { # calls $func->($objid,$objtype,$fullrefname,$reftail); # $reftail is RHS of ref after refs/\w+/ # breaks if $pattern matches any ref `refs/blah' where blah has no `/' - my $fh = new IO::File, "-|", qw(git for-each-ref), $pattern or die $!; + my $fh = new IO::File "-|", qw(git for-each-ref), $pattern or die $!; while (<$fh>) { m#^(\w+)\s+(\w+)\s+(refs/\w+/(\S+))\s# or die "$_ ?"; $func->($1,$2,$3,$4);