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

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
Родитель
Сommit
0238c795df
1 измененных файлов с 4 добавлено и 2 удалено
  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"),