bad error message for incorrect Maintainer: field syntax (fails to parse changelog)

Bug #85574 reported by kko
2
Affects Status Importance Assigned to Milestone
equivs (Debian)
Fix Released
Unknown
equivs (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

Binary package hint: equivs

This is on Kubuntu Dapper, with equivs version 2.0.6-0.1. Also tested with the newer version 2.0.7 installed from packages.ubuntu.com.

The command 'man equivs-build' tells us the following: "If you don’t use a local changelog, equivs will create a dummy one." However, it can't do this.

Using the following control file (for completely local use) by the name 'libxine-main1':
Package: libxine-main1
Version: 1.1.1+ubuntu2-7.5+patch1
Maintainer: kko
Depends: libxine-main1 (= 1.1.1+ubuntu2-7.2+patch1)
Description: A meta-package to trick adept_notifier and adept_updater.
 This depends on the real installed patched version, but has
 a version number larger than what is currently available
 through repositories.

...and then running 'equivs-build libxine-main1', I get the following output:
Use of uninitialized value in concatenation (.) or string at /usr/bin/equivs-build line 207, <IN> line 22.
dh_testdir
touch build-stamp
dh_testdir
dh_testroot
dh_clean -k
dh_clean: Compatibility levels before 4 are deprecated.
# Add here commands to install the package into debian/tmp.
touch install-stamp
dh_testdir
dh_testroot
dh_installdocs
dh_installdocs: Compatibility levels before 4 are deprecated.
dh_installchangelogs
parsechangelog/debian: error: badly formatted trailer line, at changelog line 5
dh_installchangelogs: changelog parse failure
make: *** [binary-arch] Virhe 1
Error during the build process: Inappropriate ioctl for device at /usr/bin/equivs-build line 180, <IN> line 31.

...and after 'sudo dpkg -i equivs_2.0.7_all.deb', running 'equivs-build libxine-main1':
Use of uninitialized value in concatenation (.) or string at /usr/bin/equivs-build line 153.
dh_testdir
dh_testroot
dh_clean -k
dh_testdir
dh_testroot
dh_installdocs
dh_installchangelogs
parsechangelog/debian: error: badly formatted trailer line, at changelog line 5
dh_installchangelogs: changelog parse failure
make: *** [binary-arch] Virhe 1
Error in the build process: exit status 2

There seems to at least be a problem in parsing the changelog (that equivs is supposed to provide from a template). (The command 'man equivs-build' tells us that "The control file -- doesn't have to define all keys, as default values will be used if you omit one." I have, accordingly, omitted a number of fields from the control file.)

Looking at the list of installed files, I don't see a separate 'changelog' file in equivs's template directory, although I'm guessing this may not even be intended, as it could be coded into the script.

I was able to build the package after I defined the changelog file with "Changelog: changelog.txt" in the control file, and added a modified changelog for "libxine-main1" as 'changelog.txt'.

Revision history for this message
In , Jiggly Puff (jigglypuff) wrote : This bug is still here.

I just ran into this bug today (Sept 2006). I discovered the solution to
it on usenetlinux.com, which was just an archive of this report. Hard to
believe that this bug was discoverd 2.5 years ago, and still hasn't been
fixed.

Revision history for this message
kko (kko) wrote : equivs can't create a meta-package without a user-provided changelog

Binary package hint: equivs

This is on Kubuntu Dapper, with equivs version 2.0.6-0.1. Also tested with the newer version 2.0.7 installed from packages.ubuntu.com.

The command 'man equivs-build' tells us the following: "If you don’t use a local changelog, equivs will create a dummy one." However, it can't do this.

Using the following control file (for completely local use) by the name 'libxine-main1':
Package: libxine-main1
Version: 1.1.1+ubuntu2-7.5+patch1
Maintainer: kko
Depends: libxine-main1 (= 1.1.1+ubuntu2-7.2+patch1)
Description: A meta-package to trick adept_notifier and adept_updater.
 This depends on the real installed patched version, but has
 a version number larger than what is currently available
 through repositories.

...and then running 'equivs-build libxine-main1', I get the following output:
Use of uninitialized value in concatenation (.) or string at /usr/bin/equivs-build line 207, <IN> line 22.
dh_testdir
touch build-stamp
dh_testdir
dh_testroot
dh_clean -k
dh_clean: Compatibility levels before 4 are deprecated.
# Add here commands to install the package into debian/tmp.
touch install-stamp
dh_testdir
dh_testroot
dh_installdocs
dh_installdocs: Compatibility levels before 4 are deprecated.
dh_installchangelogs
parsechangelog/debian: error: badly formatted trailer line, at changelog line 5
dh_installchangelogs: changelog parse failure
make: *** [binary-arch] Virhe 1
Error during the build process: Inappropriate ioctl for device at /usr/bin/equivs-build line 180, <IN> line 31.

...and after 'sudo dpkg -i equivs_2.0.7_all.deb', running 'equivs-build libxine-main1':
Use of uninitialized value in concatenation (.) or string at /usr/bin/equivs-build line 153.
dh_testdir
dh_testroot
dh_clean -k
dh_testdir
dh_testroot
dh_installdocs
dh_installchangelogs
parsechangelog/debian: error: badly formatted trailer line, at changelog line 5
dh_installchangelogs: changelog parse failure
make: *** [binary-arch] Virhe 1
Error in the build process: exit status 2

There seems to at least be a problem in parsing the changelog (that equivs is supposed to provide from a template). (The command 'man equivs-build' tells us that "The control file -- doesn't have to define all keys, as default values will be used if you omit one." I have, accordingly, omitted a number of fields from the control file.)

Looking at the list of installed files, I don't see a separate 'changelog' file in equivs's template directory, although I'm guessing this may not even be intended, as it could be coded into the script.

I was able to build the package after I defined the changelog file with "Changelog: changelog.txt" in the control file, and added a modified changelog for "libxine-main1" as 'changelog.txt'.

Revision history for this message
kko (kko) wrote :

After installing the created package, I do realise that this was a "stupid thing to do" (tm), as dpkg replaced the real package with this metapackage. But well... you live and learn. ;-)

The bug with equivs still stands, regardless.

Revision history for this message
kko (kko) wrote :

(For the curious, see bug 72806 for why I tried this in the first place.)

Revision history for this message
kko (kko) wrote :

To rule out the disturbing effect of the circular dependency above, I reproduced the bug also by running 'equivs-build foo' with the following control file, by the name 'foo':
Package: foo
Version: 1.2
Maintainer: kko
Depends: dpkg
Architecture: all
Description: foo
 bar baz

Revision history for this message
kko (kko) wrote : Re: equivs can't create a meta-package without a user-provided changelog (solution provided)

It turns out that equivs-build actually needs the maintainer field (if present) to be of the form "Maintainer: foo <email address hidden>", so that it contains both a name and an e-mail address. The error message it gives (shown above) isn't really helpful.

So, running 'equivs-build foo' with both the below control files (by the name 'foo') works.
control file 1:
Package: foo
Version: 1.2
Maintainer: foo <email address hidden>
Depends: dpkg
Architecture: all
Description: foo
 bar baz

control file 2:
Package: foo
Version: 1.2
Depends: dpkg
Architecture: all
Description: foo
 bar baz

Revision history for this message
kko (kko) wrote :

There is a three years old debian bug report about this issue:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=251673 .

(I have previously been able to add remote bug watches, but Launchpad interface seems to have been changed so that I can't find this possibility anymore.)

Changed in equivs:
status: Unknown → Unconfirmed
Revision history for this message
In , era eriksson (era-iki) wrote : fix bug description

retitle 251673 parsechangelog fails if Maintainer: formatted wrong
thanks

The problem is IMHO real, but it's not necessarily equivs which should
be fixed. Perhaps a better solution would be for dpkg-parsechangelog
to issue a more candid error message about the nature of the error.

/usr/lib/dpkg/parsechangelog/debian line 146 has the regex
/^ \-\- (.*) <(.*)> ((\w+\,\s*)?\...((:datestamp:))/ which seems to
imply that /(.*) <(.*)>/ would be a suitable regex for checking
Maintainer: -- but again, proper encapsulation would dictate that this
information should not be duplicated in the equivs code.

Error handling aside, maybe the instructions in template.ctl could be
even more explicit about the required format for this field.

Possibly a crude syntax checker for the control file could be devised;
that should certainly handle all of #219188, #251673, and #247974.

vnix$ cat 251673.changelog
j2re1.4 (1.4) unstable; urgency=low

  * Test case for #251673

 -- <email address hidden> Sun, 30 May 2004 08:58:58 +0200
vnix$ dpkg-parsechangelog -l251673.changelog
parsechangelog/debian: error: badly formatted trailer line, at file
251673.changelog line 11

Daniel T Chen (crimsun)
Changed in equivs:
importance: Undecided → Low
status: New → Confirmed
era (era)
summary: - equivs can't create a meta-package without a user-provided changelog
- (bad error message, solution provided)
+ bad error message for incorrect Maintainer: field syntax (fails to parse
+ changelog)
Changed in equivs (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.