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

dpkg: Do not try to disappear other packages from the same set

Packages within a set can rightfully share files and should not
be disappeared in the case where they share all the files.

Closes: #652063

Reported-by: Martin Pitt <mpitt@debian.org>
Signed-off-by: Guillem Jover <guillem@debian.org>
Raphaël Hertzog лет назад: 14
Родитель
Сommit
960ce492e9
2 измененных файлов с 13 добавлено и 0 удалено
  1. 7 0
      src/archives.c
  2. 6 0
      src/processarc.c

+ 7 - 0
src/archives.c

@@ -152,6 +152,13 @@ filesavespackage(struct fileinlist *file,
     if (thirdpkg == pkgbeinginstalled || thirdpkg == pkgtobesaved)
       continue;
 
+    /* A Multi-Arch: same package can share files and their presence in a
+     * third package of the same set is not a sign that we can get rid of
+     * it. */
+    if (pkgtobesaved->installed.multiarch == multiarch_same &&
+        thirdpkg->set == pkgtobesaved->set)
+      continue;
+
     /* If !fileslistvalid then we've already disappeared this one, so
      * we shouldn't try to make it take over this shared directory. */
     debug(dbg_eachfiledetail,"filesavespackage ...  is 3rd package");

+ 6 - 0
src/processarc.c

@@ -1239,6 +1239,12 @@ void process_archive(const char *filename) {
         otherpkg->status == stat_configfiles ||
 	otherpkg->clientdata->istobe == itb_remove ||
         !otherpkg->clientdata->files) continue;
+    /* Do not try to disappear other packages from the same set
+     * if they are Multi-Arch: same */
+    if (pkg->installed.multiarch == multiarch_same &&
+        otherpkg->installed.multiarch == multiarch_same &&
+        otherpkg->set == pkg->set)
+      continue;
     debug(dbg_veryverbose, "process_archive checking disappearance %s",
           pkg_name(otherpkg, pnaw_always));
     assert(otherpkg->clientdata->istobe == itb_normal ||