diff options
author | Guillem Jover <guillem@debian.org> | 2018-11-05 23:57:52 +0100 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2019-01-15 03:42:39 +0100 |
commit | a71649166e7dabbce315c8e49501ba68676831ef (patch) | |
tree | ed4c84b968fdcc6b9273414c8b91a82402412af4 | |
parent | a7fb57546f0a7e88a1acd7bdf1c081b43972b01d (diff) | |
download | dpkg-a71649166e7dabbce315c8e49501ba68676831ef.tar.gz |
Dpkg::Source::Patch: Do not recommend --include-removal when not supported
If the option has not been set, then the source format does not support
it and we should thus not recommend the --include-removal option in the
warning.
Closes: #913012
-rw-r--r-- | debian/changelog | 2 | ||||
-rw-r--r-- | scripts/Dpkg/Source/Patch.pm | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/debian/changelog b/debian/changelog index d43a06258..88e6f9b48 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,8 @@ dpkg (1.19.3) UNRELEASED; urgency=medium - Dpkg::Shlibs::Objdump: Remove unused Dpkg::IPC import. - Dpkg::Shlibs::Objdump: Only select objdump program when going to use it. - Dpkg::Source::Package: Do not reinitialize fields member in constructor. + - Dpkg::Source::Patch: Do not recommend --include-removal when not + supported. Closes: #913012 * Documentation: - dpkg(1): Clarify --remove action. Closes: #914478 - dpkg-query(1): Clarify --list option behavior when no arguments are diff --git a/scripts/Dpkg/Source/Patch.pm b/scripts/Dpkg/Source/Patch.pm index e5ad5424b..25d56335d 100644 --- a/scripts/Dpkg/Source/Patch.pm +++ b/scripts/Dpkg/Source/Patch.pm @@ -148,7 +148,6 @@ sub add_diff_directory { # TODO: make this function more configurable # - offer to disable some checks my $basedir = $opts{basedirname} || basename($new); - my $inc_removal = $opts{include_removal} // 0; my $diff_ignore; if ($opts{diff_ignore_func}) { $diff_ignore = $opts{diff_ignore_func}; @@ -226,11 +225,13 @@ sub add_diff_directory { return if $files_in_new{$fn}; lstat("$old/$fn") or syserr(g_('cannot stat file %s'), "$old/$fn"); if (-f _) { - if ($inc_removal) { + if (not defined $opts{include_removal}) { + warning(g_('ignoring deletion of file %s'), $fn); + } elsif (not $opts{include_removal}) { + warning(g_('ignoring deletion of file %s, use --include-removal to override'), $fn); + } else { push @diff_files, [$fn, 0, 0, "$old/$fn", '/dev/null', "$basedir.orig/$fn", '/dev/null']; - } else { - warning(g_('ignoring deletion of file %s, use --include-removal to override'), $fn); } } elsif (-d _) { warning(g_('ignoring deletion of directory %s'), $fn); |