Debian Bug report logs - #532760
dpkg-genchanges should warn about unused substvars

version graph

Package: dpkg-dev; Maintainer for dpkg-dev is Dpkg Developers <debian-dpkg@lists.debian.org>; Source for dpkg-dev is src:dpkg.

Reported by: Joachim Breitner <nomeata@debian.org>

Date: Thu, 11 Jun 2009 12:03:01 UTC

Severity: wishlist

Tags: patch

Found in version dpkg/1.15.2

Fixed in version dpkg/1.15.3

Done: Guillem Jover <guillem@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, debian-haskell@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#532760; Package dpkg-dev. (Thu, 11 Jun 2009 12:03:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Joachim Breitner <nomeata@debian.org>:
New Bug report received and forwarded. Copy sent to debian-haskell@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>. (Thu, 11 Jun 2009 12:03:04 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Joachim Breitner <nomeata@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: dpkg-genchanges should warn about unused substvars
Date: Thu, 11 Jun 2009 14:01:43 +0200
Package: dpkg-dev
Version: 1.15.2
Severity: wishlist
File: /usr/bin/dpkg-gencontrol

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

a lot of debhelper programs for specific types of packages (python
libraries, haskell libraries, etc.) add substvars of various kinds –
Depends, Recommends, Suggests. It is easy to forget to add one of these
to debian/control. Therefore, the maintainer should be warned about
this.

It seems, though, that this can not be done as a lintian check, as
lintian does not see the automatically generated substvars files.

Therefore, dpkg-generated should warn about unused substvars. This could
be implemented in Dpkg::Substvars by remembering which vars have been
get()ted after being set()ted, and returning this list upon request.

Please indicate if you agree and are willing to accept a patch.

Greetings,
Joachim


- -- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.29-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages dpkg-dev depends on:
ii  binutils                      2.19.1-1   The GNU assembler, linker and bina
ii  bzip2                         1.0.5-2    high-quality block-sorting file co
ii  dpkg                          1.15.2     Debian package management system
ii  libtimedate-perl              1.1600-9   Time and date functions for Perl
ii  lzma                          4.43-14    Compression method of 7z format in
ii  make                          3.81-5     The GNU version of the "make" util
ii  patch                         2.5.9-5    Apply a diff file to an original
ii  perl [perl5]                  5.10.0-22  Larry Wall's Practical Extraction 
ii  perl-modules                  5.10.0-22  Core Perl modules

Versions of packages dpkg-dev recommends:
ii  build-essential               11.4       Informational list of build-essent
ii  gcc [c-compiler]              4:4.3.3-8  The GNU C compiler
ii  gcc-4.1 [c-compiler]          4.1.2-25   The GNU C compiler
ii  gcc-4.3 [c-compiler]          4.3.3-10   The GNU C compiler
ii  gnupg                         1.4.9-4    GNU privacy guard - a free PGP rep
ii  gpgv                          1.4.9-4    GNU privacy guard - signature veri

Versions of packages dpkg-dev suggests:
ii  debian-keyring                2009.05.28 GnuPG (and obsolete PGP) keys of D
pn  debian-maintainers            <none>     (no description available)

- -- no debconf information

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkow8icACgkQ9ijrk0dDIGyQwgCcCoJMfv5lPlCGyWYz1uWhS719
Q3kAn0m0y9DmoBXMzdc2YFi60hCZ4hLO
=Sm1q
-----END PGP SIGNATURE-----




Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#532760; Package dpkg-dev. (Sat, 13 Jun 2009 20:12:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Raphael Hertzog <hertzog@debian.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Sat, 13 Jun 2009 20:12:02 GMT) Full text and rfc822 format available.

Message #10 received at 532760@bugs.debian.org (full text, mbox):

From: Raphael Hertzog <hertzog@debian.org>
To: Joachim Breitner <nomeata@debian.org>, 532760@bugs.debian.org
Subject: Re: Bug#532760: dpkg-genchanges should warn about unused substvars
Date: Sat, 13 Jun 2009 22:08:59 +0200
On Thu, 11 Jun 2009, Joachim Breitner wrote:
> Therefore, dpkg-generated should warn about unused substvars. This could
> be implemented in Dpkg::Substvars by remembering which vars have been
> get()ted after being set()ted, and returning this list upon request.
> 
> Please indicate if you agree and are willing to accept a patch.

I agree on the principle but it seems difficult to do in practice. First
substvars can be used in dpkg-source, dpkg-gencontrol (usual case) and
dpkg-genchanges and they can possibly reuse the same substvars file (in
practice I suspect it almost never happens).

It's probably only reasonable for dpkg-gencontrol and I have no idea
if it would create lots of false positives or not.

Thus you can try to create a patch but it would be interesting to
do a full rebuild and check how many times it's triggered and
how many are false positives before we decide to include it.
(Maybe lucas can do this rebuild for you)

Cheers,
-- 
Raphaël Hertzog

Contribuez à Debian et gagnez un cahier de l'admin Debian Lenny :
http://www.ouaza.com/wp/2009/03/02/contribuer-a-debian-gagner-un-livre/




Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#532760; Package dpkg-dev. (Sat, 13 Jun 2009 22:12:09 GMT) Full text and rfc822 format available.

Acknowledgement sent to Joachim Breitner <nomeata@debian.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Sat, 13 Jun 2009 22:12:09 GMT) Full text and rfc822 format available.

Message #15 received at 532760@bugs.debian.org (full text, mbox):

From: Joachim Breitner <nomeata@debian.org>
To: Raphael Hertzog <hertzog@debian.org>
Cc: 532760@bugs.debian.org
Subject: Re: Bug#532760: dpkg-genchanges should warn about unused substvars
Date: Sat, 13 Jun 2009 23:59:20 +0200
[Message part 1 (text/plain, inline)]
Hi Raphael,

Am Samstag, den 13.06.2009, 22:08 +0200 schrieb Raphael Hertzog:
> I agree on the principle but it seems difficult to do in practice. First
> substvars can be used in dpkg-source, dpkg-gencontrol (usual case) and
> dpkg-genchanges and they can possibly reuse the same substvars file (in
> practice I suspect it almost never happens).
> 
> It's probably only reasonable for dpkg-gencontrol and I have no idea
> if it would create lots of false positives or not.
> 
> Thus you can try to create a patch but it would be interesting to
> do a full rebuild and check how many times it's triggered and
> how many are false positives before we decide to include it.
> (Maybe lucas can do this rebuild for you)

I gave it a shot, you can merge it from this git branch:
http://git.debian.org/?p=users/nomeata/dpkg.git;a=shortlog;h=refs/heads/unused_substvars_532760

I rebuilt dpkg itself and a „most typical“ C/debhelper package
(screen-message) with it, and it gave no (unexpected) warnings. Given
that it does not break anything, maybe you can just include it in the
next upload and see what happens?

The first patch in my series is useful independently, as it adds a test
script for Dpkg::Substvars, without any of the unused-vars-related
changes. I guess you can pull that one in any case.

Good night,
Joachim

-- 
Joachim "nomeata" Breitner
Debian Developer
  nomeata@debian.org | ICQ# 74513189 | GPG-Keyid: 4743206C
  JID: nomeata@joachim-breitner.de | http://people.debian.org/~nomeata
[signature.asc (application/pgp-signature, inline)]

Tags added: patch Request was from Joachim Breitner <nomeata@debian.org> to control@bugs.debian.org. (Tue, 16 Jun 2009 13:51:04 GMT) Full text and rfc822 format available.

Tags added: pending Request was from Raphael Hertzog <hertzog@debian.org> to control@bugs.debian.org. (Sat, 20 Jun 2009 21:54:07 GMT) Full text and rfc822 format available.

Message sent on to Joachim Breitner <nomeata@debian.org>:
Bug#532760. (Sat, 20 Jun 2009 21:54:09 GMT) Full text and rfc822 format available.

Message #22 received at 532760-submitter@bugs.debian.org (full text, mbox):

From: Raphael Hertzog <hertzog@debian.org>
To: 532760-submitter@bugs.debian.org
Subject: Bug#532760 marked as pending
Date: Sat, 20 Jun 2009 21:49:42 +0000
tag 532760 pending
thanks

Hello,

Bug #532760 reported by you has been fixed in the Git repository. You can
see the changelog below, and you can check the diff of the fix at:

    http://git.debian.org/?p=dpkg/dpkg.git;a=commitdiff;h=d60bb3e

---
commit d60bb3e211d9496653d5061c112ce3092998fe11
Author: Joachim Breitner <mail@joachim-breitner.de>
Date:   Sat Jun 13 23:33:08 2009 +0200

    dpkg-gencontrol: warn about unused substvars (closes: #532760)
    
    The change to Dpkg/Fields.pm is required to avoid unwanted warnings
    on the F:<fieldname> substitutions.

diff --git a/debian/changelog b/debian/changelog
index eb19faa..a8438d1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -32,6 +32,9 @@ dpkg (1.15.3) UNRELEASED; urgency=low
     that the toolchain allows to be shared but that are often static (and
     hence are blacklisted for this reason). Closes: #533642
 
+  [ Joachim Breitner ]
+  * Warn about unused substvars in dpkg-gencontrol. Closes: #532760
+
   [ Updated dpkg translations ]
   * Simplified Chinese (Deng Xiyue). Closes: #531387
   * Catalan (Jordi Mallach). Closes: #532109




Reply sent to Guillem Jover <guillem@debian.org>:
You have taken responsibility. (Sat, 27 Jun 2009 19:06:27 GMT) Full text and rfc822 format available.

Notification sent to Joachim Breitner <nomeata@debian.org>:
Bug acknowledged by developer. (Sat, 27 Jun 2009 19:06:27 GMT) Full text and rfc822 format available.

Message #27 received at 532760-close@bugs.debian.org (full text, mbox):

From: Guillem Jover <guillem@debian.org>
To: 532760-close@bugs.debian.org
Subject: Bug#532760: fixed in dpkg 1.15.3
Date: Sat, 27 Jun 2009 18:32:17 +0000
Source: dpkg
Source-Version: 1.15.3

We believe that the bug you reported is fixed in the latest version of
dpkg, which is due to be installed in the Debian FTP archive:

dpkg-dev_1.15.3_all.deb
  to pool/main/d/dpkg/dpkg-dev_1.15.3_all.deb
dpkg_1.15.3.dsc
  to pool/main/d/dpkg/dpkg_1.15.3.dsc
dpkg_1.15.3.tar.gz
  to pool/main/d/dpkg/dpkg_1.15.3.tar.gz
dpkg_1.15.3_amd64.deb
  to pool/main/d/dpkg/dpkg_1.15.3_amd64.deb
dselect_1.15.3_amd64.deb
  to pool/main/d/dpkg/dselect_1.15.3_amd64.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 532760@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Guillem Jover <guillem@debian.org> (supplier of updated dpkg package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Sat, 27 Jun 2009 19:06:43 +0200
Source: dpkg
Binary: dpkg dpkg-dev dselect
Architecture: source amd64 all
Version: 1.15.3
Distribution: unstable
Urgency: low
Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
Changed-By: Guillem Jover <guillem@debian.org>
Description: 
 dpkg       - Debian package management system
 dpkg-dev   - Debian package development tools
 dselect    - Debian package management front-end
Closes: 521551 521760 525115 526251 529999 530633 530769 530860 531387 531611 532109 532222 532739 532760 532769 533171 533181 533642 533828 534464 534551 534831
Changes: 
 dpkg (1.15.3) unstable; urgency=low
 .
   [ Guillem Jover ]
   * Unset TAR_OPTIONS when extracting .deb archives.
   * Use default compressor values in dpkg-source from Dpkg::Source::Compressor.
   * Fix dpkg-scanpackages to properly detect spurious overrides.
   * Rewrite dpkg-name in perl.
   * Do not close already closed files in some error conditions in libdpkg.
   * Use the correct units (KiB) in dpkg-split when referring to partsize.
   * Document in dpkg-statoverride(8) that mode needs to be specified in
     octal. Closes: #534551
   * Mark argument names in dpkg-statoverride.1 in italic.
   * Explicitly pass field argument to Dpkg::ErrorHandling::unknown().
   * Move unknown() from Dpkg::ErrorHandling to Dpkg::Fields.
 .
   [ Raphael Hertzog ]
   * Unset TAR_OPTIONS when creating/extracting tar archives for source
     packages. Closes: #530860
   * Add cleanup of all invalid (master) alternatives in preinst script.
     Closes: #530633, #531611, #532739, #521760
   * Let update-alternatives fix a manual alternative with a dangling symlink
     by switching it to automatic mode. Closes: #529999
   * Add missing paragraph separator in dpkg-buildpackage(1). Thanks to Per
     Andersson <avtobiff@gmail.com>. Closes: #532769
   * Fix english mistake (“as you request” → “as you requested”) in several
     places. Thanks to David Stansby for the patch. Closes: #533171
   * Support tags before symbols in symbols file contained in source packages.
     The first two tags are "optional" (use it to not fail if the symbol might
     disappear from the library without breaking the ABI) and "arch" to
     restrict the set of architectures where the symbol is supposed to exist.
     Thanks to Modestas Vainius <modestas@vainius.eu> for the patch.
     See dpkg-gensymbols(1) for more information. Closes: #521551
   * Do not include #MISSING lines in symbols files integrated in binary
     packages. Closes: #526251
   * Assume an implicit version of "Base" for all unversioned symbols
     that are merged into a SymbolFile. Closes: #533181
   * Add new tag "ignore-blacklist" to force-include symbols which are
     normally blacklisted. This can be useful for libgcc to include symbols
     that the toolchain allows to be shared but that are often static (and
     hence are blacklisted for this reason). Closes: #533642
   * In dpkg-source, explicitly pass --keyring ~/.gnupg/trustedkeys.gpg to
     gpgv as it does not use it if other --keyring parameters are given.
     Closes: #530769
   * In dpkg-vendor, allow to use dashes instead of spaces in vendor
     filenames. Closes: #532222
   * Skip dpkg-genchanges' warning about lower version numbers for backports
     (recognized by ~bpo or ~vola in their version number). Closes: #525115
   * Support all checksum algorithms in dpkg-scanpackages/dpkg-scansources.
     Closes: #533828
   * Fix dependency parsing code in Dpkg::Deps to not accept "foo\nbar"
     even if foo is valid. Closes: #534464
     Thanks to Andrew Sayers for spotting the problem.
 .
   [ Joachim Breitner ]
   * Warn about unused substvars in dpkg-gencontrol. Closes: #532760
 .
   [ Updated dpkg translations ]
   * Catalan (Jordi Mallach). Closes: #532109
   * Czech (Miroslav Kure).
   * German (Sven Joachim). Closes: #534831
   * Simplified Chinese (Deng Xiyue). Closes: #531387
   * Swedish (Peter Krefting).
 .
   [ Updated dselect translations ]
   * Czech (Miroslav Kure).
 .
   [ Updated man page translations ]
   * German (Helge Kreutzmann).
   * Swedish (Peter Krefting).
 .
   [ Updated scripts translations ]
   * German (Helge Kreutzmann).
   * Swedish (Peter Krefting).
Checksums-Sha1: 
 ee7ab6192faf610fd49b3b9a1b28b9d248014b65 1210 dpkg_1.15.3.dsc
 9b6ddecf88cfcc0a106aa533746cc97595833008 7070609 dpkg_1.15.3.tar.gz
 1ef2dec9968b887353d172d0ac37ec67be41186f 2210926 dpkg_1.15.3_amd64.deb
 5e010ed10ae14a82319c25a3dbc26cb8fcc1f639 680260 dselect_1.15.3_amd64.deb
 c539955b7cba75cafc882ce0cf4cb669af54aa3c 646574 dpkg-dev_1.15.3_all.deb
Checksums-Sha256: 
 a5bf283b6564ef42be5362e6d16326525c4b71fe586f71e75ed2d07748c63def 1210 dpkg_1.15.3.dsc
 3dbc0cfdeee4535680d73a7967ee9580f5a55de36b99d13ce8bed643dadc1e2c 7070609 dpkg_1.15.3.tar.gz
 cd3e80c80449c8de4575598a8a7d61db849861de48d8eda4e3027d15520cee40 2210926 dpkg_1.15.3_amd64.deb
 b9a908e33b27cfbc94591944aeb2d4dfb3d2dc4e5c037d9f5e4a1049898b1170 680260 dselect_1.15.3_amd64.deb
 0065f32d8bd2431e0d83654c0ef16746e416af7f25681873139b4e55060a5475 646574 dpkg-dev_1.15.3_all.deb
Files: 
 29d3edaaec3a27bc2fda5eb90d2ed47d 1210 admin required dpkg_1.15.3.dsc
 f15beca62d28bbee409e2d379354310d 7070609 admin required dpkg_1.15.3.tar.gz
 c3f0d44f1f7378256041962261a3e1d0 2210926 admin required dpkg_1.15.3_amd64.deb
 910789180931229d7c0409c798b3722f 680260 admin optional dselect_1.15.3_amd64.deb
 122dbc4d9f974d3a080dc719b6a1854e 646574 utils optional dpkg-dev_1.15.3_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkpGVQQACgkQuW9ciZ2SjJuSmQCgiHa1gdX8lMZLg1Qnha6DR8pE
w3MAoK16xgUs9Qyisr7GF1po5W9u2UuO
=k8Bc
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sun, 26 Jul 2009 07:34:52 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Fri Apr 18 05:42:06 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.