chiark / gitweb /
--new is needed for read access to packages in NEW, too. Document this, and make...
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 9e2e66e4841b4adb690225fab1def69b6229df6d..1e389088fd10f7c2d97ae885cae0a8889afdb93a 100755 (executable)
--- 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.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',
               '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;
 
 
 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();
 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
     my $v = cfg("dgit-distro.$d.readonly", 'RETURN-UNDEF');
     $v //= 'a';
     return