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

libdpkg: Do not print bogus warnings when parsing status files

This is the equivalent fix in spirit as the one in commit
672b0664cbb8fd7fd5eea7ab10af1bbf6871833f, but applied to the
Architecture field instead.

Reported-by: Raphaël Hertzog <hertzog@debian.org>
Guillem Jover лет назад: 15
Родитель
Сommit
f3496dc24f
2 измененных файлов с 7 добавлено и 5 удалено
  1. 2 1
      debian/changelog
  2. 5 4
      lib/dpkg/parse.c

+ 2 - 1
debian/changelog

@@ -26,7 +26,8 @@ dpkg (1.16.0) UNRELEASED; urgency=low
     happen either on distributions where dpkg is a foreign package manager,
     or on artificial dpkg databases.
   * Always warn when parsing any package control data which does not have
-    an Architecture field.
+    an Architecture field except for status and status log files when
+    packages are not-installed or half-installed.
 
   [ Raphaël Hertzog ]
   * Fail properly when debian/source/format is empty. Closes: #600854

+ 5 - 4
lib/dpkg/parse.c

@@ -167,11 +167,12 @@ pkg_parse_verify(struct parsedb_state *ps,
     parse_ensure_have_field(ps, pkg, &pkgbin->description, "description");
     parse_ensure_have_field(ps, pkg, &pkgbin->maintainer, "maintainer");
     parse_must_have_field(ps, pkg, pkgbin->version.version, "version");
-  }
 
-  /* We always want usable architecture information, so that it can be used
-   * safely on string comparisons and the like. */
-  parse_ensure_have_field(ps, pkg, &pkgbin->arch, "architecture");
+    /* We always want usable architecture information (as long as the package
+     * is in such a state that it make sense), so that it can be used safely
+     * on string comparisons and the like. */
+    parse_ensure_have_field(ps, pkg, &pkgbin->arch, "architecture");
+  }
 
   /* Check the Config-Version information:
    * If there is a Config-Version it is definitely to be used, but