diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2016-10-08 17:43:51 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2016-10-08 19:26:31 +0100 |
commit | 9d91e25a38b64bce53bc315b2f69f1f99e4c1ef3 (patch) | |
tree | a28907225950aa56d8dd2339987dadebce8e2d41 | |
parent | cc9deb8e711981e5b7e980fca84f9b7ca07d4b39 (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>
-rw-r--r-- | debian/changelog | 2 | ||||
-rwxr-xr-x | dgit | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog index 9082aad..a55ee20 100644 --- a/debian/changelog +++ b/debian/changelog @@ -56,6 +56,8 @@ dgit (1.5~~) unstable; urgency=medium * Fix two calls to chdir without proper error checking. * Fix a couple of bugs in error reporting. * Fix up .orig detection to be less trustful of (ambiguous) filenames. + * Fix up .orig detection to correctly allow exactly the right + .orig-comp components accorging to dpkg-source(1). Test suite: * When sbuild fails, do not crash due to sed not finding the log @@ -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; } |