ソースを参照

dpkg: Do not preserve and check for conffiles on leftover dir removal

The function removal_bulk_remove_leftover_dirs() was supposed to be
called only w/ left over dirs, but removal_bulk_remove_configfiles()
does not remove them from the file list when unlinking.

Do not check if the directory needs to be preserved if the package has
conffiles inside, because it should have none, although it would match
given that the file list still contains conffiles.

Do not preserve any lingering conffiles in the file list as they are
no longer on disk anyway.
Guillem Jover 15 年 前
コミット
ad07629757
共有1 個のファイルを変更した4 個の追加5 個の削除を含む
  1. 4 5
      src/remove.c

+ 4 - 5
src/remove.c

@@ -316,7 +316,10 @@ static void removal_bulk_remove_leftover_dirs(struct pkginfo *pkg) {
     debug(dbg_eachfile, "removal_bulk `%s' flags=%o",
           namenode->name, namenode->flags);
     if (namenode->flags & fnnf_old_conff) {
-      push_leftover(&leftover,namenode);
+      /* This can only happen if removal_bulk_remove_configfiles() got
+       * interrupted half way. */
+      debug(dbg_eachfiledetail, "removal_bulk expecting only left over dirs, "
+                                "ignoring conffile '%s'", namenode->name);
       continue;
     }
 
@@ -333,10 +336,6 @@ static void removal_bulk_remove_leftover_dirs(struct pkginfo *pkg) {
       /* Only delete a directory or a link to one if we're the only
        * package which uses it. Other files should only be listed
        * in this package (but we don't check). */
-      if (dir_has_conffiles(namenode, pkg)) {
-	push_leftover(&leftover,namenode);
-	continue;
-      }
       if (dir_is_used_by_others(namenode, pkg))
         continue;
     }