From 5b1cc655fa48ae96db0d4ad57b7cf340710c740b Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 21 Jul 2015 18:57:08 +0100 Subject: --new is needed for read access to packages in NEW, too. Document this, and make it work properly. --- debian/changelog | 2 ++ dgit | 17 +++++++++++++++++ dgit.1 | 6 ++++-- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1d11dca..4a0765a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -23,6 +23,8 @@ dgit (1.1) unstable; urgency=low * dgit(7): No longer say that dgit-repos lives on Alioth. * Infrastructure: Get mirroring right for fresh repos of existing packages (!) + * --new is needed for read access to packages in NEW, too. Document + this, and make it work properly. -- diff --git a/dgit b/dgit index 9e2e66e..1e38908 100755 --- a/dgit +++ b/dgit @@ -446,6 +446,7 @@ our %defcfg = ('dgit.default.distro' => 'debian', 'dgit-distro.debian.archive-query' => 'ftpmasterapi:', 'dgit-distro.debian.git-check' => 'url', 'dgit-distro.debian.git-check-suffix' => '/info/refs', + 'dgit-distro.debian.new-private-pushers' => 't', 'dgit-distro.debian/push.git-url' => '', 'dgit-distro.debian/push.git-host' => 'push.dgit.debian.org', 'dgit-distro.debian/push.git-user-force' => 'dgit', @@ -549,8 +550,24 @@ sub access_quirk () { our $access_forpush; +sub parse_cfg_bool ($$$) { + my ($what,$def,$v) = @_; + $v //= $def; + return + $v =~ m/^[ty1]/ ? 1 : + $v =~ m/^[fn0]/ ? 0 : + badcfg "$what needs t (true, y, 1) or f (false, n, 0) not \`$v'"; +} + sub access_forpush_config () { my $d = access_basedistro(); + + return 1 if + $new_package && + parse_cfg_bool('new-private-pushers', 0, + cfg("dgit-distro.$d.new-private-pushers", + 'RETURN-UNDEF')); + my $v = cfg("dgit-distro.$d.readonly", 'RETURN-UNDEF'); $v //= 'a'; return diff --git a/dgit.1 b/dgit.1 index 0e38149..77d3252 100644 --- a/dgit.1 +++ b/dgit.1 @@ -306,8 +306,10 @@ The build-dependencies are not checked (due to which violates policy, but may work in practice. .TP .BR -N " | " --new -The package may be new in this suite. Without this, dgit will -refuse to push. +The package is or may be new in this suite. Without this, dgit will +refuse to push. It may (for Debian, will) be unable to access the git +history for any packages which have been newly pushed and have not yet +been published. .TP .BR --ignore-dirty Do not complain if the working tree does not match your git HEAD. -- cgit v1.2.3