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

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
Родитель
Сommit
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->bugs = NULL;
 	pkgbin->origin = NULL;
-	pkgbin->arch = dpkg_arch_get(arch_none);
 	blankversion(&pkgbin->version);
 	pkgbin->conffiles = NULL;
 	pkgbin->arbs = NULL;
@@ -66,6 +65,12 @@ pkg_blank(struct pkginfo *pkg)
 	pkg->trigpend_head = NULL;
 	pkgbin_blank(&pkg->installed);
 	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