diff options
Diffstat (limited to 'infra')
-rwxr-xr-x | infra/dgit-repos-policy-debian | 8 | ||||
-rwxr-xr-x | infra/dgit-repos-server | 10 |
2 files changed, 6 insertions, 12 deletions
diff --git a/infra/dgit-repos-policy-debian b/infra/dgit-repos-policy-debian index db15310..46f1039 100755 --- a/infra/dgit-repos-policy-debian +++ b/infra/dgit-repos-policy-debian @@ -9,12 +9,6 @@ # dgit-repos-policy-debian ... push PACKAGE \ # VERSION SUITE TAGNAME DELIBERATELIES [...] # -# exit status is bitmap; bit weights (values) as follows -# 1 failure; operation must be rejected; other bits will be ignored -# 2 suppress dgit-repos-server's ff check ("push" only) -# 4 blow away repo away right away (ie before push or fetch) -# ("check-package" only) -# # cwd for push is a temporary repo where the to-be-pushed objects have # been received; TAGNAME is the version-based tag # @@ -25,7 +19,7 @@ use strict; use POSIX; use JSON; -use Debian::Dgit; +use Debian::Dgit qw(:DEFAULT :policyflags); our $distro = shift @ARGV // die "need DISTRO"; our $repos = shift @ARGV // die "need DGIT-REPOS-DIR"; diff --git a/infra/dgit-repos-server b/infra/dgit-repos-server index 6d7fb63..3f41a0b 100755 --- a/infra/dgit-repos-server +++ b/infra/dgit-repos-server @@ -87,7 +87,7 @@ use POSIX; use Fcntl qw(:flock); use File::Path qw(rmtree); -use Debian::Dgit; +use Debian::Dgit qw(:DEFAULT :policyflags); open DEBUG, ">/dev/null" or die $!; @@ -504,7 +504,7 @@ sub checks () { debug "translated version $v"; $tagname eq "debian/$v" or die; - my ($policy) = policyhook(2,'push',$package, + my ($policy) = policyhook(NOFFCHECK, 'push',$package, $version,$suite,$tagname, join(",",@delberatelies)); @@ -512,7 +512,7 @@ sub checks () { # check that our ref is being fast-forwarded debug "oldcommit $oldcommit"; - if (!($policy & 2) && $oldcommit =~ m/[^0]/) { + if (!($policy & NOFFCHECK) && $oldcommit =~ m/[^0]/) { $?=0; $!=0; my $mb = `git merge-base $commit $oldcommit`; chomp $mb; $mb eq $oldcommit or reject "not fast forward on dgit branch"; @@ -631,8 +631,8 @@ sub parseargsdispatch () { reject "unknown method" unless $mainfunc; - my ($policy, $pollock) = policyhook(4, 'check-package',$package); - if ($policy & 4) { + my ($policy, $pollock) = policyhook(FRESHREPO,'check-package',$package); + if ($policy & FRESHREPO) { my $garbagerepo = "$dgitrepos/_tmp/${package}_garbage"; acquiretree($garbagerepo,1); rmtree $garbagerepo; |