Ver código fonte

dpkg-deb: don't warn on unknown fields starting with "X-"

The fields named "X-" are never going to collide with official
fields and there's no need to warn that they are unknown.
Users are already explicitely creating them with XB-X-* fields
in debian/control.
Nils Rennebarth 17 anos atrás
pai
commit
66835c07b3
2 arquivos alterados com 6 adições e 0 exclusões
  1. 3 0
      debian/changelog
  2. 3 0
      dpkg-deb/build.c

+ 3 - 0
debian/changelog

@@ -45,6 +45,9 @@ dpkg (1.15.1) UNRELEASED; urgency=low
     Thanks to Bill Allombert for the patch.
   * dpkg now correctly refuses empty parameters when an integer value is
     wanted. Closes: #386197 Based on a patch by Bill Allombert.
+  * dpkg-deb doesn't warn anymore when it encounters unknown DEBIAN/control
+    fields starting with "X-". Closes: #353040
+    Thanks to Nils Rennebarth for the patch.
 
   [ Guillem Jover ]
   * Fix typo in dpkg output (‘unexecpted’ → ‘unexpected’). Closes: #519082

+ 3 - 0
dpkg-deb/build.c

@@ -73,6 +73,9 @@ static const char *arbitrary_fields[] = {
 static int known_arbitrary_field(const struct arbitraryfield *field) {
   const char **known;
 
+  /* always accept fields starting with x- */
+  if (strncasecmp(field->name, "x-", 2) == 0)
+    return 1;
   for (known= arbitrary_fields; *known; known++)
     if (strcasecmp(field->name, *known) == 0)
       return 1;