Sfoglia il codice sorgente

dpkg-deb: Handle properly missing and empty architecture fields

The parser always converts the value from DPKG_ARCH_NONE to
DPKG_ARCH_EMPTY, so we will handle both here to avoid any such problem
in the future.

Regression introduced in commit 0238c795df88925c6579f740c7681ade22e88625.
Guillem Jover 11 anni fa
parent
commit
b008da395d
2 ha cambiato i file con 8 aggiunte e 1 eliminazioni
  1. 2 0
      debian/changelog
  2. 6 1
      dpkg-deb/build.c

+ 2 - 0
debian/changelog

@@ -68,6 +68,8 @@ dpkg (1.18.0) UNRELEASED; urgency=low
     Reported by Christoph Biedl <debian.axhn@manchmal.in-ulm.de>.
   * Do not silently eat a standalone ‘-’ in the libdpkg command-line parser.
   * Fix short-lived memory leaks in dpkg-deb and libdpkg. Closes: #769515
+  * Fix «dpkg-deb -b» filename generation when the package does not contain
+    an Architecture field. Regression introduced in dpkg 1.16.2.
 
   [ Updated manpages translations ]
   * German (Helge Kreutzmann).

+ 6 - 1
dpkg-deb/build.c

@@ -432,7 +432,12 @@ gen_dest_pathname_from_pkg(const char *dir, struct pkginfo *pkg)
   const char *versionstring, *arch_sep;
 
   versionstring = versiondescribe(&pkg->available.version, vdew_never);
-  arch_sep = pkg->available.arch->type == DPKG_ARCH_NONE ? "" : "_";
+  if (pkg->available.arch->type == DPKG_ARCH_NONE ||
+      pkg->available.arch->type == DPKG_ARCH_EMPTY)
+    arch_sep = "";
+  else
+    arch_sep = "_";
+
   m_asprintf(&path, "%s/%s_%s%s%s%s", dir, pkg->set->name, versionstring,
              arch_sep, pkg->available.arch->name, DEBEXT);