Procházet zdrojové kódy

dpkg-deb: Stop warning on unknown arbitrary fields

The rest of the tools, particularly the ones in dpkg-dev, do not emit
such warnings, so doing it when building the binary packages is a bit
pointless, and usually annoys maintainers or downstream developers who
end up disabling this code anyway.

This might have served a purpose some time ago, to easily spot typos
in field names, but we do have other means to check for those now,
like more strict parsing in dpkg, which will warn or error on required
fields, or tools like lintian which do a thorough check on the produced
packages.
Guillem Jover před 12 roky
rodič
revize
2e5f5b658c
3 změnil soubory, kde provedl 2 přidání a 40 odebrání
  1. 1 0
      debian/changelog
  2. 0 38
      dpkg-deb/build.c
  3. 1 2
      man/deb-src-control.5

+ 1 - 0
debian/changelog

@@ -21,6 +21,7 @@ dpkg (1.17.14) UNRELEASED; urgency=low
     either empty or '-'.
     either empty or '-'.
   * Fix order of Files field on generated .changes file in dpkg-genchanges.
   * Fix order of Files field on generated .changes file in dpkg-genchanges.
     Regression introduced in dpkg 1.17.7.
     Regression introduced in dpkg 1.17.7.
+  * Stop warning on unknown arbitrary fields from dpkg-deb.
 
 
   [ Raphaël Hertzog ]
   [ Raphaël Hertzog ]
   * Explain better in deb-triggers(5) why interest/activate-noawait should be
   * Explain better in deb-triggers(5) why interest/activate-noawait should be

+ 0 - 38
dpkg-deb/build.c

@@ -332,36 +332,6 @@ check_conffiles(const char *dir)
   fclose(cf);
   fclose(cf);
 }
 }
 
 
-static const char *arbitrary_fields[] = {
-  "Built-For-Profiles",
-  "Built-Using",
-  "Package-Type",
-  "Subarchitecture",
-  "Kernel-Version",
-  "Installer-Menu-Item",
-  "Homepage",
-  "Tag",
-  NULL
-};
-
-static const char private_prefix[] = "Private-";
-
-static bool
-known_arbitrary_field(const struct arbitraryfield *field)
-{
-  const char **known;
-
-  /* Always accept fields starting with a private field prefix. */
-  if (strncasecmp(field->name, private_prefix, strlen(private_prefix)) == 0)
-    return true;
-
-  for (known = arbitrary_fields; *known; known++)
-    if (strcasecmp(field->name, *known) == 0)
-      return true;
-
-  return false;
-}
-
 /**
 /**
  * Perform some sanity checks on the to-be-built package.
  * Perform some sanity checks on the to-be-built package.
  *
  *
@@ -371,7 +341,6 @@ static struct pkginfo *
 check_new_pkg(const char *dir)
 check_new_pkg(const char *dir)
 {
 {
   struct pkginfo *pkg;
   struct pkginfo *pkg;
-  struct arbitraryfield *field;
   char *controlfile;
   char *controlfile;
   int warns;
   int warns;
 
 
@@ -385,13 +354,6 @@ check_new_pkg(const char *dir)
   if (pkg->priority == PKG_PRIO_OTHER)
   if (pkg->priority == PKG_PRIO_OTHER)
     warning(_("'%s' contains user-defined Priority value '%s'"),
     warning(_("'%s' contains user-defined Priority value '%s'"),
             controlfile, pkg->otherpriority);
             controlfile, pkg->otherpriority);
-  for (field = pkg->available.arbs; field; field = field->next) {
-    if (known_arbitrary_field(field))
-      continue;
-
-    warning(_("'%s' contains user-defined field '%s'"), controlfile,
-            field->name);
-  }
 
 
   free(controlfile);
   free(controlfile);
 
 

+ 1 - 2
man/deb-src-control.5

@@ -326,8 +326,7 @@ source package control files.
 Take into account that these user-defined fields will be using the global
 Take into account that these user-defined fields will be using the global
 namespace, which might at some point in the future collide with officially
 namespace, which might at some point in the future collide with officially
 recognized fields. To avoid such potential situation you can prefix those
 recognized fields. To avoid such potential situation you can prefix those
-fields with \fBPrivate\-\fP, such as \fBXB\-Private\-New\-Field\fP, which as
-a side effect will make \fBdpkg\-deb\fP not warn on them as unknown fields.
+fields with \fBPrivate\-\fP, such as \fBXB\-Private\-New\-Field\fP.
 
 
 .SH EXAMPLE
 .SH EXAMPLE
 .\" .RS
 .\" .RS