[Piuparts-commits] [SCM] piuparts git repository branch, master, updated. eda668423fa87898c59d1075118693714aa5a053

Holger Levsen holger at layer-acht.org
Fri Dec 23 10:25:09 UTC 2011


The following commit has been merged in the master branch:
commit 74cc5f933d699237020074edd7c3c71e6ee70f75
Author: Holger Levsen <holger at layer-acht.org>
Date:   Sun Aug 28 18:46:59 2011 +0200

    [ Stefano Rivera ]
    * piuparts.py: use eatmydata by default, add option --no-eatmydata. (This
      was discussed in #633033.)
    * debian/control: Add eatmydata to depends.

diff --git a/debian/changelog b/debian/changelog
index 1c20442..9704054 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,11 @@ piuparts (0.42) UNRELEASED; urgency=low
     are filed already.
   * debian/control: Add python-apt and python-debianbts to piuparts depends.
 
+  [ Stefano Rivera ]
+  * piuparts.py: use eatmydata by default, add option --no-eatmydata. (This
+    was discussed in #633033.)
+  * debian/control: Add eatmydata to depends.
+
  -- Holger Levsen <holger at debian.org>  Sun, 28 Aug 2011 09:50:12 +0200
 
 piuparts (0.41) unstable; urgency=low
diff --git a/debian/control b/debian/control
index 39d5d2d..7559426 100644
--- a/debian/control
+++ b/debian/control
@@ -14,7 +14,7 @@ X-Python-Version: >= 2.6
 Package: piuparts
 Architecture: all
 Depends: apt, ${python:Depends}, debootstrap, lsof, lsb-release, 
-    python-debian, ${misc:Depends}, python-debianbts, python-apt
+    python-debian, ${misc:Depends}, python-debianbts, python-apt, eatmydata
 Suggests: python-rpy, ghostscript
 Description: .deb package installation, upgrading, and removal testing tool
  piuparts tests that .deb packages (as used by Debian) handle
diff --git a/piuparts.1.txt b/piuparts.1.txt
index cc95386..dd9c6db 100644
--- a/piuparts.1.txt
+++ b/piuparts.1.txt
@@ -65,6 +65,9 @@ The tarball can be created with the '-s' option, or you can use one that *pbuild
 *--dpkg-noforce-unsafe-io*::
   Prevent running dpkg with --force-unsafe-io.  --force-unsafe-io causes dpkg to skip certain file system syncs known to cause substantial performance degradation on some filesystems.  Thus, including this option reverts to safe but slower behavior.
 
+*--no-eatmydata*::
+  Prevent use of eatmydata.
+
 *-i* 'filename', *--ignore*='filename'::
   Add a filename to the list of filenames to be ignored when comparing changes before and after installation. By default, piuparts ignores files that always change during a package installation and uninstallation, such as *dpkg* status files. The filename should be relative to the root of the chroot (e.g., _var/lib/dpkg/status_). This option can be used as many times as necessary.
 
diff --git a/piuparts.py b/piuparts.py
index 965c1f9..11ee012 100644
--- a/piuparts.py
+++ b/piuparts.py
@@ -650,7 +650,10 @@ class Chroot:
     def unpack_from_tgz(self, tarball):
         """Unpack a tarball to a chroot."""
         logging.debug("Unpacking %s into %s" % (tarball, self.name))
-        run(["tar", "-C", self.name, "-zxf", tarball])
+        prefix = []
+        if settings.eatmydata:
+            prefix.append('eatmydata')
+        run(prefix + ["tar", "-C", self.name, "-zxf", tarball])
 
     def setup_from_lvm(self, lvm_volume):
         """Create a chroot by creating an LVM snapshot."""
@@ -665,7 +668,11 @@ class Chroot:
         run(['mount', self.lvm_snapshot, self.name])
 
     def run(self, command, ignore_errors=False):
-        return run(["chroot", self.name] + command,
+        prefix = []
+        if settings.eatmydata and os.path.isfile(os.path.join(self.name,
+                                                 'usr/bin/eatmydata')):
+            prefix.append('eatmydata')
+        return run(["chroot", self.name] + prefix + command,
                    ignore_errors=ignore_errors)
 
     def create_apt_sources(self, distro):
@@ -733,8 +740,14 @@ class Chroot:
               (settings.debian_distros[0], self.name))
         if settings.do_not_verify_signatures:
           logging.info("Warning: not using --keyring option when running debootstrap!")
-        run(["debootstrap", "--variant=minbase", settings.keyringoption, settings.debian_distros[0], 
-             self.name, settings.debian_mirrors[0][0]])
+        prefix = []
+        options = [settings.keyringoption]
+        if settings.eatmydata:
+            options.append('--include=eatmydata')
+            options.append('--components=%s' % ','.join(settings.debian_mirrors[0][1]))
+            prefix.append('eatmydata')
+        run(prefix + ["debootstrap", "--variant=minbase"] + options +
+            [settings.debian_distros[0], self.name, settings.debian_mirrors[0][0]])
 
     def minimize(self):
         """Minimize a chroot by removing (almost all) unnecessary packages"""
@@ -1962,6 +1975,11 @@ def parse_command_line():
                       default="-o MaxPriority=required -o UseRecommends=no -f -n apt debfoster",
 		      help="Run debfoster with different parameters (default: -o MaxPriority=required -o UseRecommends=no -f -n apt debfoster).")
 
+    parser.add_option("--no-eatmydata",
+                      default=False,
+                      action='store_true',
+                      help="Default is to use libeatmydata in the chroot")
+
     parser.add_option("--dpkg-noforce-unsafe-io",
                       default=False,
                       action='store_true',
@@ -2161,6 +2179,7 @@ def parse_command_line():
     settings.warn_on_others = opts.warn_on_others
     settings.warn_on_leftovers_after_purge = opts.warn_on_leftovers_after_purge
     settings.debfoster_options = opts.debfoster_options.split()
+    settings.eatmydata = not opts.no_eatmydata
     settings.dpkg_force_unsafe_io = not opts.dpkg_noforce_unsafe_io
     settings.dpkg_force_confdef = opts.dpkg_force_confdef
 

-- 
piuparts git repository



More information about the Piuparts-commits mailing list