chiark / gitweb /
Dgit.pm: Introduce $deliberately_re and use it everywhere
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 17 May 2015 13:11:43 +0000 (14:11 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 31 May 2015 10:54:14 +0000 (11:54 +0100)
Debian/Dgit.pm
dgit
infra/dgit-repos-server

index 5953490..3f2988e 100644 (file)
@@ -17,7 +17,8 @@ BEGIN {
     @EXPORT      = qw(debiantag server_branch server_ref
                       stat_exists git_for_each_ref
                       git_for_each_tag_referring
-                      $package_re $component_re $branchprefix
+                      $package_re $component_re $deliberately_re
+                      $branchprefix
                       initdebug enabledebug enabledebuglevel
                       printdebug debugcmd
                       $debugprefix *debuglevel *DEBUG
@@ -30,6 +31,7 @@ our @EXPORT_OK;
 
 our $package_re = '[0-9a-z][-+.0-9a-z]*';
 our $component_re = '[0-9a-zA-Z][-+.0-9a-zA-Z]*';
+our $deliberately_re = "(?:TEST-)?$package_re";
 our $branchprefix = 'dgit';
 
 # policy hook exit status bits
diff --git a/dgit b/dgit
index 8db03b3..e80faf3 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -2784,7 +2784,7 @@ sub parseopts () {
            } elsif (m/^--no-rm-on-error$/s) {
                push @ropts, $_;
                $rmonerror = 0;
-           } elsif (m/^--deliberately-($suite_re)$/s) {
+           } elsif (m/^--deliberately-($deliberately_re)$/s) {
                push @ropts, $_;
                push @deliberatelies, $&;
            } else {
index 036469e..2616406 100755 (executable)
@@ -499,7 +499,7 @@ sub parsetag () {
            while (length) {
                if (s/^distro\=(\S+) //) {
                    die "$1 != $distro" unless $1 eq $distro;
-               } elsif (s/^(--deliberately-$package_re) //) {
+               } elsif (s/^(--deliberately-$deliberately_re) //) {
                    push @deliberatelies, $1;
                } elsif (s/^supersede:(\S+)=(\w+) //) {
                    die "supersede $1 twice" if defined $supersedes{$1};