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

Bug#32765: dpkg-dev: various scripting bugs



Package: dpkg-dev
Version: 1.4.0.31 (+later?)

Here are a few bugs I noticed in certain of the scripts which probably
haven't been fixed yet.  I haven't bothered giving diffs, as there are
going to be so many changes to so much stuff, by the looks of it, that
it won't necessarily be of much help.

I'm looking forward to Ian having the time now to work on it: good luck!!

dpkg-parsechangelog
===================

   Does not accept a -h option; needs the line
     if (m/^-h$/) { &usageversion; exit(0); }
   near the end of the main while(@ARGV) loop.

parsechangelog/debian
=====================

   There is a missing + in the regexp for examining the final line of
   a changelog section; it does not allow a time zone such as (GMT).
   The line should read:
     } elsif (m/^ \-\- (.*) <(.*)>  ((\w+\,\s*)?\d{1,2}\s+\w+\s+\d{4}\s+\d{1,2}:\d\d:\d\d\s+[-+]\d{4}(\s+\([^\\\(\)]+\))?)$/) {
   with an extra '+' after the [^\\\(\)].

dpkg-genchanges
===============

   Typo in section:
     for $_ (keys %fi) {
       ...
       if (s/^C //) {
         ...
         elsif (m/^X[BS]+-|...
   with no '|' before the ^X.

controllib.pl
=============

   There are problems when capit is applied to a field name such as
   XB-Foobar.  I would suggest something like the following
   replacement (untested):

     sub capit {
       if ($_[0] =~ m/^(X[BCS]+)-(.*)/i) {
         return uc($1) .
           ( defined($capit{lc($2)}) ? $capit{lc($2)} : ucfirst(lc($2)) );
       } else {
         return ( defined($capit{lc($_[0])}) ?
            $capit{lc($_[0])} : ucfirst(lc($_[0])) );
       }
     }

   One could even envisage a function capit which broke the input into
   hyphen-separated segments and capitalised each one:

     sub capit {
       my (@parts,@capit_parts);
       @parts = split /-/, $_[0];
       @capit_parts = map { ucfirst(lc($_)) } @parts;
       if ($parts[0] =~ /^X[BCS]+/i) { @capit_parts[0] = uc($parts[0]); }
       return join '-', @capit_parts;
     }

   This would make the field names much more consistent in form and do
   away with the need for the exceptions array (although it could be
   retained if desired).

dpkg-gencontrol
===============

   There's a problem if there's an _all.deb file created and
   dpkg-gencontrol is run more than once -- the file ends up being
   listed multiple times.  This is due to the line near the end of the
   code (and \d could replace 0-9 in the character class):

     if (open(X,"< $fileslistfile")) {
       while (<X>) {
         s/\n$//;   # chomp would probably be nicer here, incidentally  ;-)
         next if m/^([-+0-9a-z.]+)_[^_]+_([-\w]+)\.deb /
           && ($1 eq $oppackage) && ($2 eq $arch);

   whereas the last line should read something like:
           && ($1 eq $oppackage) && ($2 eq $arch or $2 eq 'all');

HTH,

   Julian

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

            Julian Gilbey             Email: J.D.Gilbey@qmw.ac.uk
       Dept of Mathematical Sciences, Queen Mary & Westfield College,
                  Mile End Road, London E1 4NS, ENGLAND
      -*- Finger jdg@goedel.maths.qmw.ac.uk for my PGP public key. -*-


Reply to: