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

Andreas Beckmann debian at abeckmann.de
Fri Dec 23 10:27:02 UTC 2011


The following commit has been merged in the master branch:
commit 3dd912ea87e8da82a59dbe665fbb22603aa8b968
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Sun Nov 6 17:43:59 2011 +0100

    collect pre_install_diversions at the correct time
    
    The pre_install_diversions need to be collected at the same time as
    chroot.save_meta_data() is being called, otherwise they won't match.
    
    Doing this during chroot creation (especially before post_setup_
    scripts are run) is too early - and completely wrong for distupgrade
    tests.
    
    --save-end-meta and --end-meta need to get support for diversion info.
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/TODO b/TODO
index 730b9b2..a08e157 100644
--- a/TODO
+++ b/TODO
@@ -26,6 +26,8 @@ for 0.42:
 - merge script from my svn working copy: home/piupartsm/bin/biggest_blocker.sh 
   with a similar one Dave send to the list
 
+- store and load the diversion information with --save-end-meta and --end-meta
+
 
 for 0.43:
 
diff --git a/piuparts.py b/piuparts.py
index 5d1ebb1..5e1047f 100644
--- a/piuparts.py
+++ b/piuparts.py
@@ -744,8 +744,6 @@ class Chroot:
                 if (sfile.startswith("post_") or sfile.startswith("pre_")) and os.path.isfile(os.path.join((settings.scriptsdir), sfile)):
                     shutil.copy(os.path.join((settings.scriptsdir), sfile), dest) 
 
-        self.pre_install_diversions = self.get_diversions()
-
         # Run custom scripts after creating the chroot.
         self.run_scripts("post_setup")
 
@@ -1798,7 +1796,7 @@ def check_results(chroot, root_info, file_owners, deps_info=None):
     """
 
     ok = True
-    if settings.check_broken_diversions and chroot.pre_install_diversions:
+    if settings.check_broken_diversions:
         (removed, added) = chroot.get_modified_diversions(chroot.pre_install_diversions)
         if added:
             logging.error("FAIL: Installed diversions (dpkg-divert) not removed by purge:\n%s" %
@@ -2018,6 +2016,7 @@ def install_and_upgrade_between_distros(package_files, packages):
     if settings.end_meta:
         # load root_info and selections
         root_info, selections = load_meta_data(settings.end_meta)
+        chroot.pre_install_diversions = []  # FIXME: diversion info needs to be restored
     else:
         chroot.upgrade_to_distros(settings.debian_distros[1:], [])
 
@@ -2026,10 +2025,12 @@ def install_and_upgrade_between_distros(package_files, packages):
         # set root_info and selections
         root_info = chroot.save_meta_data()
         selections = chroot.get_selections()
+        chroot.pre_install_diversions = chroot.get_diversions()
 
         if settings.save_end_meta:
             # save root_info and selections
             save_meta_data(settings.save_end_meta, root_info, selections)
+            # FIXME: diversion info needs to be stored
 
         chroot.remove()
         dont_do_on_panic(cid)
@@ -2441,6 +2442,7 @@ def process_packages(package_list):
         cid = do_on_panic(chroot.remove)
 
         root_info = chroot.save_meta_data()
+        chroot.pre_install_diversions = chroot.get_diversions()
         selections = chroot.get_selections()
 
         if not settings.no_install_purge_test:

-- 
piuparts git repository



More information about the Piuparts-commits mailing list