[Piuparts-commits] [SCM] piuparts git repository branch, master, updated. 0.48-79-gdf94975

Andreas Beckmann debian at abeckmann.de
Sat Jan 12 11:33:13 UTC 2013


The following commit has been merged in the master branch:
commit 07dc6d365e654f3b4ad02925d8ca8a180812a865
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Sat Dec 1 14:14:32 2012 +0100

    p: avoid running scripts twice
    
    if dependencies are installed separately from the package by
    creating some metapackage run the custom scripts only once:
    * pre_install before installing the metapackage
    * post_install after installing the package
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/debian/changelog b/debian/changelog
index c4a79a9..c0d1c54 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,8 @@ piuparts (0.49) UNRELEASED; urgency=low
     - slave: Support pseudo-version "None".
     - piuparts: Do not try to install unavailable packages after dist-upgrade.
   * piuparts.py:
+    - Run custom scripts only once if dependencies are installed via a
+      metapackage.
   * piuparts.conf:
   * piupartslib/conf.py:
     - Add get_final_distro() method.
diff --git a/piuparts.py b/piuparts.py
index dc80d99..05f9ceb 100644
--- a/piuparts.py
+++ b/piuparts.py
@@ -2092,6 +2092,8 @@ def install_purge_test(chroot, chroot_state, package_files, packages):
     # Install packages into the chroot.
     os.environ["PIUPARTS_PHASE"] = "install"
 
+    chroot.run_scripts("pre_install")
+
     if settings.warn_on_others or settings.install_purge_install:
         # Create a metapackage with dependencies from the given packages
         if package_files:
@@ -2127,7 +2129,7 @@ def install_purge_test(chroot, chroot_state, package_files, packages):
         panic_handler_id = do_on_panic(cleanup_metapackage)
 
         # Install the metapackage
-        chroot.install_package_files([metapackage])
+        chroot.install_package_files([metapackage], with_scripts=False)
         # Now remove it
         metapackagename = os.path.basename(metapackage)[:-4]
         chroot.purge_packages([metapackagename])
@@ -2149,7 +2151,9 @@ def install_purge_test(chroot, chroot_state, package_files, packages):
     chroot.check_for_no_processes()
     chroot.check_for_broken_symlinks()
 
-    chroot.install_packages(package_files, packages)
+    chroot.install_packages(package_files, packages, with_scripts=False)
+
+    chroot.run_scripts("post_install")
 
     if settings.install_purge_install:
         file_owners = chroot.get_files_owned_by_packages()

-- 
piuparts git repository



More information about the Piuparts-commits mailing list