* 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
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';
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;
}