瀏覽代碼

scripts: Revert some unsafe //= usages back to ||=

This reverts some of the unsafe assignments, as the variable might have
contained a value evaluating to false, and we are assigning non-false
values.

This specifically fixes dpkg-source --commit and -b not working any
longer.

Regression introduced in commit b0337f001bee1f3791cb87505b1330c9bf83e2be.

Closes: #758426

Reported-by: Neil Williams <codehelp@debian.org>
Guillem Jover 12 年之前
父節點
當前提交
294cd0e0ec
共有 4 個文件被更改,包括 7 次插入4 次删除
  1. 3 0
      debian/changelog
  2. 1 1
      scripts/Dpkg/Shlibs/Objdump.pm
  3. 1 1
      scripts/Dpkg/Source/Package.pm
  4. 2 2
      scripts/Dpkg/Source/Patch.pm

+ 3 - 0
debian/changelog

@@ -14,6 +14,9 @@ dpkg (1.17.13) UNRELEASED; urgency=low
     targets. Thanks to Helmut Grohne <helmut@subdivi.de>.
   * Fix dpkg-maintscript-helper symlink_to_dir to assure absolute pathnames
     arguments.
+  * Fix dpkg-source not detecting modified files during --commit or -b.
+    Regression introduced in dpkg 1.17.11. Closes: #758426
+    Reported by Neil Williams <codehelp@debian.org>.
 
   [ Updated programs translations ]
   * Czech (Miroslav Kure).

+ 1 - 1
scripts/Dpkg/Shlibs/Objdump.pm

@@ -173,7 +173,7 @@ sub reset {
 sub analyze {
     my ($self, $file) = @_;
 
-    $file //= $self->{file};
+    $file ||= $self->{file};
     return unless $file;
 
     $self->reset;

+ 1 - 1
scripts/Dpkg/Source/Package.pm

@@ -212,7 +212,7 @@ sub init_options {
     my ($self) = @_;
     # Use full ignore list by default
     # note: this function is not called by V1 packages
-    $self->{options}{diff_ignore_regex} //= $diff_ignore_default_regex;
+    $self->{options}{diff_ignore_regex} ||= $diff_ignore_default_regex;
     $self->{options}{diff_ignore_regex} .= '|(?:^|/)debian/source/local-.*$';
     if (defined $self->{options}{tar_ignore}) {
         $self->{options}{tar_ignore} = [ @tar_ignore_default_pattern ]

+ 2 - 2
scripts/Dpkg/Source/Patch.pm

@@ -551,7 +551,7 @@ sub apply {
     $opts{force_timestamp} //= 1;
     $opts{remove_backup} //= 1;
     $opts{create_dirs} //= 1;
-    $opts{options} //= [ '-t', '-F', '0', '-N', '-p1', '-u',
+    $opts{options} ||= [ '-t', '-F', '0', '-N', '-p1', '-u',
             '-V', 'never', '-g0', '-b', '-z', '.dpkg-orig'];
     $opts{add_options} //= [];
     push @{$opts{options}}, @{$opts{add_options}};
@@ -602,7 +602,7 @@ sub check_apply {
     my ($self, $destdir, %opts) = @_;
     # Set default values to options
     $opts{create_dirs} //= 1;
-    $opts{options} //= [ '--dry-run', '-s', '-t', '-F', '0', '-N', '-p1', '-u',
+    $opts{options} ||= [ '--dry-run', '-s', '-t', '-F', '0', '-N', '-p1', '-u',
             '-V', 'never', '-g0', '-b', '-z', '.dpkg-orig'];
     $opts{add_options} //= [];
     push @{$opts{options}}, @{$opts{add_options}};