[Trisquel-devel] Brigantia (and previous versions): Update Manager does not show changelogs and raises an unhandled exception.

Andrzej P andrzej at morgangilbert.co.uk
Wed Mar 7 16:24:24 CET 2012


I have not seen any changelogs in Update Manager for a long time now.
It seems that the changelogs in the
'http://packages.trisquel.info/changelogs/pool/' hierarchy are not
synchronised with the packages in the archive.  This is unfortunate
but also exposes a bug in the 'make-update-manager' Trisquel helper
script.  This bug predates Brigantia.

To reproduce:

Install a package that has a later version in the 'brigantia' or
'brigantia-updates' suites but does not have a corresponding changelog
entry in the 'http://packages.trisquel.info/changelogs/pool/'
hierarchy.  For example 'libreoffice-dev-doc' has 3.4.4-0ubntu1 in the
archive but the last changelog is for 3.3.4-0ubuntu1[1] (this package
is a convenient example since its installation has little effect on
the default install):

$ sudo aptitude -t brigantia install libreoffice-dev-doc

$ update-manager

The Update Manager window appears.  I click "Check" and am informed
that there is a new 'libreoffice-dev-doc' update available.  I expand
the "Description of update" pane at the bottom of the window.  It says
"Downloading list of changes..." (but is lying.  It is not downloading
anything).  It just sits like that.

On stderr I see the following:

Unhandled exception in thread started by <bound method 
MyCache.get_news_and_changelog of <UpdateManager.Core.MyCache.MyCache 
object at 0x9b3836c>>
Traceback (most recent call last):
   File 
"/usr/lib/python2.7/dist-packages/UpdateManager/Core/MyCache.py", line 
265, in get_news_and_changelog
     self.get_changelog(name)
   File 
"/usr/lib/python2.7/dist-packages/UpdateManager/Core/MyCache.py", line 
321, in get_changelog
     "later.") % (srcpkg, srcver_epoch)
TypeError: not all arguments converted during string formatting


The problem is that in the upstream Update Manager, line 321 of
'/usr/lib/python2.7/dist-packages/UpdateManager/Core/MyCache.py'[2]
uses the Python string formatting operator, % [3], to create the URL
of the relevant changelog on Launchpad.  The 'make-update-manager'
script replaces the URL (for which the conversion specifiers no longer
make sense) but _keeps the string formatting operator and replacement
values_.  This causes an exception and prevents the message from ever
being displayed.  Line 316 has exactly the same problem (I think this
code runs when there is a corresponding changelog but it is empty).  So
these things ought to be removed.

I attach a diff against the source package to illustrate what I mean
but I'm unclear as to what sed-fu needs to be done in the helper
script to make this change in a maintainable, Trisquel-esque way.

When the changes are made, behaviour is as expected.  The message is
displayed and stderr remains silent.

[1]
<http://packages.trisquel.info/changelogs/pool/main/libr/libreoffice/>
[2]
<https://bazaar.launchpad.net/~ubuntu-branches/ubuntu/oneiric/update-manager/oneiric/view/head:/UpdateManager/Core/MyCache.py>
[3] <http://docs.python.org/library/stdtypes.html#string-formatting>
-- 
Andrzej P
-------------- next part --------------
A non-text attachment was scrubbed...
Name: update-manager-fix.diff
Type: text/x-patch
Size: 1298 bytes
Desc: not available
URL: <http://listas.trisquel.info/pipermail/trisquel-devel/attachments/20120307/bb6c88df/attachment.bin>


More information about the Trisquel-devel mailing list