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

Bug#237734: dpkg: should support single character package names



Package: dpkg
Version: 1.10.20
Severity: minor

I've developped some templates that automatically generate autoconf/automake scripts
for my GTK2 apps.  It autodetects the package name and version from the directory name.

While it is a template, I just call it "x".  (For actual apps I rename the directory to a "real name").

When testing dh_make on it, I discovered single character package names are illegal.  Obviously, it would
be stupid to put a single character package in a real repository, but with the attached patches it installs
on my system just fine.

(There may be subtle problems but as far as I can tell the problem with single character package names is the checks
for them.  There's nothing extremely different about a package named "xx" (which works) versus "x".

Anyway, I have a use case (testing dummy packages) and no examples of anything breaking, after these changes.

The affected files are dpkg:lib/parsehelp.c and 
dpkg-dev:/usr/lib/dpkg/parsechangelog/debian


-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.3-ck2
Locale: LANG=en_US, LC_CTYPE=en_US

Versions of packages dpkg depends on:
ii  dselect                     1.10.20      a user tool to manage Debian packa
ii  libc6                       2.3.2.ds1-11 GNU C Library: Shared libraries an

-- no debconf information
--- debian	2004-03-12 21:40:05.000000000 -0800
+++ debian.bak	2004-03-12 21:33:46.000000000 -0800
@@ -52,7 +52,7 @@
 while (<STDIN>) {
     s/\s*\n$//;
 #    printf(STDERR "%-39.39s %-39.39s\n",$expect,$_);
-    if (m/^(\w[-+0-9a-z.]*) \(([^\(\) \t]+)\)((\s+[-0-9a-z]+)+)\;/i) {
+    if (m/^(\w[-+0-9a-z.]+) \(([^\(\) \t]+)\)((\s+[-0-9a-z]+)+)\;/i) {
         if ($expect eq 'first heading') {
             $f{'Source'}= $1;
             $f{'Version'}= $2;
--- parsehelp.c	2004-03-12 21:53:23.000000000 -0800
+++ parsehelp.c.bak	2004-03-12 21:53:01.000000000 -0800
@@ -112,6 +112,7 @@
   
   if (!*p) return _("may not be empty string");
   if (!isalnum(*p)) return _("must start with an alphanumeric");
+  if (!*++p) return _("must be at least two characters");
   while ((c= *p++)!=0)
     if (!isalnum(c) && !strchr(alsoallowed,c)) break;
   if (!c) return NULL;

Reply to: