The following commit has been merged in the master branch:
commit f74dfc666ea193a85de5e5f26b079506b289843f
Author: Guillem Jover <[email protected]>
Date:   Sun Oct 24 03:13:58 2010 +0200

    libdpkg: Rename illegal_packagename to pkg_name_is_illegal

diff --git a/lib/dpkg/dpkg-db.h b/lib/dpkg/dpkg-db.h
index 9cc5533..decd5e5 100644
--- a/lib/dpkg/dpkg-db.h
+++ b/lib/dpkg/dpkg-db.h
@@ -241,7 +241,7 @@ enum parsedbflags {
   pdb_lax_parser        =040,
 };
 
-const char *illegal_packagename(const char *p, const char **ep);
+const char *pkg_name_is_illegal(const char *p, const char **ep);
 int parsedb(const char *filename, enum parsedbflags, struct pkginfo **donep,
             FILE *warnto, int *warncount);
 void copy_dependency_links(struct pkginfo *pkg,
diff --git a/lib/dpkg/fields.c b/lib/dpkg/fields.c
index 5a61cca..c6bf15d 100644
--- a/lib/dpkg/fields.c
+++ b/lib/dpkg/fields.c
@@ -71,7 +71,9 @@ f_name(struct pkginfo *pigp, struct pkginfoperfile *pifp,
        const char *value, const struct fieldinfo *fip)
 {
   const char *e;
-  if ((e= illegal_packagename(value,NULL)) != NULL)
+
+  e = pkg_name_is_illegal(value, NULL);
+  if (e != NULL)
     parse_error(ps, pigp, _("invalid package name (%.250s)"), e);
   /* We use the new name, as pkg_db_find() may have done a tolower for us. */
   pigp->name = pkg_db_find(value)->name;
@@ -322,7 +324,7 @@ void f_dependency(struct pkginfo *pigp, struct 
pkginfoperfile *pifp,
         parse_error(ps, pigp,
                     _("`%s' field, missing package name, or garbage where "
                       "package name expected"), fip->name);
-      emsg = illegal_packagename(depname.buf, NULL);
+      emsg = pkg_name_is_illegal(depname.buf, NULL);
       if (emsg)
         parse_error(ps, pigp,
                     _("`%s' field, invalid package name `%.255s': %s"),
@@ -517,7 +519,7 @@ f_trigaw(struct pkginfo *aw, struct pkginfoperfile *pifp,
                   "this context"));
 
   while ((word = scan_word(&value))) {
-    emsg = illegal_packagename(word, NULL);
+    emsg = pkg_name_is_illegal(word, NULL);
     if (emsg)
       parse_error(ps, aw,
                   _("illegal package name in awaited trigger `%.255s': %s"),
diff --git a/lib/dpkg/libdpkg.Versions b/lib/dpkg/libdpkg.Versions
index 52503c4..5a5329e 100644
--- a/lib/dpkg/libdpkg.Versions
+++ b/lib/dpkg/libdpkg.Versions
@@ -165,7 +165,7 @@ LIBDPKG_PRIVATE {
        # Package struct handling
        blankpackage;
        blankpackageperfile;
-       illegal_packagename;
+       pkg_name_is_illegal;
        informative;
        copy_dependency_links;
        pkg_sorter_by_name;
diff --git a/lib/dpkg/parsehelp.c b/lib/dpkg/parsehelp.c
index b401ee4..ded2f5e 100644
--- a/lib/dpkg/parsehelp.c
+++ b/lib/dpkg/parsehelp.c
@@ -127,7 +127,9 @@ const struct namevalue wantinfos[] = {
   { .name = NULL }
 };
 
-const char *illegal_packagename(const char *p, const char **ep) {
+const char *
+pkg_name_is_illegal(const char *p, const char **ep)
+{
   static const char alsoallowed[]= "-+._"; /* _ is deprecated */
   static char buf[150];
   int c;
diff --git a/lib/dpkg/triglib.c b/lib/dpkg/triglib.c
index 50bd6b5..d45d146 100644
--- a/lib/dpkg/triglib.c
+++ b/lib/dpkg/triglib.c
@@ -272,7 +272,7 @@ trig_classify_byname(const char *name)
                return &tki_file;
        }
 
-       if (!illegal_packagename(name, NULL) && !strchr(name, '_'))
+       if (!pkg_name_is_illegal(name, NULL) && !strchr(name, '_'))
                return &tki_explicit;
 
 invalid:
@@ -386,7 +386,8 @@ trk_explicit_activate_awaiter(struct pkginfo *aw)
                        trk_explicit_fn.buf);
 
        while (trk_explicit_fgets(buf, sizeof(buf)) >= 0) {
-               if ((emsg = illegal_packagename(buf, NULL)))
+               emsg = pkg_name_is_illegal(buf, NULL);
+               if (emsg)
                        ohshit(_("trigger interest file `%.250s' syntax error; "
                                 "illegal package name `%.250s': %.250s"),
                               trk_explicit_fn.buf, buf, emsg);
@@ -580,7 +581,9 @@ trig_file_interests_ensure(void)
                        ohshit(_("syntax error in file triggers file `%.250s'"),
                               triggersfilefile);
                *space++ = '\0';
-               if ((emsg = illegal_packagename(space, NULL)))
+
+               emsg = pkg_name_is_illegal(space, NULL);
+               if (emsg)
                        ohshit(_("file triggers record mentions illegal "
                                 "package name `%.250s' (for interest in file "
                                 "`%.250s'): %.250s"), space, linebuf, emsg);
diff --git a/src/main.c b/src/main.c
index cf4029d..18581fb 100644
--- a/src/main.c
+++ b/src/main.c
@@ -281,7 +281,7 @@ static void ignoredepends(const struct cmdinfo *cip, const 
char *value) {
   }
   p= copy;
   while (*p) {
-    pnerr = illegal_packagename(p, NULL);
+    pnerr = pkg_name_is_illegal(p, NULL);
     if (pnerr) ohshite(_("--ignore-depends requires a legal package name. "
                        "`%.250s' is not; %s"), p, pnerr);
 
diff --git a/src/select.c b/src/select.c
index 631fd3c..c9bcad4 100644
--- a/src/select.c
+++ b/src/select.c
@@ -125,7 +125,7 @@ void setselections(const char *const *argv) {
     }
     varbufaddc(&namevb,0);
     varbufaddc(&selvb,0);
-    e = illegal_packagename(namevb.buf, NULL);
+    e = pkg_name_is_illegal(namevb.buf, NULL);
     if (e) ohshit(_("illegal package name at line %d: %.250s"),lno,e);
     for (nvp=wantinfos; nvp->name && strcmp(nvp->name,selvb.buf); nvp++);
     if (!nvp->name) ohshit(_("unknown wanted status at line %d: 
%.250s"),lno,selvb.buf);
diff --git a/src/trigcmd.c b/src/trigcmd.c
index 4dfdca6..0366ec4 100644
--- a/src/trigcmd.c
+++ b/src/trigcmd.c
@@ -210,7 +210,7 @@ main(int argc, const char *const *argv)
                                 " (or with a --by-package option)"));
        }
        if (strcmp(bypackage, "-") &&
-           (badname = illegal_packagename(bypackage, NULL)))
+           (badname = pkg_name_is_illegal(bypackage, NULL)))
                ohshit(_("illegal awaited package name '%.250s': %.250s"),
                       bypackage, badname);
 

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to