[Piuparts-devel] Bug#478577: piuparts: debfoster requires /proc/stat

Tobias Grimm tg at e-tobi.net
Tue Apr 29 20:42:09 UTC 2008


Package: piuparts
Version: 0.30
Severity: normal
Tags: patch

Recent debfoster requires access to /proc/stat, so /proc should be
mounted before using debfoster. (Please see the attached patch
piuparts-mountproc-1.diff).

Please also think about mounting /proc by default (starting in the
ctor of the Chroot class. I think it doesn't hurt.
(See piuparts-mountproc-2.diff)

Tobias

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.24-1-686 (SMP w/1 CPU core)
Locale: LANG=de_AT.UTF-8, LC_CTYPE=de_AT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages piuparts depends on:
ii  apt                        0.7.11        Advanced front-end for dpkg
ii  debootstrap                1.0.8         Bootstrap a basic Debian system
ii  lsb-release                3.1-24        Linux Standard Base version report
ii  lsof                       4.78.dfsg.1-4 List open files
ii  python                     2.4.4-6       An interactive high-level object-o
ii  python-debian              0.1.9         python modules to work with Debian

piuparts recommends no packages.

-- no debconf information
-------------- next part --------------
diff -Nur piuparts-0.30.orig/piuparts.py piuparts-mountproc-1/piuparts.py
--- piuparts-0.30.orig/piuparts.py	2008-02-15 20:04:17.000000000 +0100
+++ piuparts-mountproc-1/piuparts.py	2008-04-29 22:16:44.000000000 +0200
@@ -622,8 +622,12 @@
              return
 
         self.run(["apt-get", "install", "debfoster"])
+
+        self.mount_proc() # debfoster requires /proc/stat
         self.run(["debfoster", "-o", "MaxPriority=required", "-o",
                   "UseRecommends=no", "-f", "-n", "apt", "debfoster"])
+        self.unmount_proc()
+
         remove_files([self.relative("var/lib/debfoster/keepers")])
         self.run(["dpkg", "--purge", "debfoster"])
 
-------------- next part --------------
diff -Nur piuparts-0.30.orig/piuparts.py piuparts-mountproc-2/piuparts.py
--- piuparts-0.30.orig/piuparts.py	2008-02-15 20:04:17.000000000 +0100
+++ piuparts-mountproc-2/piuparts.py	2008-04-29 22:30:11.000000000 +0200
@@ -533,12 +533,14 @@
         if settings.basetgz:
             self.unpack_from_tgz(settings.basetgz)
             self.configure_chroot()
+            self.mount_proc()
             self.run(["apt-get", "update"])
             self.run(["apt-get", "-yf", "upgrade"])
             self.minimize()
             self.run(["apt-get", "clean"])
         else:
             self.setup_minimal_chroot()
+            self.mount_proc()
             self.run(["apt-get", "update"])
             self.run(["apt-get", "clean"])
             if settings.savetgz:
@@ -1387,7 +1389,6 @@
        chroot, with packages in states given by 'selections'."""
 
     # Install packages into the chroot.
-    chroot.mount_proc()
 
     if settings.warn_on_others:
         # Create a metapackage with dependencies from the given packages
@@ -1450,7 +1451,6 @@
     chroot.restore_selections(changes, packages)
     
     chroot.check_for_broken_symlinks()
-    chroot.unmount_proc()
 
     return check_results(chroot, root_info, file_owners, deps_info=deps_info)
 
@@ -1459,8 +1459,6 @@
     """Install package via apt-get, then upgrade from package files.
     Return True if successful, False if not."""
 
-    chroot.mount_proc()
-
     # First install via apt-get.
     chroot.install_packages_by_name(package_names)
     
@@ -1482,8 +1480,6 @@
     chroot.check_for_no_processes()
     chroot.check_for_broken_symlinks()
 
-    chroot.unmount_proc()
-
     return check_results(chroot, root_info, file_owners)
 
 
@@ -1521,9 +1517,7 @@
     if settings.endmeta:
         root_info, selections = load_meta_data(settings.endmeta)
     else:
-        chroot.mount_proc()
         chroot.upgrade_to_distros(settings.debian_distros[1:], [])
-        chroot.unmount_proc()
         chroot.run(["apt-get", "clean"])
 
         root_info = chroot.save_meta_data()
@@ -1541,8 +1535,6 @@
 
     chroot.check_for_no_processes()
     
-    chroot.mount_proc()
-
     chroot.run(["apt-get", "update"])
     chroot.install_packages_by_name(packages)
 
@@ -1565,8 +1557,6 @@
 
     chroot.check_for_no_processes()
     
-    chroot.unmount_proc()
-
     if root_tgz != settings.basetgz:
         remove_files([root_tgz])
     chroot.remove()


More information about the Piuparts-devel mailing list