ソースを参照

libdpkg: Keep Architecture in status entry for non-installed packages

Packages which failed to install or which were removed might still
appear in the status file because we retain the user selection (stored
in pkginfo.pkgwant), and we need to keep the architecture field because
that selection is really arch specific. If we drop the architecture
field, dpkg might confuse this entry with the entry for the native
architecture.

Based-on-patch-by: Raphaël Hertzog <hertzog@debian.org>
Patch-sponsored-by: Linaro Limited

Signed-off-by: Guillem Jover <guillem@debian.org>
Guillem Jover 14 年 前
コミット
975ac670a1
共有1 個のファイルを変更した6 個の追加1 個の削除を含む
  1. 6 1
      lib/dpkg/pkg.c

+ 6 - 1
lib/dpkg/pkg.c

@@ -40,7 +40,6 @@ pkgbin_blank(struct pkgbin *pkgbin)
 	pkgbin->installedsize = NULL;
 	pkgbin->installedsize = NULL;
 	pkgbin->bugs = NULL;
 	pkgbin->bugs = NULL;
 	pkgbin->origin = NULL;
 	pkgbin->origin = NULL;
-	pkgbin->arch = dpkg_arch_get(arch_none);
 	blankversion(&pkgbin->version);
 	blankversion(&pkgbin->version);
 	pkgbin->conffiles = NULL;
 	pkgbin->conffiles = NULL;
 	pkgbin->arbs = NULL;
 	pkgbin->arbs = NULL;
@@ -66,6 +65,12 @@ pkg_blank(struct pkginfo *pkg)
 	pkg->trigpend_head = NULL;
 	pkg->trigpend_head = NULL;
 	pkgbin_blank(&pkg->installed);
 	pkgbin_blank(&pkg->installed);
 	pkgbin_blank(&pkg->available);
 	pkgbin_blank(&pkg->available);
+
+	/* The architectures are reset here (instead of in pkgbin_blank),
+	 * because they are part of the package specification, and needed
+	 * for selections. */
+	pkg->installed.arch = dpkg_arch_get(arch_none);
+	pkg->available.arch = dpkg_arch_get(arch_none);
 }
 }
 
 
 void
 void