[Piuparts-commits] [SCM] piuparts git repository branch, piatti, updated. 0.42-30-gaa772de

Andreas Beckmann debian at abeckmann.de
Thu Jan 19 22:37:53 UTC 2012


The following commit has been merged in the piatti branch:
commit eaa6e80b8295aefbd8d8abd3fb579b68f0ff53ca
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Wed Jan 11 13:44:39 2012 +0100

    store diversion info in chroot_state["diversions"]
    
    no longer track in some pseudo global variable
    automatically adds support for loading/storing meta data
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/TODO b/TODO
index b26d9f5..ae9d8df 100644
--- a/TODO
+++ b/TODO
@@ -29,8 +29,6 @@ for 0.43:
   this blog post for a nice howto:
   http://andialbrecht.wordpress.com/2009/03/17/creating-a-man-page-with-distutils-and-optparse/
 
-- store and load the diversion information with --save-end-meta and --end-meta
-
 - sometimes a chroot doesn't get removed on piatti - find out
   why and fix it.
 
diff --git a/piuparts.py b/piuparts.py
index 4719210..7d80039 100644
--- a/piuparts.py
+++ b/piuparts.py
@@ -712,8 +712,6 @@ class Chroot:
     def __init__(self):
         self.name = None
 
-        self.pre_install_diversions = None
-
     def create_temp_dir(self):
         """Create a temporary directory for the chroot."""
         self.name = tempfile.mkdtemp(dir=settings.tmpdir)
@@ -1852,7 +1850,7 @@ def check_results(chroot, chroot_state, file_owners, deps_info=None):
     root_info = chroot_state["tree"]
     ok = True
     if settings.check_broken_diversions:
-        (removed, added) = chroot.get_modified_diversions(chroot.pre_install_diversions)
+        (removed, added) = chroot.get_modified_diversions(chroot_state["diversions"])
         if added:
             logging.error("FAIL: Installed diversions (dpkg-divert) not removed by purge:\n%s" %
                           indent_string("\n".join(added)))
@@ -2074,7 +2072,6 @@ def install_and_upgrade_between_distros(package_files, packages):
     if settings.end_meta:
         # load root_info and selections
         chroot_state = load_meta_data(settings.end_meta)
-        chroot.pre_install_diversions = []  # FIXME: diversion info needs to be restored
     else:
         if not settings.basetgz:
             temp_tgz = chroot.create_temp_tgz_file()
@@ -2089,12 +2086,11 @@ def install_and_upgrade_between_distros(package_files, packages):
         chroot_state = {}
         chroot_state["tree"] = chroot.save_meta_data()
         chroot_state["selections"] = chroot.get_selections()
-        diversions = chroot.get_diversions()
+        chroot_state["diversions"] = chroot.get_diversions()
 
         if settings.save_end_meta:
             # save root_info and selections
             save_meta_data(settings.save_end_meta, chroot_state)
-            # FIXME: diversion info needs to be stored
 
         chroot.remove()
         dont_do_on_panic(cid)
@@ -2108,7 +2104,6 @@ def install_and_upgrade_between_distros(package_files, packages):
         else:
             chroot.create(temp_tgz)
             chroot.remove_temp_tgz_file(temp_tgz)
-        chroot.pre_install_diversions = diversions
         cid = do_on_panic(chroot.remove)
 
     chroot.check_for_no_processes()
@@ -2524,8 +2519,8 @@ def process_packages(package_list):
 
         chroot_state = {}
         chroot_state["tree"] = chroot.save_meta_data()
-        chroot.pre_install_diversions = chroot.get_diversions()
         chroot_state["selections"] = chroot.get_selections()
+        chroot_state["diversions"] = chroot.get_diversions()
 
         if not settings.no_install_purge_test:
             if not install_purge_test(chroot, chroot_state,

-- 
piuparts git repository



More information about the Piuparts-commits mailing list