gdebi --root doesn't use the apt config from the chroot but the one from the "host"

Bug #243550 reported by Michael Bienia
2
Affects Status Importance Assigned to Milestone
python-apt (Ubuntu)
Fix Released
Medium
Michael Vogt

Bug Description

Binary package hint: gdebi

I was looking why pbuilder-satisfydepends-gdebi tried to install recommends inside my pbuilder even if I've setup apt to not install recommends.
It turned out that it was because gdebi is called from outside the pbuilder chroot and only give the path to it (--root) but it didn't took the apt config from the chroot but the one from outside. After setting up apt (in the base system) to not install recommends to, gdebi didn't listed them anymore.

From outside the pbuilder (before configuring apt to not install recommends in the base system):
$ gdebi --quiet --root /var/cache/pbuilder/build/1318 --apt-line libgnupg-interface-perl_0.36-1.dsc
libdigest-sha1-perl debhelper curl bsdmainutils libio-compress-base-perl gettext libcurl3 liburi-perl libsys-hostname-long-perl libdigest-hmac-perl libobject-realize-later-perl libuser-identity-perl libcompress-raw-zlib-perl libio-compress-zlib-perl libmailtools-perl libmagic1 libcompress-zlib-perl libmail-sendmail-perl file libclass-methodmaker-perl groff-base intltool-debian man-db po-debconf libfile-remove-perl libio-stringy-perl html2text libmail-box-perl gettext-base libmime-types-perl

From inside the pbuilder:
# gdebi --quiet --apt-line libgnupg-interface-perl_0.36-1.dsc
debhelper bsdmainutils gettext libmagic1 file libclass-methodmaker-perl groff-base intltool-debian man-db po-debconf html2text gettext-base

From outside the pbuilder (after configuring apt to not install recommends in the base system):
$ gdebi --quiet --root /var/cache/pbuilder/build/1318 --apt-line libgnupg-interface-perl_0.36-1.dsc
debhelper bsdmainutils gettext libmagic1 file libclass-methodmaker-perl groff-base intltool-debian man-db po-debconf html2text gettext-base

Michael Vogt (mvo)
Changed in gdebi:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for your bugreport.

If you have a test environment, could you please test the following patch against python-apt?

=== modified file 'apt/cache.py'
--- apt/cache.py 2009-01-12 17:28:18 +0000
+++ apt/cache.py 2009-01-23 08:55:54 +0000
@@ -55,6 +55,7 @@
             apt_pkg.Config.Set("Dir", rootdir)
             apt_pkg.Config.Set("Dir::State::status",
                                rootdir + "/var/lib/dpkg/status")
+ apt_pkg.InitConfig()
         self.open(progress)

     def _runCallbacks(self, name):

I'm pretty sure thats the issue

Changed in gdebi:
assignee: nobody → mvo
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-apt - 0.7.9~exp2ubuntu4

---------------
python-apt (0.7.9~exp2ubuntu4) jaunty; urgency=low

  * apt/cache.py:
    - when running with the rootdir option, run
      InitConfig() again to ensure that the config
      from the rootdir is read, not from the host
      (lp: #243550)
  * apt/package.py:
    - make sure to set the defaulttimeout back to the
      original value (in getChangelog(), LP: #314212)

 -- Michael Vogt <email address hidden> Mon, 26 Jan 2009 08:45:00 +0100

Changed in python-apt:
status: In Progress → Fix Released
Michael Vogt (mvo)
Changed in python-apt:
status: Fix Released → Triaged
Revision history for this message
Michael Bienia (geser) wrote :

I've tested the patch on Intrepid and it doesn't work.

Here are the results with a patched /usr/lib/python2.5/site-packages/apt/cache.py:

With installing Recommends disabled in the host system:
$ gdebi --quiet --root /var/cache/pbuilder/build/24283/ --apt-line libgnupg-interface-perl_0.36-1ubuntu1.dsc
debhelper bsdmainutils gettext libmagic1 file libclass-methodmaker-perl groff-base intltool-debian man-db po-debconf html2text gettext-base

Now with installing Recommends enabled:
$ gdebi --quiet --root /var/cache/pbuilder/build/24283/ --apt-line libgnupg-interface-perl_0.36-1ubuntu1.dsc
debhelper curl bsdmainutils libio-compress-base-perl gettext libcurl3 libsys-hostname-long-perl libcompress-raw-zlib-perl libio-compress-zlib-perl libmagic1 libcompress-zlib-perl libmail-sendmail-perl file libclass-methodmaker-perl groff-base intltool-debian man-db po-debconf html2text gettext-base

(Installing Recommends is disabled inside the pbuilder).

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-apt - 0.7.9~exp2ubuntu7

---------------
python-apt (0.7.9~exp2ubuntu7) jaunty; urgency=low

  * apt/package.py:
    - add "not_automatic" flag to the origin
  * debian/control:
    - rebuild against latest apt
  * apt/cache.py:
    - when setting a alternative rootdir, read the
      config from it as well (LP: #243550)
  * python/configuration.cc, python/apt_pkgmodule.cc:
    - add apt_pkg.ReadConfigDir()

 -- Michael Vogt <email address hidden> Mon, 09 Feb 2009 15:09:17 +0100

Changed in python-apt:
status: Triaged → Fix Released
Revision history for this message
Michael Bienia (geser) wrote :

I can confirm that the bug is now fixed in the last python-apt version.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.