Przeglądaj źródła

libdpkg: Use arch_empty type to track missing architectures too

The case when the Architecture field is not present is equivalent to
the case of a present Architecture with an empty value, except for
warning purposes. Track missing architectures on the in-core db w/o
overloading arch_none to mean the same, so that we can distinguish
truly unused pkginfo slots.
Guillem Jover 14 lat temu
rodzic
commit
0238c795df
1 zmienionych plików z 4 dodań i 2 usunięć
  1. 4 2
      lib/dpkg/parse.c

+ 4 - 2
lib/dpkg/parse.c

@@ -201,8 +201,10 @@ pkg_parse_verify(struct parsedb_state *ps,
     else if (pkgbin->arch->type == arch_empty)
       parse_warn(ps, _("empty value for %s"), "architecture");
   }
-  if (pkgbin->arch->type == arch_empty)
-    pkgbin->arch = dpkg_arch_get(arch_none);
+  /* Mark missing architectures as empty, to distinguish these from
+   * unused slots in the db. */
+  if (pkgbin->arch->type == arch_none)
+    pkgbin->arch = dpkg_arch_get(arch_empty);
 
   if (pkgbin->arch->type == arch_all && pkgbin->multiarch == multiarch_same)
     parse_error(ps, _("package has field '%s' but is architecture all"),