summaryrefslogtreecommitdiff
path: root/dgit
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2016-10-08 17:43:51 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2016-10-08 19:26:31 +0100
commit9d91e25a38b64bce53bc315b2f69f1f99e4c1ef3 (patch)
treea28907225950aa56d8dd2339987dadebce8e2d41 /dgit
parentcc9deb8e711981e5b7e980fca84f9b7ca07d4b39 (diff)
Import: orig files: Fix .orig-comp pattern match
Fix up .orig detection to correctly allow exactly the right .orig-comp components accorging to dpkg-source(1). Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'dgit')
-rwxr-xr-xdgit6
1 files changed, 4 insertions, 2 deletions
diff --git a/dgit b/dgit
index b4b6d9c..e11d2fb 100755
--- a/dgit
+++ b/dgit
@@ -77,6 +77,8 @@ our %format_ok = map { $_=>1 } ("1.0","3.0 (native)","3.0 (quilt)");
our $suite_re = '[-+.0-9a-z]+';
our $cleanmode_re = 'dpkg-source(?:-d)?|git|git-ff|check|none';
+our $orig_f_comp_re = 'orig(?:-[-0-9a-z]+)?';
+our $orig_f_tail_re = "$orig_f_comp_re\\.tar(?:\\.\\w+)?";
our $git_authline_re = '^([^<>]+) \<(\S+)\> (\d+ [-+]\d+)$';
our $splitbraincache = 'dgit-intern/quilt-cache';
@@ -1434,14 +1436,14 @@ sub is_orig_file_in_dsc ($$) {
return 0 if @$dsc_files_info <= 1;
# One file means no origs, and the filename doesn't have a "what
# part of dsc" component. (Consider versions ending `.orig'.)
- return 0 unless $f =~ m/\.orig(?:-\w+)?\.tar(?:\.\w+)?$/;
+ return 0 unless $f =~ m/\.$orig_f_tail_re$/o;
return 1;
}
sub is_orig_file_of_vsn ($$) {
my ($f, $upstreamvsn) = @_;
my $base = srcfn $upstreamvsn, '';
- return 0 unless $f =~ m/^\Q$base\E\.orig(?:-\w+)?\.tar(?:\.\w+)?$/;
+ return 0 unless $f =~ m/^\Q$base\E\.$orig_f_tail_re$/;
return 1;
}