浏览代码

libdpkg: Mark not-installed non-arch-qualified selections for removal

These do not make sense in a multiarch enabled world, and might cause
those selections to be unreferencable from command-line interfaces when
there's other more specific selections.
Guillem Jover 14 年之前
父节点
当前提交
b66466c90a
共有 2 个文件被更改,包括 12 次插入0 次删除
  1. 1 0
      debian/changelog
  2. 11 0
      lib/dpkg/parse.c

+ 1 - 0
debian/changelog

@@ -71,6 +71,7 @@ dpkg (1.16.2) UNRELEASED; urgency=low
     packages (i.e. those present in either the status or available files).
   * Always ignore older versions when parsing the available file, not only
     for --update-avail and --merge-avail.
+  * Mark not-installed non-arch-qualified selections for removal.
 
   [ Raphaël Hertzog ]
   * Update Dpkg::Shlibs to look into multiarch paths when cross-building

+ 11 - 0
lib/dpkg/parse.c

@@ -280,6 +280,17 @@ pkg_parse_verify(struct parsedb_state *ps,
        pkg->want == want_hold)) {
     pkg_set_want(pkg, want_unknown);
   }
+
+  /* XXX: Mark not-installed non-arch-qualified selections for automatic
+   * removal, as they do not make sense in a multiarch enabled world, and
+   * might cause those selections to be unreferencable from command-line
+   * interfaces when there's other more specific selections. */
+  if (ps->type == pdb_file_status &&
+      pkg->status == stat_notinstalled &&
+      pkg->eflag == eflag_ok &&
+      pkg->want == want_install &&
+      pkgbin->arch->type == arch_empty)
+    pkg->want = want_unknown;
 }
 
 /**