[Piuparts-commits] rev 846 - in trunk: . debian

Holger Levsen holger at alioth.debian.org
Wed Dec 29 01:17:38 UTC 2010


Author: holger
Date: 2010-12-29 01:17:38 +0000 (Wed, 29 Dec 2010)
New Revision: 846

Modified:
   trunk/debian/changelog
   trunk/piuparts.1.txt
   trunk/piuparts.py
Log:
  - supply help texts for --end-meta and --save-end-meta options, also add
    comments to install_and_upgrade_between_distros() to make the code
    easier to understand and hopefully improve in future. (Closes: #560050).
  - add logging to install_and_upgrade_between_distros() to point people to
    read the functions source code if they wonder why the log (for distro 
    upgrade tests) looks like it looks.
  - update several options descritpions.

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2010-12-28 21:50:05 UTC (rev 845)
+++ trunk/debian/changelog	2010-12-29 01:17:38 UTC (rev 846)
@@ -78,12 +78,19 @@
       someone is testing a package not yet in the archive. (Closes: #566672)
       Thanks to Cleto Martin Angelina for the patch!
     - fix parsing of the options --end-meta and --save-end-meta.
+    - supply help texts for --end-meta and --save-end-meta options, also add
+      comments to install_and_upgrade_between_distros() to make the code
+      easier to understand and hopefully improve in future. (Closes: #560050).
+    - add logging to install_and_upgrade_between_distros() to point people to
+      read the functions source code if they wonder why the log (for distro 
+      upgrade tests) looks like it looks.
   * piuparts.1.txt: 
     - update the pointer to custom-scripts.txt to point to README.txt, as
       those two files have been merged. Thanks to Gregor Hermann for 
       spotting this. (Closes: #574504)
     - indicate that it's possible to check several packages or .changes files
       at once.
+    - update several options descritpions.
   * README.txt
     - better documentation of custom scripts.
   * Add ${misc:Depends} to Depends in debian/control. 

Modified: trunk/piuparts.1.txt
===================================================================
--- trunk/piuparts.1.txt	2010-12-28 21:50:05 UTC (rev 845)
+++ trunk/piuparts.1.txt	2010-12-29 01:17:38 UTC (rev 846)
@@ -60,7 +60,7 @@
   Do not verify signatures from the Release files when running debootstrap.
 
 *--dpkg-force-confdef*::
-  Make dpkg use --force-confdev, which lets dpkg always choose the default action when a modified conffile is found. This options will make piuparts ignore errors it was designed to report and therefore should only be used to hide problems in depending packages. 'This option shall normally not be used.' (See #466118.)
+  Make dpkg use --force-confdef, which lets dpkg always choose the default action when a modified conffile is found. This option will make piuparts ignore errors it was designed to report and therefore should only be used to hide problems in depending packages. 'This option shall normally not be used.' (See #466118.)
 
 *-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.
@@ -120,6 +120,12 @@
 *-s* 'filename', *--save*='filename'::
   Save the chroot, after it has been set up, as a tarball into _filename_. It can then be used with '-b'.
 
+*-B* 'FILE', *--end-meta*='FILE'::
+  Save chroot package selection and file meta data in FILE for later use. See the function install_and_upgrade_between_distros() in piuparts.py for defaults. Mostly useful for large scale distro upgrade tests.
+
+*-S* 'FILE', *--save-end-meta*='FILE'::
+  Load chroot package selection and file meta data from FILE. See the function install_and_upgrade_between_distros() in piuparts.py for defaults. Mostly useful for large scale distro upgrade tests.
+
 *--scriptsdir*='DIR'::
   Directory where are placed the custom scripts. For more information about this, read README.txt
 

Modified: trunk/piuparts.py
===================================================================
--- trunk/piuparts.py	2010-12-28 21:50:05 UTC (rev 845)
+++ trunk/piuparts.py	2010-12-29 01:17:38 UTC (rev 846)
@@ -1771,6 +1771,28 @@
     """Install package and upgrade it between distributions, then remove.
        Return True if successful, False if not."""
 
+    # this function is a bit confusing at first, because of what it does by default:
+    # 1. create chroot with source distro
+    # 2. upgrade chroot to target distro
+    # 3. remove chroot and recreate chroot with source distro
+    # 4. install depends in chroot
+    # 5. install package in chroot
+    # 6. upgrade chroot to target distro
+    # 7. remove package and depends
+    # 8. compare results
+    #
+    # sounds silly, or?
+    # well, it is is a reasonable default (see below for why), but 
+    #
+    # step 2+3 can be done differently by using --save-end-meta once and 
+    # then --end-meta for all following runs - until the target distro
+    # changes again... 
+    # 
+    # Under normal circumstances the target distro can change anytime, ie. at
+    # the next mirror pulse, so unless the target distro is frozen, this is
+    # a reasonable default behaviour for distro upgrade tests, which are not 
+    # done by default anyway.
+
     chroot = get_chroot()
     chroot.create()
     id = do_on_panic(chroot.remove)
@@ -1782,15 +1804,18 @@
         chroot.pack_into_tgz(root_tgz)
         
     if settings.end_meta:
+        # load root_info and selections
         root_info, selections = load_meta_data(settings.end_meta)
     else:
         chroot.upgrade_to_distros(settings.debian_distros[1:], [])
         chroot.run(["apt-get", "clean"])
 
+        # set root_info and selections
         root_info = chroot.save_meta_data()
         selections = chroot.get_selections()
         
         if settings.save_end_meta:
+            # save root_info and selections
             save_meta_data(settings.save_end_meta, root_info, selections)
     
         chroot.remove()
@@ -1799,6 +1824,9 @@
         chroot.create()
         id = do_on_panic(chroot.remove)
 
+    # leave indication in logfile why we do what we do
+    logging.info("Notice: package selections and meta data from target disto saved, now starting over from source distro. See the description of --save-end-meta nad --end-meta to learn why this is neccessary and how to possibly avoid it.")
+
     chroot.check_for_no_processes()
 
     chroot.run(["apt-get", "update"])
@@ -1820,6 +1848,7 @@
 
     file_owners = chroot.get_files_owned_by_packages()
 
+    # use root_info and selections
     changes = diff_selections(chroot, selections)
     chroot.restore_selections(changes, packages)
     result = check_results(chroot, root_info, file_owners)
@@ -1889,9 +1918,6 @@
                            "chroot, instead of building a new one with " +
                            "debootstrap.")
 
-    parser.add_option("-B", "--end-meta", metavar="FILE",
-                      help="XXX")
-    
     parser.add_option("--bindmount", action="append", metavar="DIR",
                       default=[],
                       help="Directory to be bind-mounted inside the chroot.")
@@ -1912,7 +1938,7 @@
     parser.add_option("--dpkg-force-confdef",
                       default=False,
                       action='store_true',
-		      help="Make dpkg use --force-confdef, which lets dpkg always choose the default action when a modified conffile is found. This option will make piuparts ignore errors it was designed to report and therefore should only be used to hide problems in depending packages.")
+		      help="Make dpkg use --force-confdef, which lets dpkg always choose the default action when a modified conffile is found. This option will make piuparts ignore errors it was designed to report and therefore should only be used to hide problems in depending packages.  (See #466118.)")
      
     parser.add_option("--do-not-verify-signatures", default=False,
                       action='store_true',
@@ -1992,8 +2018,11 @@
     parser.add_option("-s", "--save", metavar="FILENAME",
                       help="Save the chroot into FILENAME.")
 
+    parser.add_option("-B", "--end-meta", metavar="FILE",
+                      help="Save chroot package selection and file meta data in FILE for later use. See the function install_and_upgrade_between_distros() in piuparts.py for defaults. Mostly useful for large scale distro upgrade tests.")
+ 
     parser.add_option("-S", "--save-end-meta", metavar="FILE",
-                      help="XXX")
+                      help="Load chroot package selection and file meta data from FILE. See the function install_and_upgrade_between_distros() in piuparts.py for defaults. Mostly useful for large scale distro upgrade tests.")
 
     parser.add_option("--single-changes-list", default=False,
                       action="store_true",




More information about the Piuparts-commits mailing list