From 1f7b9876c5641666901f40888eb8a975449569c1 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 20 Dec 2016 21:14:48 +0000 Subject: quilt fixup: Permit creation of patches which delete files By psssing --include-removal to dpkg-source, and tolerating it when we do our quilt fixup analysis. dpkg-source has supported this since at least stretch. Closes:#848901. Signed-off-by: Ian Jackson --- dgit | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'dgit') diff --git a/dgit b/dgit index 1502ddf..9a8d221 100755 --- a/dgit +++ b/dgit @@ -4460,7 +4460,7 @@ END local $ENV{'EDITOR'} = cmdoutput qw(realpath --), $0; local $ENV{'VISUAL'} = $ENV{'EDITOR'}; local $ENV{$fakeeditorenv} = cmdoutput qw(realpath --), $descfn; - runcmd @dpkgsource, qw(--commit .), $patchname; + runcmd @dpkgsource, qw(--commit --include-removal .), $patchname; } } @@ -4495,12 +4495,16 @@ sub quiltify_trees_differ ($$;$$$) { if ($unrepres) { eval { - die "deleted\n" unless $newmode =~ m/[^0]/; - die "not a plain file\n" unless $newmode =~ m/^10\d{4}$/; - if ($oldmode =~ m/[^0]/) { + die "not a plain file\n" + unless $newmode =~ m/^10\d{4}$/ || + $oldmode =~ m/^10\d{4}$/; + if ($oldmode =~ m/[^0]/ && + $newmode =~ m/[^0]/) { die "mode changed\n" if $oldmode ne $newmode; } else { - die "non-default mode\n" unless $newmode =~ m/^100644$/; + die "non-default mode\n" + unless $newmode =~ m/^100644$/ || + $oldmode =~ m/^100644$/; } }; if ($@) { -- cgit v1.2.3