Sfoglia il codice sorgente

dpkg: Remove filtered existing directories on upgrade

Move the return point in tarobject() for the existing directories
check after the path filter one. This makes sure the latter takes
precedence over the former, and existing directories get properly
filtered and removed on upgrades.

Reported-by: Martin Pitt <martin.pitt@ubuntu.com>
Signed-off-by: Guillem Jover <guillem@debian.org>
Guillem Jover 16 anni fa
parent
commit
ff008d6776
1 ha cambiato i file con 4 aggiunte e 2 eliminazioni
  1. 4 2
      src/archives.c

+ 4 - 2
src/archives.c

@@ -616,8 +616,7 @@ int tarobject(struct TarInfo *ti) {
       }
     }
   }
-       
-  if (existingdirectory) return 0;
+
   if (keepexisting) {
     remove_file_from_list(ti, oldnifd, nifd);
     tarfile_skip_one_forward(ti);
@@ -632,6 +631,9 @@ int tarobject(struct TarInfo *ti) {
     return 0;
   }
 
+  if (existingdirectory)
+    return 0;
+
   /* Now, at this stage we want to make sure neither of .dpkg-new and .dpkg-tmp
    * are hanging around.
    */