| author | Raphaël Hertzog <hertzog@debian.org> | |
| Wed, 1 Aug 2012 19:18:07 +0000 (21:18 +0200) | ||
| committer | Raphaël Hertzog <hertzog@debian.org> | |
| Fri, 3 Aug 2012 08:16:40 +0000 (10:16 +0200) |
When we restore files in the pop operation, the target directory is
usually pre-existing, but in the case where the patch is removing all the
files in the directory, the usage of patch's --remove-empty-files lead to
the removal of the parent directories which are empty.
This caused a regression in dpkg-source's handling of "3.0 (quilt)" source
package since we switched "3.0 (quilt)" to restore the quilt backup files
to unapply patches. Formerly we were using "patch -R" which was creating
the required directories by itself.
Reported-by: Thomas Koch <thomas@koch.ro>
Closes: #683547
usually pre-existing, but in the case where the patch is removing all the
files in the directory, the usage of patch's --remove-empty-files lead to
the removal of the parent directories which are empty.
This caused a regression in dpkg-source's handling of "3.0 (quilt)" source
package since we switched "3.0 (quilt)" to restore the quilt backup files
to unapply patches. Formerly we were using "patch -R" which was creating
the required directories by itself.
Reported-by: Thomas Koch <thomas@koch.ro>
Closes: #683547
| debian/changelog | patch | blob | history | |
| scripts/Dpkg/Source/Quilt.pm | patch | blob | history |
diff --git a/debian/changelog b/debian/changelog
--- a/debian/changelog
+++ b/debian/changelog
dpkg (1.16.9) UNRELEASED; urgency=low
+ [ Raphaël Hertzog ]
+ * Fix dpkg-source regression in "3.0 (quilt)" source packages while
+ unapplying patches that remove all files in a directory. Closes: #683547
+
[ Updated programs translations ]
* Czech (Miroslav Kure).
* Portuguese (Miguel Figueiredo). Closes: #682582
use File::Spec;
use File::Copy;
use File::Find;
+use File::Path qw(make_path);
+use File::Basename;
sub new {
my ($this, $dir, %opts) = @_;
my $target = File::Spec->catfile($self->{'dir'}, $relpath_in_srcpkg);
if (-s $_) {
unlink($target);
+ make_path(dirname($target));
unless (link($_, $target)) {
copy($_, $target) ||
syserr(_g("failed to copy %s to %s"), $_, $target);
