[Piuparts-devel] Bug#718544: Bug#718544: reports packages installed when they weren't

Julien Cristau julien.cristau at logilab.fr
Wed Dec 18 15:03:14 UTC 2013


On Fri, Aug  2, 2013 at 07:58:27 +0200, Andreas Beckmann wrote:

> On 2013-08-02 07:13, Brian May wrote:
> > Package: piuparts
> > Version: 0.45
> 
> Please use a current version.
> 
> > However piuparts concludes that everything was installed:
> > 
> > 8m3.4s INFO: Installation of ['tmp/python-django-filters_0.6-2_all.deb',
> > 'tmp/python-django-filters-doc_0.6-2_all.deb',
> > 'tmp/django-filter_0.6-2_all.deb',
> > 'tmp/python-django-filter_0.6-2_all.deb'] ok
> > 
> > Which is wrong, only python-django-filters-doc was installed.
> 
> Passing multiple .debs on the command line is not working as well as you
> might expect, especially if they have dependencies ...
> 
This bug doesn't seem to have much to do with passing multiple debs,
it's just that nothing checks the installation status of the packages
after apt-get -yf install.  The following seems to work for me:

diff --git a/piuparts.py b/piuparts.py
index 9134924..4d357ea 100644
--- a/piuparts.py
+++ b/piuparts.py
@@ -1202,6 +1202,13 @@ class Chroot:
                 self.run(["dpkg", "-i"] + tmp_files, ignore_errors=True)
                 self.run(apt_get_install)
 
+            retcode, output = self.run(["dpkg-query", "-f", "${Package} ${Status}\n", "-W"] + [os.path.basename(f).split('_')[0] for f in package_files])
+            for line in output.splitlines():
+                pkg, desired, whatever, status = line.split()
+                if status != 'installed':
+                    logging.error("Installation of %s failed", pkg)
+                    panic()
+
             logging.info ("Installation of %s ok", tmp_files)
 
             if with_scripts:


Cheers,
Julien
-- 
Julien Cristau          <julien.cristau at logilab.fr>
Logilab		        http://www.logilab.fr/
Informatique scientifique & gestion de connaissances



More information about the Piuparts-devel mailing list