From 9d91e25a38b64bce53bc315b2f69f1f99e4c1ef3 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 8 Oct 2016 17:43:51 +0100 Subject: 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 --- debian/changelog | 2 ++ 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 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; } -- cgit v1.2.3