浏览代码

dpkg: Always reset want status when installing a package

Move pkg_set_want() call from wanttoinstall() to the call site in
process_archive(), so that the status-want change affects all ‘true’
return values and not just on “selecting previously unselected package”.

This also makes wanttoinstall() a function that just performs a decision
without acting on it, matching its name.

Closes: #162541
Guillem Jover 14 年之前
父节点
当前提交
fb8997a460
共有 3 个文件被更改,包括 5 次插入2 次删除
  1. 2 0
      debian/changelog
  2. 0 1
      src/archives.c
  3. 3 1
      src/processarc.c

+ 2 - 0
debian/changelog

@@ -62,6 +62,8 @@ dpkg (1.17.0) UNRELEASED; urgency=low
   * Do not unnecessarily create a dpkg update log record on remove or purge.
   * Always reset want status when removing or purging a package; so this
     now resets holds among others. Closes: #163763
+  * Always reset want status when installing a package; so this now resets
+    holds among others. Closes: #162541
 
  -- Guillem Jover <guillem@debian.org>  Fri, 03 Aug 2012 13:21:00 +0200
 

+ 0 - 1
src/archives.c

@@ -1696,7 +1696,6 @@ wanttoinstall(struct pkginfo *pkg)
     if (f_alsoselect) {
       printf(_("Selecting previously unselected package %s.\n"),
              pkgbin_name(pkg, &pkg->available, pnaw_nonambig));
-      pkg_set_want(pkg, want_install);
       return true;
     } else {
       printf(_("Skipping unselected package %s.\n"),

+ 3 - 1
src/processarc.c

@@ -521,7 +521,9 @@ void process_archive(const char *filename) {
   clear_deconfigure_queue();
   clear_istobes();
 
-  if (!wanttoinstall(pkg)) {
+  if (wanttoinstall(pkg)) {
+    pkg_set_want(pkg, want_install);
+  } else {
       pop_cleanup(ehflag_normaltidy);
       return;
   }