summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2018-11-05 23:57:52 +0100
committerGuillem Jover <guillem@debian.org>2019-01-15 03:42:39 +0100
commita71649166e7dabbce315c8e49501ba68676831ef (patch)
treeed4c84b968fdcc6b9273414c8b91a82402412af4 /scripts
parenta7fb57546f0a7e88a1acd7bdf1c081b43972b01d (diff)
downloaddpkg-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
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Dpkg/Source/Patch.pm9
1 files changed, 5 insertions, 4 deletions
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);