[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Is underscore allowed in package names? What about in virtual package names?



Max Bowsher <maxb1@ukf.net> writes:

> Hi,
>
> The underscore character is not allowed in package names, right?
>
> Are virtual package names supposed to conform to the same restrictions?
>
> I ask this because I just came across "Provides: x86_64-linux-gnu" in
> the current etch Packages file (for the package 'type-handling').
>
>
> Max.

lib/parsehlper.c:

const char *illegal_packagename(const char *p, const char **ep) {
  static const char alsoallowed[]= "-+._"; /* _ is deprecated */
  static char buf[150];
  int c;
  
  if (!*p) return _("may not be empty string");
  if (!isalnum(*p)) return _("must start with an alphanumeric");
  while ((c= *p++)!=0)
    if (!isalnum(c) && !strchr(alsoallowed,c)) break;
  if (!c) return NULL;
  if (isspace(c) && ep) {
    while (isspace(*p)) p++;
    *ep= p; return NULL;
  }
  snprintf(buf, sizeof(buf), _(
	   "character `%c' not allowed (only letters, digits and characters `%s')"),
	   c, alsoallowed);
  return buf;
}


>From the source you can see that _ is allowed but deprecated.

MfG
        Goswin



Reply to: