Bug#350728: dh-make-perl: Descriptions with linefeeds result in syntax error in control file

2006-01-31 Thread Adam Sjøgren
Package: dh-make-perl
Version: 0.20
Severity: normal
Tags: patch


Some modules get descriptions with linefeeds in them - this fools
dh-make-perl into making invalid debian/control-files (the Description
field is not indented correctly).

Please consider applying the attached patch or some other remedy. 
Thanks!


An example is UNIVERSAL::isa:

== =
[EMAIL PROTECTED]:/usr/src/perl-modules$ dh-make-perl --build --cpan 
UNIVERSAL::isa  
CPAN: Storable loaded ok
Going to read /home/asjo/.cpan/Metadata
  Database was generated on Tue, 31 Jan 2006 03:13:48 GMT
CPAN: Digest::MD5 loaded ok
CPAN: Compress::Zlib loaded ok
Checksum for 
/home/asjo/.cpan/source/authors/id/N/NU/NUFFIN/UNIVERSAL-isa-0.05.tar.gz ok
Scanning cache /home/asjo/.cpan/build for sizes
UNIVERSAL-isa-0.05/
UNIVERSAL-isa-0.05/Build.PL
UNIVERSAL-isa-0.05/lib/
UNIVERSAL-isa-0.05/lib/UNIVERSAL/
UNIVERSAL-isa-0.05/lib/UNIVERSAL/isa.pm
UNIVERSAL-isa-0.05/Makefile.PL
UNIVERSAL-isa-0.05/MANIFEST
UNIVERSAL-isa-0.05/META.yml
UNIVERSAL-isa-0.05/SIGNATURE
UNIVERSAL-isa-0.05/t/
UNIVERSAL-isa-0.05/t/basic.t
UNIVERSAL-isa-0.05/t/bugs.t
Found: UNIVERSAL-isa 0.05 (libuniversal-isa-perl arch=all)

Package does not provide a long description -  Please fill it in manually.
Using maintainer: Adam Sjøgren <[EMAIL PROTECTED]>
Found docs: t/bugs.t
Using rules: /usr/share/dh-make-perl/rules.Module-Build.noxs
make: Entering directory `/usr/src/perl-modules/UNIVERSAL-isa-0.05'
dh_testdir
dh_testroot
# Add commands to clean up after the build process here
[ ! -f Build ] || /usr/bin/perl Build distclean
dh_clean build-stamp install-stamp
make: Leaving directory `/usr/src/perl-modules/UNIVERSAL-isa-0.05'
make: Entering directory `/usr/src/perl-modules/UNIVERSAL-isa-0.05'
dh_testdir
# Add commands to compile the package here
/usr/bin/perl Build.PL installdirs=vendor
Checking whether your kit is complete...
Looks good
Creating new 'Build' script for 'UNIVERSAL-isa' version '0.05'
OPTIMIZE="-Wall -O2 -g" /usr/bin/perl Build
lib/UNIVERSAL/isa.pm -> blib/lib/UNIVERSAL/isa.pm
Manifying blib/lib/UNIVERSAL/isa.pm -> blib/libdoc/UNIVERSAL::isa.3pm
touch build-stamp
dh_testdir
dh_testroot
dh_clean -k
# Add commands to install the package into debian/ACKAGE_NAME here
/usr/bin/perl Build test
t/basicok
t/bugs.ok
All tests successful.
Files=2, Tests=19,  0 wallclock secs ( 0.13 cusr +  0.02 csys =  0.15 CPU)
/usr/bin/perl Build install 
destdir=/usr/src/perl-modules/UNIVERSAL-isa-0.05/debian/libuniversal-isa-perl
Installing 
/usr/src/perl-modules/UNIVERSAL-isa-0.05/debian/libuniversal-isa-perl/usr/share/perl5/UNIVERSAL/isa.pm
Installing 
/usr/src/perl-modules/UNIVERSAL-isa-0.05/debian/libuniversal-isa-perl/usr/share/man/man3/UNIVERSAL::isa.3pm
touch install-stamp
dh_testdir
dh_testroot
dh_installdocs t/bugs.t
dh_installchangelogs 
dh_perl
dh_link
dh_strip
dh_compress
dh_fixperms
dh_installdeb
dh_gencontrol
dpkg-gencontrol: error: syntax error in control file debian/control at line 13: 
line with unknown format (not field-colon-value)
dh_gencontrol: command returned error code 2304
make: *** [binary-indep] Error 1
make: Leaving directory `/usr/src/perl-modules/UNIVERSAL-isa-0.05'
Cannot create deb package
[EMAIL PROTECTED]:/usr/src/perl-modules$ cat UNIVERSAL-isa-0.05/debian/control 
Source: libuniversal-isa-perl
Section: perl
Priority: optional
Build-Depends: debhelper (>= 4.0.2), libmodule-build-perl
Build-Depends-Indep: perl (>= 5.8.0-7)
Maintainer: Adam Sjøgren <[EMAIL PROTECTED]>
Standards-Version: 3.6.1

Package: libuniversal-isa-perl
Architecture: all
Depends: ${perl:Depends}, ${misc:Depends}, 
Description: Hack around stupid module authors using UNIVERSAL::isa as a
function when they shouldn't.
 Whenever you use UNIVERSAL/isa as a function, a kitten using
 Test::MockObject dies. Normally, the kittens would be helpless, but if they
 use UNIVERSAL::isa (the module whose docs you are reading), the kittens can
 live long and prosper.
 .
 This module replaces UNIVERSAL::isa with a version that makes sure that if
 it's called as a function on objects which override isa, isa will be
 called on those objects as a method.
 .
 In all other cases the real UNIVERSAL::isa is just called directly.
 .
 This description was automagically extracted from the module by dh-make-perl.
[EMAIL PROTECTED]:/usr/src/perl-modules$ 
== =

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.14-asjo-p4
Locale: LANG=C, LC_CTYPE=da_DK (charmap=ISO-8859-1)

Versions of packages dh-make-perl depends on:
ii  debhelper 5.0.22 helper programs for debian/rules
ii  dpkg-dev  1.13.13package building tools for Debian
ii  fakeroot  1.5.6  Gives a f

Bug#350728: dh-make-perl: Descriptions with linefeeds result in syntax error in control file

2006-01-31 Thread Damyan Ivanov
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Adam Sjøgren wrote:
> Package: dh-make-perl
> Version: 0.20
> Severity: normal
> Tags: patch
> 
> 
> Some modules get descriptions with linefeeds in them - this fools
> dh-make-perl into making invalid debian/control-files (the Description
> field is not indented correctly).
> 
> Please consider applying the attached patch or some other remedy. 
> Thanks!
> 
> ...
>
> --- dh-make-perl.orig 2006-01-31 13:45:23.133438005 +0100
> +++ dh-make-perl  2006-01-31 13:46:04.413068655 +0100
> @@ -506,6 +506,8 @@
>   $my_desc =~ s/\n.*$//s;
>   $desc = $my_desc;
>   }
> +# Replace linefeeds (not followed by a space) in $desc with spaces:
> +$desc=~s/\n\S/ /gs;
>  
>   unless ($longdesc) {
>   $longdesc = $parser->get('DESCRIPTION')

The above pattern elliminates any non-space after the linefeed.

How about ``/\n(?=\S)/ /gs''  ?

For those (like me) that don't remember what (?=...) is:

   "(?=pattern)"
 A zero-width positive look-ahead assertion.  For example,
 "/\w+(?=\t)/" matches a word followed by a tab, without
 including the tab in $&.

dam
- --
Damyan Ivanov  Creditreform Bulgaria
[EMAIL PROTECTED]  http://www.creditreform.bg/
phone: +359(2)928-2611, 929-3993fax: +359(2)920-0994
mob. +359(88)856-6067   [EMAIL PROTECTED]/Gaim
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFD36OoHqjlqpcl9jsRApZYAKCRNnz9F/6gEVahbhZ9N67MFWRduQCgn3n+
yTR0bknRTrCs/1ewRviTyTw=
=kVHA
-END PGP SIGNATURE-


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



Bug#350728: dh-make-perl: Descriptions with linefeeds result in syntax error in control file

2006-02-03 Thread Adam =?UTF-8?Q?Sj=C3=B8gren
On Tue, 31 Jan 2006 19:52:08 +0200, Damyan wrote:

[I wonder why I never got this by email; oh well]

>> +$desc=~s/\n\S/ /gs;

> The above pattern elliminates any non-space after the linefeed.

You are right, I wasn't thinking.

> How about ``/\n(?=\S)/ /gs''  ?

What I wanted to write was:

  $desc=~s/\n(\S)/ $1/gs;

which is probably easier to remember(/read) for most people, but
perhaps not as "clean".

Thanks for pointing this out - it just goes to show that even the
tiniest change has potential for introducing new embarrasing bugs.


  Best regards,

Adam

-- 
 "You know, if the sun was an oboe, what would you do?"   Adam Sjøgren
 [EMAIL PROTECTED]