Просмотр исходного кода

Dpkg::Source::Package::V2: Do not warn when removing an empty subdirectory

When extracting a source package, do not warn if the pathname to remove
is an empty directory, just silently remove it, as it might be part of
a git repository, as a submodule for example.

Closes: #796671
Guillem Jover лет назад: 11
Родитель
Сommit
98b4330b2c
2 измененных файлов с 6 добавлено и 0 удалено
  1. 2 0
      debian/changelog
  2. 4 0
      scripts/Dpkg/Source/Package/V2.pm

+ 2 - 0
debian/changelog

@@ -16,6 +16,8 @@ dpkg (1.18.3) UNRELEASED; urgency=low
     - Only warn on invalid week days instead of aborting in
       Dpkg::Changelog::Entry::Debian. Regression introduced in dpkg 1.18.2.
       Reported by Jakub Wilk <jwilk@debian.org>.
+    - Do not warn when removing an empty subdirectory on source package
+      extraction in Dpkg::Source::Package::V2. Closes: #796671
   * Test suite:
     - Get the reference build flags from dpkg-buildflags.pl, instead of
       hardcoding them, which might not match depending on the architecture.

+ 4 - 0
scripts/Dpkg/Source/Package/V2.pm

@@ -172,6 +172,10 @@ sub do_extract {
     foreach my $subdir (sort keys %addonfile) {
         my $file = $addonfile{$subdir};
         info(g_('unpacking %s'), $file);
+
+        # If the pathname is an empty directory, just silently remove it, as
+        # it might be part of a git repository, as a submodule for example.
+        rmdir "$newdirectory/$subdir";
         if (-e "$newdirectory/$subdir") {
             warning(g_("required removal of '%s' installed by original tarball"),
                     $subdir);