Your message dated Mon, 20 Aug 2012 23:32:37 +0000
with message-id <[email protected]>
and subject line Bug#678311: fixed in apt-listchanges 2.85.12~exp1
has caused the Debian Bug report #678311,
regarding apt-listchanges: debconf passthrough frontend for use with packagekit
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
678311: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=678311
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: apt-listchanges
Version: 2.85.10
Severity: normal
Tags: patch
X-Debbugs-Cc: [email protected], [email protected]

Hi,

when using packagekit, which seems to be the way gnome is going for
graphical package management nowadays, the apt-listchanges output
doesn't go anywhere, and the gpk window just seems to hang.
In order to fix that, it'd be nice if apt-listchanges could send its
output using the debconf protocol so it could show up in the packagekit
frontend.  The below patch is a proof of concept to that effect.  pk
would have to set APT_LISTCHANGES_FRONTEND=debconf for this to work (it
already sets APT_LISTBUGS_FRONTEND=none).  packagekit and debconf
maintainers cc:ed in case they have comments.

I'm not too happy about the tempfile thing instead of just using
db.subst to change the contents of the note, but I couldn't figure out
how to SUBST something with newlines (it didn't seem to work when I
tested with the dialog frontend, anyway).

Cheers,
Julien

diff --git a/apt-listchanges/apt_listchanges.py 
b/apt-listchanges/apt_listchanges.py
index 180a3dc..c5b62ac 100644
--- a/apt-listchanges/apt_listchanges.py
+++ b/apt-listchanges/apt_listchanges.py
@@ -103,6 +103,7 @@ def mail_changes(address, changes, subject):
 def make_frontend(name, packages, config):
     frontends = { 'text' : text,
                   'pager' : pager,
+                  'debconf': debconf,
                   'mail' : mail,
                   'browser' : browser,
                   'xterm-pager' : xterm_pager,
@@ -172,6 +173,50 @@ class frontend:
     def set_title(self, text):
         pass
 
+class debconf(frontend):
+    def set_title(self, text):
+        self.title = text
+
+    def display_output(self, text):
+        import socket
+        import debconf as dc
+        if 'DEBIAN_FRONTEND' not in os.environ or 
os.environ['DEBIAN_FRONTEND'] != 'passthrough':
+            return
+        sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM, 0)
+        sock.connect(os.environ['DEBCONF_PIPE'])
+        dcfd = sock.makefile()
+        sock.close()
+        db = dc.Debconf(read=dcfd, write=dcfd)
+        tmp = tempfile.NamedTemporaryFile(prefix="apt-listchanges-tmp")
+        os.fchmod(tmp.fileno(), 0644)
+        tmp.write('''Template: apt-listchanges/info
+Type: title
+Description: NEWS
+
+Template: apt-listchanges/title
+Type: title
+Description: ${title}
+
+Template: apt-listchanges/news
+Type: note
+Description: ${packages} packages''')
+        for line in text.split('\n'):
+            if line.strip():
+                tmp.write('  ' + line + '\n')
+            else:
+                tmp.write(' .\n')
+        tmp.flush()
+        db.command('x_loadtemplatefile', tmp.name)
+        tmp.close()
+        db.info('apt-listchanges/info')
+        db.subst('apt-listchanges/title', 'title', self.title)
+        db.subst('apt-listchanges/news', 'packages', self.packages)
+        db.settitle('apt-listchanges/title')
+        db.fset('apt-listchanges/news', 'seen', 'false')
+        db.input('high', 'apt-listchanges/news')
+        db.go()
+        dcfd.close()
+
 class ttyconfirm:
     def confirm(self):
         try:

Attachment: signature.asc
Description: Digital signature


--- End Message ---
--- Begin Message ---
Source: apt-listchanges
Source-Version: 2.85.12~exp1

We believe that the bug you reported is fixed in the latest version of
apt-listchanges, which is due to be installed in the Debian FTP archive.

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 [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Sandro Tosi <[email protected]> (supplier of updated apt-listchanges 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 [email protected])


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

Format: 1.8
Date: Tue, 21 Aug 2012 01:20:55 +0200
Source: apt-listchanges
Binary: apt-listchanges
Architecture: source all
Version: 2.85.12~exp1
Distribution: experimental
Urgency: low
Maintainer: Sandro Tosi <[email protected]>
Changed-By: Sandro Tosi <[email protected]>
Description: 
 apt-listchanges - package change history notification tool
Closes: 573013 678311
Changes: 
 apt-listchanges (2.85.12~exp1) experimental; urgency=low
 .
   [ Julien Cristau ]
   * [022b79c] apt-listchanges: debconf passthrough frontend for use with
     packagekit; Closes: #678311
 .
   [ Sandro Tosi ]
   * [7bbe068] don't show changes only for packages configured early; thanks to
     Zack Weinberg for the patch; Closes: #573013
Checksums-Sha1: 
 486bc1b67edc2ceeb6fba9d93b32aeed44448cf3 1135 apt-listchanges_2.85.12~exp1.dsc
 0efe709f8c83d909306787cdd8d82fae87f42285 88564 
apt-listchanges_2.85.12~exp1.tar.bz2
 3928b82a09ae331d167b0a97c467d291ba94f9ff 89522 
apt-listchanges_2.85.12~exp1_all.deb
Checksums-Sha256: 
 997099915c36269db82e84f052e3192df2b26e1202b8135b495c3364d2e08f64 1135 
apt-listchanges_2.85.12~exp1.dsc
 dcd9101233cd2534232255052e2a7573d9a8676dd6f2af4639af6e1eca8aede3 88564 
apt-listchanges_2.85.12~exp1.tar.bz2
 45427e1888dab4ebc7a65c85c04b74da01e7e85d3d2bbbe457d0df911ca6453f 89522 
apt-listchanges_2.85.12~exp1_all.deb
Files: 
 80eb0b5a7c016e2ce231bff09fd08f4a 1135 utils standard 
apt-listchanges_2.85.12~exp1.dsc
 4d6376ff4ad979e87a4e2a0c81de8490 88564 utils standard 
apt-listchanges_2.85.12~exp1.tar.bz2
 d74783820e45cd486501824c97acd6f5 89522 utils standard 
apt-listchanges_2.85.12~exp1_all.deb

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

iEYEARECAAYFAlAyx/UACgkQAukwV0RN2VD/4ACghQ+ObqWU+a7a1na0bLt9j/6B
BL0AnjsKk590tt/PZKZk6FY1fl6PVyqk
=/bsg
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to