Debian Bug report logs - #627188
apt-listchanges et al: please document VERSION 2 hook interface

version graph

Package: apt; Maintainer for apt is APT Development Team <deity@lists.debian.org>; Source for apt is src:apt.

Reported by: Jonathan Nieder <jrnieder@gmail.com>

Date: Mon, 16 May 2011 13:54:01 UTC

Severity: minor

Tags: patch

Found in version apt/0.9.7.1

Reply or subscribe to this bug.

Toggle useless messages

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


Report forwarded to debian-bugs-dist@lists.debian.org, Francesco Poli (wintermute) <invernomuto@paranoici.org>:
Bug#626937; Package apt-listbugs. (Mon, 16 May 2011 13:54:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan Nieder <jrnieder@gmail.com>:
New Bug report received and forwarded. Copy sent to Francesco Poli (wintermute) <invernomuto@paranoici.org>. (Mon, 16 May 2011 13:54:04 GMT) Full text and rfc822 format available.

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

From: Jonathan Nieder <jrnieder@gmail.com>
To: submit@bugs.debian.org
Subject: apt-listbugs: E: private method `chomp!' called for nil:NilClass
Date: Mon, 16 May 2011 08:51:00 -0500
Package: apt-listbugs
Version: 0.1.4
Severity: important

Hi,

New armel squeeze system, running through qemu.  After installing
apt-listbugs from unstable, I decided it's time to upgrade everything
to experimental.  So I told cupt to do so ("cupt full-upgrade").

6 new packages were to be installed, 45 upgraded, and 1 removed.
The result:

 Reading package fields... 0% ... E: private method `chomp!' called for nil:NilClass
 E: 'dpkg 'pre' action '/usr/sbin/apt-listbugs apt || exit 10'' failed: exit code '10'

 $ ruby --version
 ruby 1.8.7 (2011-02-18 patchlevel 334) [arm-linux-eabi]

Any hints for tracking this down?




Information forwarded to debian-bugs-dist@lists.debian.org, Francesco Poli (wintermute) <invernomuto@paranoici.org>:
Bug#626937; Package apt-listbugs. (Mon, 16 May 2011 14:06:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan Nieder <jrnieder@gmail.com>:
Extra info received and forwarded to list. Copy sent to Francesco Poli (wintermute) <invernomuto@paranoici.org>. (Mon, 16 May 2011 14:06:03 GMT) Full text and rfc822 format available.

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

From: Jonathan Nieder <jrnieder@gmail.com>
To: 626937@bugs.debian.org
Subject: Re: apt-listbugs: E: private method `chomp!' called for nil:NilClass
Date: Mon, 16 May 2011 09:03:57 -0500
Jonathan Nieder wrote:

> New armel squeeze system

Erm, new armel _wheezy_ system.  Installed using yesterday's d-i
daily build.  Sorry for the nonsense.




Information forwarded to debian-bugs-dist@lists.debian.org, Francesco Poli (wintermute) <invernomuto@paranoici.org>:
Bug#626937; Package apt-listbugs. (Mon, 16 May 2011 21:42:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Francesco Poli <invernomuto@paranoici.org>:
Extra info received and forwarded to list. Copy sent to Francesco Poli (wintermute) <invernomuto@paranoici.org>. (Mon, 16 May 2011 21:42:03 GMT) Full text and rfc822 format available.

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

From: Francesco Poli <invernomuto@paranoici.org>
To: Jonathan Nieder <jrnieder@gmail.com>, 626937@bugs.debian.org
Subject: Re: Bug#626937: apt-listbugs: E: private method `chomp!' called for nil:NilClass
Date: Mon, 16 May 2011 23:13:54 +0200
[Message part 1 (text/plain, inline)]
On Mon, 16 May 2011 08:51:00 -0500 Jonathan Nieder wrote:

> Package: apt-listbugs
> Version: 0.1.4
> Severity: important
> 
> Hi,

Hi Jonathan,
thanks for your bug report!

> 
> New armel squeeze system, running through qemu.

Taking into account your self-reply, I take notice that what you are
talking about is actually a new armel _wheezy_ system.

> After installing
> apt-listbugs from unstable, I decided it's time to upgrade everything
> to experimental.  So I told cupt to do so ("cupt full-upgrade").

Please note that Cupt is not really fully tested with apt-listbugs (at
least as far as I know): hence you should not take for granted that it
will work flawlessly with apt-listbugs.

That being said, it may well be that the bug you are experiencing does
*not* depend on the use of Cupt.

Please try to reproduce the bug outside of the package manager.
For instance, does apt-listbugs work for you if you just issue the
following command?

  $ apt-listbugs list apt
  Reading package fields... Done
  Reading package status... Done
  Retrieving bug reports... Done
  Parsing Found/Fixed information... Done
  grave bugs of apt (0.8.14.1 -> ) <unfixed>
   #407511 - apt: Wrong value for APT::Default-Release may cause unwanted
   #625447 - apt-cdrom does not add CD at all; ignores drive
  serious bugs of apt (0.8.14.1 -> ) <unfixed>
   #558784 - apt: re-adds removed keys
  Summary:
   apt(3 bugs)


> 
> 6 new packages were to be installed, 45 upgraded, and 1 removed.
> The result:
> 
>  Reading package fields... 0% ... E: private method `chomp!' called for nil:NilClass
>  E: 'dpkg 'pre' action '/usr/sbin/apt-listbugs apt || exit 10'' failed: exit code '10'

It seems that, at /usr/share/apt-listbugs/apt-listbugs/logic.rb:770 ,
the `chomp!' method is called for a nil object.
Hence, it seems that pkgnames[index] is nil, for some reason.

I must investigate further, to understand what's going on on your
system.
Needless to say, on my amd64 and i386 (testing) systems and on my sid
chroot, apt-listbugs works fine with aptitude. As a consequence, it
could be something caused by Cupt, or maybe some architecture-specific
issue.

> 
>  $ ruby --version
>  ruby 1.8.7 (2011-02-18 patchlevel 334) [arm-linux-eabi]

I have

  $ ruby --version
  ruby 1.8.7 (2011-02-18 patchlevel 334) [x86_64-linux]

here...

> 
> Any hints for tracking this down?

This is going to be tricky.

I can try to reproduce the bug on a sid chroot (on amd64) with Cupt,
but unfortunately I don't have any armel system where I can investigate
a possible architecture-specific bug. And I lack qemu expertise to
setup an emulated armel system...   :-(

Anyway, I am afraid you'll have to wait some time, since I am quite
busy in these days.
Sorry...   :-(


P.S.: Note to self: I see there has been an old bug (#289361) about a
`chomp!' invoked for a nil object; I must check whether it is a relative
of the present bug...


-- 
 http://www.inventati.org/frx/frx-gpg-key-transition-2010.txt
 New GnuPG key, see the transition document!
..................................................... Francesco Poli .
 GnuPG key fpr == CA01 1147 9CD2 EFDF FB82  3925 3E1C 27E1 1F69 BFFE
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Francesco Poli (wintermute) <invernomuto@paranoici.org>:
Bug#626937; Package apt-listbugs. (Mon, 16 May 2011 22:21:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan Nieder <jrnieder@gmail.com>:
Extra info received and forwarded to list. Copy sent to Francesco Poli (wintermute) <invernomuto@paranoici.org>. (Mon, 16 May 2011 22:21:06 GMT) Full text and rfc822 format available.

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

From: Jonathan Nieder <jrnieder@gmail.com>
To: Francesco Poli <invernomuto@paranoici.org>
Cc: 626937@bugs.debian.org
Subject: Re: apt-listbugs: E: private method `chomp!' called for nil:NilClass
Date: Mon, 16 May 2011 17:18:20 -0500
[Message part 1 (text/plain, inline)]
tags 626937 + unreproducible
quit

Hi Francesco,

Thanks for your reply.

Francesco Poli wrote:

> Please note that Cupt is not really fully tested with apt-listbugs (at
> least as far as I know)

I've been using apt-listbugs with cupt on amd64 for a while, for what
it's worth.

> Please try to reproduce the bug outside of the package manager.
> For instance, does apt-listbugs work for you if you just issue the
> following command?

apt-listbugs list <package> worked okay for me when I tried it in the
course of investigation.

The bad news: before receiving your reply, I uninstalled apt-listbugs,
ran "cupt dist-upgrade", and reinstalled apt-listbugs, and now the
problem doesn't happen anymore.  I think it must have had something to
do with the particular wheezy -> experimental upgrade that was being
proposed[1].

> I can try to reproduce the bug on a sid chroot (on amd64) with Cupt,
> but unfortunately I don't have any armel system where I can investigate
> a possible architecture-specific bug.

I doubt it is architecture-specific, unless there is some assumption
of signed char somewhere or something like that.  This is an
interpreted language and it wasn't a segfault. :)  To reproduce the
slow way (I don't encourage this --- it's just for illustration):

 1. unset MALLOC_PERTURB_, to avoid running afoul of Bug#626875.
 2. Follow the instructions from that bug log to get a wheezy
    image.  Or just grab Aurélien's squeeze image from
    http://people.debian.org/~aurel32/qemu/armel/ and upgrade it.
 3. Install apt-listbugs and cupt.
 4. Put sid and experimental in sources.list.  Put

	APT::Default-Release "experimental";
	cupt::worker::defer-triggers "1";

    in a file in /etc/apt/apt.conf.d/.
 5. Run "cupt update".
 6. Run "cupt full-upgrade".

> Anyway, I am afraid you'll have to wait some time, since I am quite
> busy in these days.
> Sorry...   :-(

I don't mind; just thought the report might be useful to someone.
Sorry, I should have used btrfs and taken a snapshot before upgrading.
Next time.

http://ruby-doc.org/core/classes/String.html tells me:

| String objects may be created using String::new or as literals.
|
| Because of aliasing issues, users of strings should be aware of the
| methods that modify the contents of a String object. Typically,
| methods with names ending in ``!’’ modify their receiver, while those
| without a ``!’’ return a new String. However, there are exceptions,
| such as String#[]=.

I wonder if apt-listbugs/logic.rb, line 770 should not be

	pkgnames[index] = pkgnames[index].chomp

and similarly for "if line != nil" on line 1169?  Though that wouldn't
affect this bug.

pkgnames gets populated by adding entries of the form

	filename = line.split(" ")[4]

after apt-listbugs sees a blank line.  If there are 4 or fewer fields
on such a line then filename will be nil.  Perhaps cupt mentioned a
package it was going to remove or trigger in a nonstandard way.

Is the apt VERSION 2 hook interface documented anywhere?  I tried
"man apt" and "man apt.conf" but no luck so far.

Thanks for your thoughtfulness,
Jonathan

[1] Judging from dpkg.log, that looks like

 bsdutils	1:2.17.2-9.1 → 1:2.19.1-1
 debianutils	3.4.4 → 3.4.5
 libreadline6	6.1-3 → 6.2-1
 zlib1g	1:1.2.3.4.dfsg-3 → 1:1.2.5.dfsg-1
 libk5crypto3	1.9+dfsg-1+b1 → 1.9+dfsg-1+moonshot1
 initramfs-tools	0.98.8 → 0.99
 liblzma2	5.0.0-2 → 5.1.0alpha+20110206-1
 libgnutls26	2.10.5-1+b1 → 2.12.5-1
 libgcrypt11	1.4.6-5 → 1.5.0~beta1-1
 busybox	1:1.17.1-10 → 1:1.18.4-2
 sysvinit	2.88dsf-13.2 → 2.88dsf-13.5
 libdb5.1	5.1.25-1 → 5.1.25-10
 readline-common	6.1-3 → 6.2-1
 libss2	1.41.12-4 → 1.41.14-1
 sysv-rc	2.88dsf-13.2 → 2.88dsf-13.5
 dash	0.5.5.1-7.4 → 0.5.6.1-1~exp2
 libcomerr2	1.41.12-4 → 1.41.14-1
 linux-image-2.6-versatile	2.6.38+33 → 2.6.38+34
 grep	2.6.3-3 → 2.7-2
 libuuid1	2.17.2-9.1 → 2.19.1-1
 libblkid1	2.17.2-9.1 → 2.19.1-1
 gcc-4.4-base	4.4.6-2 → 4.4.6-3
 xkb-data	2.1-2 → 2.2.1-1
 findutils	4.4.2-1+b1 → 4.5.10-1
 traceroute	1:2.0.15-1 → 1:2.0.17-1
 installation-report	2.44 → 2.45
 sysvinit-utils	2.88dsf-13.2 → 2.88dsf-13.5
 mount	2.17.2-9.1 → 2.19.1-1
 libboost-iostreams1.46.1	1.46.1-4 → 1.46.1-5
 perl	<none> → 5.12.3-6
 perl-modules	<none> → 5.12.3-6
 xz-utils	5.0.0-2 → 5.1.0alpha+20110206-1
 util-linux	2.17.2-9.1 → 2.19.1-1
 libudev	167-3 → 168-2
 udev	167-3 → 168-2
 e2fslibs	1.14.12-4 → 1.41.14-1
 e2fsprogs	1.14.12-4 → 1.41.14-1
 console-terminus	4.30-2 → <none>
 console-setup-linux	<none> → 1.73
 console-setup	1.70 → 1.73
 keyboard-configuration	1.70 → 1.73
 libswitch-perl	<none> → 2.16-1
 libclass-isa-perl	<none> → 0.36-1
 libpod-plainer-perl	<none> → 1.03-1
 libkrb5support0	1.9+dfsg-1+b1 → 1.9+dfsg-1+moonshot1
 libkrb5-3	1.9+dfsg-1+b1 → 1.9+dfsg-1+moonshot1
 libgssapi-krb5-2	1.9+dfsg-1+b1 → 1.9+dfsg-1+moonshot1
 gcc-4.6-base	4.6.0-2 → 4.6.0-7
 libstdc++6	4.6.0-2 → 4.6.0-7
 libgcc1	1:4.6.0-2 → 1:4.6.0-7
 tasksel	2.89 → 3.01
 tasksel-data	2.89 → 3.01

dpkg.log attached.
[dpkg.log.xz (application/octet-stream, attachment)]

Added tag(s) unreproducible. Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Mon, 16 May 2011 22:21:12 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Francesco Poli (wintermute) <invernomuto@paranoici.org>:
Bug#626937; Package apt-listbugs. (Tue, 17 May 2011 23:09:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Francesco Poli <invernomuto@paranoici.org>:
Extra info received and forwarded to list. Copy sent to Francesco Poli (wintermute) <invernomuto@paranoici.org>. (Tue, 17 May 2011 23:09:03 GMT) Full text and rfc822 format available.

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

From: Francesco Poli <invernomuto@paranoici.org>
To: Jonathan Nieder <jrnieder@gmail.com>, 626937@bugs.debian.org
Subject: Re: Bug#626937: apt-listbugs: E: private method `chomp!' called for nil:NilClass
Date: Wed, 18 May 2011 00:41:20 +0200
[Message part 1 (text/plain, inline)]
On Mon, 16 May 2011 17:18:20 -0500 Jonathan Nieder wrote:

> tags 626937 + unreproducible
> quit
> 
> Hi Francesco,
> 
> Thanks for your reply.

You're welcome!

> 
> Francesco Poli wrote:
> 
> > Please note that Cupt is not really fully tested with apt-listbugs (at
> > least as far as I know)
> 
> I've been using apt-listbugs with cupt on amd64 for a while, for what
> it's worth.

Good to know...  :-)

> 
> > Please try to reproduce the bug outside of the package manager.
> > For instance, does apt-listbugs work for you if you just issue the
> > following command?
> 
> apt-listbugs list <package> worked okay for me when I tried it in the
> course of investigation.

OK, so apt-listbugs is not completely broken on your qemu-emulated
system...

> 
> The bad news: before receiving your reply, I uninstalled apt-listbugs,
> ran "cupt dist-upgrade", and reinstalled apt-listbugs, and now the
> problem doesn't happen anymore.  I think it must have had something to
> do with the particular wheezy -> experimental upgrade that was being
> proposed[1].

Can you downgrade the packages to their original versions and perform
that upgrade again?
That could be a not too slow way to reproduce the bug, I think.

> 
> > I can try to reproduce the bug on a sid chroot (on amd64) with Cupt,
> > but unfortunately I don't have any armel system where I can investigate
> > a possible architecture-specific bug.
> 
> I doubt it is architecture-specific, unless there is some assumption
> of signed char somewhere or something like that.  This is an
> interpreted language and it wasn't a segfault. :)  To reproduce the
> slow way (I don't encourage this --- it's just for illustration):
[...]
> I wonder if apt-listbugs/logic.rb, line 770 should not be
> 
> 	pkgnames[index] = pkgnames[index].chomp
> 
> and similarly for "if line != nil" on line 1169?  Though that wouldn't
> affect this bug.

/usr/share/apt-listbugs/apt-listbugs/logic.rb:770 is

        pkgnames[index].chomp!

Maybe it should be replaced with

        if pkgnames[index] != nil
          pkgnames[index].chomp!
        end

or perhaps the "end" should be put after line 782:

        pkgs[f["package"]] = f


It would be very nice of you if you could try to reproduce again the
bug in your qeme-emulated armel system, then modify
/usr/share/apt-listbugs/apt-listbugs/logic.rb
as suggested above (both possible strategies) and check whether the
issue goes away.

I don't know if this is enough to fix the bug, but it should do no
harm: at the end of the day, we cannot invoke the `chomp!' method for a
nil object, and there's no point in attempting to chomp a nil object
anyway...

> 
> pkgnames gets populated by adding entries of the form
> 
> 	filename = line.split(" ")[4]
> 
> after apt-listbugs sees a blank line.  If there are 4 or fewer fields
> on such a line then filename will be nil.  Perhaps cupt mentioned a
> package it was going to remove or trigger in a nonstandard way.

It would useful to see what Cupt sent to apt-listbugs.
If you manage to reproduce the bug, could you please attempt to run the
same upgrade with something like

  DPkg::Pre-Install-Pkgs {"/bin/cat - > /tmp/log";};
  DPkg::Tools::Options::/bin/cat "";
  DPkg::Tools::Options::/bin/cat::Version "2";
  DPkg::Pre-Install-Pkgs {"/usr/sbin/apt-listbugs apt || exit 10";};
  DPkg::Tools::Options::/usr/sbin/apt-listbugs "";
  DPkg::Tools::Options::/usr/sbin/apt-listbugs::Version "2";

in your /etc/apt/apt.conf.d/10apt-listbugs ?

*Big warning*: I haven't tested if the above does what I think it
does...   ;-)

> 
> Is the apt VERSION 2 hook interface documented anywhere?  I tried
> "man apt" and "man apt.conf" but no luck so far.

I don't know: it's something I am not (yet) familiar with, even though
it would be useful to an apt-listbugs maintainer like me...   :-(

> 
> Thanks for your thoughtfulness,

Thanks to you for your help in investigating the issue.


-- 
 http://www.inventati.org/frx/frx-gpg-key-transition-2010.txt
 New GnuPG key, see the transition document!
..................................................... Francesco Poli .
 GnuPG key fpr == CA01 1147 9CD2 EFDF FB82  3925 3E1C 27E1 1F69 BFFE
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Francesco Poli (wintermute) <invernomuto@paranoici.org>:
Bug#626937; Package apt-listbugs. (Wed, 18 May 2011 14:36:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan Nieder <jrnieder@gmail.com>:
Extra info received and forwarded to list. Copy sent to Francesco Poli (wintermute) <invernomuto@paranoici.org>. (Wed, 18 May 2011 14:36:07 GMT) Full text and rfc822 format available.

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

From: Jonathan Nieder <jrnieder@gmail.com>
To: Francesco Poli <invernomuto@paranoici.org>
Cc: 626937@bugs.debian.org
Subject: apt-listchanges et al: please document VERSION 2 hook interface (Re: apt-listbugs: E: private method `chomp!' called for nil:NilClass)
Date: Wed, 18 May 2011 09:33:33 -0500
clone 626937 -1
tags -1 =
# documentation
severity -1 minor
reassign -1 apt,apt-listchanges,apt-listbugs,cupt
retitle -1 apt-listchanges et al: please document VERSION 2 hook interface
block 626937 by -1
quit
(bcc: affected packages)

Francesco Poli wrote:

> I don't know: it's something I am not (yet) familiar with, even though
> it would be useful to an apt-listbugs maintainer like me...   :-(

So, cupt::cpp/lib/src/internal/worker/packages.cpp says

| string PackagesWorker::__generate_input_for_preinstall_v2_hooks(
|		const vector< InnerActionGroup >& actionGroups)
| {
|	// all hate undocumented formats...
|	string result = "VERSION 2\n";
[...]

Yeah!  Maybe someone would like to document it?  Cloning and blocking.

I can work on this if a tuit comes soon enough.  Advice and pointers
welcome.




Bug 626937 cloned as bug 627188. Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Wed, 18 May 2011 14:36:07 GMT) Full text and rfc822 format available.

Removed tag(s) unreproducible. Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Wed, 18 May 2011 14:36:10 GMT) Full text and rfc822 format available.

Severity set to 'minor' from 'important' Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Wed, 18 May 2011 14:36:10 GMT) Full text and rfc822 format available.

Bug reassigned from package 'apt-listbugs' to 'apt,apt-listchanges,apt-listbugs,cupt'. Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Wed, 18 May 2011 14:36:11 GMT) Full text and rfc822 format available.

Bug No longer marked as found in versions apt-listbugs/0.1.4. Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Wed, 18 May 2011 14:36:12 GMT) Full text and rfc822 format available.

Changed Bug title to 'apt-listchanges et al: please document VERSION 2 hook interface' from 'apt-listbugs: E: private method `chomp!' called for nil:NilClass' Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Wed, 18 May 2011 14:36:12 GMT) Full text and rfc822 format available.

Added indication that bug 627188 blocks 626937 Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Wed, 18 May 2011 14:36:14 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, APT Development Team <deity@lists.debian.org>, Pierre Habouzit <madcoder@debian.org>, Francesco Poli (wintermute) <invernomuto@paranoici.org>, Eugene V. Lyubimkin <jackyf@debian.org>:
Bug#627188; Package apt,apt-listchanges,apt-listbugs,cupt. (Wed, 18 May 2011 14:57:08 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan Nieder <jrnieder@gmail.com>:
Extra info received and forwarded to list. Copy sent to APT Development Team <deity@lists.debian.org>, Pierre Habouzit <madcoder@debian.org>, Francesco Poli (wintermute) <invernomuto@paranoici.org>, Eugene V. Lyubimkin <jackyf@debian.org>. (Wed, 18 May 2011 14:57:08 GMT) Full text and rfc822 format available.

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

From: Jonathan Nieder <jrnieder@gmail.com>
To: Pierre Habouzit <madcoder@madism.org>
Cc: Francesco Poli <invernomuto@paranoici.org>, 627188@bugs.debian.org
Subject: Re: apt-listchanges et al: please document VERSION 2 hook interface
Date: Wed, 18 May 2011 09:52:21 -0500
reassign 627188 apt
quit

Pierre Habouzit wrote:

> Huh, how come this is up to apt-listchanges to document an *APT*
> interface!?

Hm, I didn't know who invented it.  Reassigning to apt.  Sorry for
the noise.




Information forwarded to debian-bugs-dist@lists.debian.org, APT Development Team <deity@lists.debian.org>, Pierre Habouzit <madcoder@debian.org>, Francesco Poli (wintermute) <invernomuto@paranoici.org>, Eugene V. Lyubimkin <jackyf@debian.org>:
Bug#627188; Package apt,apt-listchanges,apt-listbugs,cupt. (Wed, 18 May 2011 14:57:10 GMT) Full text and rfc822 format available.

Acknowledgement sent to Pierre Habouzit <madcoder@madism.org>:
Extra info received and forwarded to list. Copy sent to APT Development Team <deity@lists.debian.org>, Pierre Habouzit <madcoder@debian.org>, Francesco Poli (wintermute) <invernomuto@paranoici.org>, Eugene V. Lyubimkin <jackyf@debian.org>. (Wed, 18 May 2011 14:57:10 GMT) Full text and rfc822 format available.

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

From: Pierre Habouzit <madcoder@madism.org>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: Francesco Poli <invernomuto@paranoici.org>, 627188@bugs.debian.org
Subject: Re: apt-listchanges et al: please document VERSION 2 hook interface
Date: Wed, 18 May 2011 16:56:26 +0200
On Wed, May 18, 2011 at 09:52:21AM -0500, Jonathan Nieder wrote:
> reassign 627188 apt
> quit
>
> Pierre Habouzit wrote:
>
> > Huh, how come this is up to apt-listchanges to document an *APT*
> > interface!?
>
> Hm, I didn't know who invented it.  Reassigning to apt.  Sorry for
> the noise.

This is an interface that you can set-up using things like:

    DPkg::Pre-Install-Pkgs { "/usr/bin/apt-listchanges --apt || test $? -ne 10"; };
    DPkg::Tools::Options::/usr/bin/apt-listchanges::Version "2";

You have an explanation in apt.conf(5):

HOW APT CALLS DPKG
       Several configuration directives control how APT invokes dpkg(1). These
       are in the DPkg section.

[...]
       Pre-Install-Pkgs
           This is a list of shell commands to run before invoking dpkg. Like
           options this must be specified in list notation. The commands are
           invoked in order using /bin/sh, should any fail APT will abort. APT
           will pass to the commands on standard input the filenames of all
           .deb files it is going to install, one per line.

           Version 2 of this protocol dumps more information, including the
           protocol version, the APT configuration space and the packages,
           files and versions being changed. Version 2 is enabled by setting
           DPkg::Tools::options::cmd::Version to 2.  cmd is a command given to
           Pre-Install-Pkgs.
[...]

--
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org




Bug reassigned from package 'apt,apt-listchanges,apt-listbugs,cupt' to 'apt'. Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Wed, 18 May 2011 14:57:12 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, APT Development Team <deity@lists.debian.org>:
Bug#627188; Package apt. (Wed, 18 May 2011 15:24:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan Nieder <jrnieder@gmail.com>:
Extra info received and forwarded to list. Copy sent to APT Development Team <deity@lists.debian.org>. (Wed, 18 May 2011 15:24:03 GMT) Full text and rfc822 format available.

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

From: Jonathan Nieder <jrnieder@gmail.com>
To: Pierre Habouzit <madcoder@madism.org>
Cc: Francesco Poli <invernomuto@paranoici.org>, 627188@bugs.debian.org
Subject: Re: apt-listchanges et al: please document VERSION 2 hook interface
Date: Wed, 18 May 2011 10:20:46 -0500
Pierre Habouzit wrote:

> This is an interface that you can set-up using things like:
>
>     DPkg::Pre-Install-Pkgs { "/usr/bin/apt-listchanges --apt || test $? -ne 10"; };
>     DPkg::Tools::Options::/usr/bin/apt-listchanges::Version "2";

Yes, I know.

> You have an explanation in apt.conf(5):

Which unfortunately does not explain the format that apt and cupt use
to generate the input, nor the format that apt-listchanges and
apt-listchanges expect to read.  Hence this bug report.

Thanks for a reminder of the existing documentation, though.  That
does look like a good place to put the list of fields.

Regards,
Jonathan




Information forwarded to debian-bugs-dist@lists.debian.org, APT Development Team <deity@lists.debian.org>:
Bug#627188; Package apt. (Wed, 18 May 2011 16:09:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan Nieder <jrnieder@gmail.com>:
Extra info received and forwarded to list. Copy sent to APT Development Team <deity@lists.debian.org>. (Wed, 18 May 2011 16:09:03 GMT) Full text and rfc822 format available.

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

From: Jonathan Nieder <jrnieder@gmail.com>
To: Pierre Habouzit <madcoder@madism.org>
Cc: Francesco Poli <invernomuto@paranoici.org>, 627188@bugs.debian.org
Subject: Re: apt-listchanges et al: please document VERSION 2 hook interface
Date: Wed, 18 May 2011 11:04:59 -0500
Pierre Habouzit wrote:

> This is an interface that you can set-up using things like:
>
>     DPkg::Pre-Install-Pkgs { "/usr/bin/apt-listchanges --apt || test $? -ne 10"; };
>     DPkg::Tools::Options::/usr/bin/apt-listchanges::Version "2";
>
> You have an explanation in apt.conf(5):

Thanks again.  Here's a rough first draft.  Hopefully it is possible
to say this more concisely or find a better place for it; I'll be
thinking more.
---
 doc/apt.conf.5.xml |   27 +++++++++++++++++++++++----
 1 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/doc/apt.conf.5.xml b/doc/apt.conf.5.xml
index f00baac..a997935 100644
--- a/doc/apt.conf.5.xml
+++ b/doc/apt.conf.5.xml
@@ -598,11 +598,30 @@ DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";};
      will abort. APT will pass to the commands on standard input the 
      filenames of all .deb files it is going to install, one per line.</para>
 
-     <para>Version 2 of this protocol dumps more information, including the 
-     protocol version, the APT configuration space and the packages, files
-     and versions being changed. Version 2 is enabled by setting 
+     <para>Version 2 of this protocol sends more information through the standard
+     input for each comment: a line with the text <literal>VERSION 2</literal>,
+     the APT configuration space, and a list of package actions with filename
+     and version information.  Version 2 is enabled by setting
      <literal>DPkg::Tools::options::cmd::Version</literal> to 2. <literal>cmd</literal> is a
-     command given to <literal>Pre-Install-Pkgs</literal>.</para></listitem>
+     command given to <literal>Pre-Install-Pkgs</literal>.</para>
+
+     <para>Each configuration directive line has the form
+     <literal>key=value</literal>.  Special characters (equal signs, newlines,
+     nonprintable characters, quotation marks, and percent signs in
+     <literal>key</literal> and newlines, nonprintable characters, and percent
+     signs in <literal>value</literal>) are %-encoded. Lists are represented
+     by multiple <literal>key::=value</literal> lines with the same key. The
+     configuration section ends with a blank line.</para>
+
+     <para>Package action lines consist of five fields: old version, direction
+     of version change (&lt; for upgrades, &gt; for downgrades, = for no
+     change), new version, action. The version fields are "-" for no version
+     at all (for example when installing a package for the first time; no
+     version is treated as earlier than any real version, so that is an
+     upgrade, indicated as <literal>- &lt; 1.23.4</literal>). The action field
+     is "**CONFIGURE**" if the package is being configured, "**REMOVE**" if it
+     is being removed, or the filename of a .deb file if it is being
+     unpacked.</para></listitem>
      </varlistentry>
 
      <varlistentry><term>Run-Directory</term>
-- 
1.7.5.1





Removed indication that bug 627188 blocks 626937 Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Wed, 18 May 2011 16:57:05 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, APT Development Team <deity@lists.debian.org>:
Bug#627188; Package apt. (Sun, 15 Jul 2012 17:39:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan Nieder <jrnieder@gmail.com>:
Extra info received and forwarded to list. Copy sent to APT Development Team <deity@lists.debian.org>. (Sun, 15 Jul 2012 17:39:03 GMT) Full text and rfc822 format available.

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

From: Jonathan Nieder <jrnieder@gmail.com>
To: 627188@bugs.debian.org
Cc: apt-listchanges@packages.debian.org, apt-listbugs@packages.debian.org, cupt@packages.debian.org
Subject: Re: apt: please document VERSION 2 hook interface
Date: Sun, 15 Jul 2012 12:37:48 -0500
tags 627188 + patch
quit

Jonathan Nieder wrote:

>                Here's a rough first draft.  Hopefully it is possible
> to say this more concisely or find a better place for it; I'll be
> thinking more.

Hi again.  Through a year of careful thought, I've deciding the
wording and placement are perfect.  Therefore I'm tagging this as a
patch to consider for application.  Improvements are of course
welcome, though.  Patch left unsnipped for reference.

Thanks,
Jonathan

> ---
>  doc/apt.conf.5.xml |   27 +++++++++++++++++++++++----
>  1 files changed, 23 insertions(+), 4 deletions(-)
> 
> diff --git a/doc/apt.conf.5.xml b/doc/apt.conf.5.xml
> index f00baac..a997935 100644
> --- a/doc/apt.conf.5.xml
> +++ b/doc/apt.conf.5.xml
> @@ -598,11 +598,30 @@ DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";};
>       will abort. APT will pass to the commands on standard input the 
>       filenames of all .deb files it is going to install, one per line.</para>
>  
> -     <para>Version 2 of this protocol dumps more information, including the 
> -     protocol version, the APT configuration space and the packages, files
> -     and versions being changed. Version 2 is enabled by setting 
> +     <para>Version 2 of this protocol sends more information through the standard
> +     input for each comment: a line with the text <literal>VERSION 2</literal>,
> +     the APT configuration space, and a list of package actions with filename
> +     and version information.  Version 2 is enabled by setting
>       <literal>DPkg::Tools::options::cmd::Version</literal> to 2. <literal>cmd</literal> is a
> -     command given to <literal>Pre-Install-Pkgs</literal>.</para></listitem>
> +     command given to <literal>Pre-Install-Pkgs</literal>.</para>
> +
> +     <para>Each configuration directive line has the form
> +     <literal>key=value</literal>.  Special characters (equal signs, newlines,
> +     nonprintable characters, quotation marks, and percent signs in
> +     <literal>key</literal> and newlines, nonprintable characters, and percent
> +     signs in <literal>value</literal>) are %-encoded. Lists are represented
> +     by multiple <literal>key::=value</literal> lines with the same key. The
> +     configuration section ends with a blank line.</para>
> +
> +     <para>Package action lines consist of five fields: old version, direction
> +     of version change (&lt; for upgrades, &gt; for downgrades, = for no
> +     change), new version, action. The version fields are "-" for no version
> +     at all (for example when installing a package for the first time; no
> +     version is treated as earlier than any real version, so that is an
> +     upgrade, indicated as <literal>- &lt; 1.23.4</literal>). The action field
> +     is "**CONFIGURE**" if the package is being configured, "**REMOVE**" if it
> +     is being removed, or the filename of a .deb file if it is being
> +     unpacked.</para></listitem>
>       </varlistentry>
>  
>       <varlistentry><term>Run-Directory</term>
> -- 
> 1.7.5.1
>



Added tag(s) patch. Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Sun, 15 Jul 2012 17:39:07 GMT) Full text and rfc822 format available.

Marked as found in versions apt/0.9.7.1. Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Sun, 15 Jul 2012 17:42:08 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: Wed Apr 16 19:04:45 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.