Your message dated Thu, 25 Aug 2011 18:35:05 +0000
with message-id <[email protected]>
and subject line Bug#632924: fixed in piuparts 0.41
has caused the Debian Bug report #632924,
regarding piuparts-slave to recreate tarball(s) beyond certain age
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
632924: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=632924
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: piuparts
Version: 0.40
Severity: wishlist
Tags: patch

Attached patch resolves two items:

1) From TODO ...

piuparts-slave: if chroot.tgz is older than N days, regenerate it
- currently this is done via ~piupartss/crontab, but that's a hack
- only throw away tarballs (and recreate them) after testing that they can be 
recreated

I hard-coded the MAX_TGZ_AGE at 30 days.  Log entry is written when the
file is recreated due to becoming too old. The "old" file is renamed to .old so that, should the new file fail to be created, it is simply renamed back and processing
continues.

piatti crontab entry should be removed after install.


2) Bug in piuparts-slave which prevented running a single section (by including
section name as command-line argument).

Variable 'global_config' was initialized only if len(sys.argv) > 1. This would cause python exception and exit when gloval_config was accessed in call to section.setup()



-- System Information:
Debian Release: 6.0.1
   APT prefers stable
   APT policy: (990, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-686 (SMP w/4 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages piuparts depends on:
ii  apt                     0.8.10.3         Advanced front-end for dpkg
ii  debootstrap             1.0.26+squeeze1  Bootstrap a basic Debian
system
ii  lsb-release             3.2-23.2squeeze1 Linux Standard Base version
report
ii  lsof                    4.81.dfsg.1-1    List open files
ii  python                  2.6.6-3+squeeze6 interactive high-level
object-orie
ii  python-debian           0.1.18           Python modules to work with
Debian

piuparts recommends no packages.

Versions of packages piuparts suggests:
ii  ghostscript                 8.71~dfsg2-9 The GPL Ghostscript
PostScript/PDF
pn  python-rpy <none>       (no description available)

-- no debconf information

diff --git a/piuparts-slave.py b/piuparts-slave.py
--- a/piuparts-slave.py
+++ b/piuparts-slave.py
@@ -25,17 +25,17 @@
 
 import os
 import sys
+import stat
 import time
 import logging
 import ConfigParser
-import urllib
-
 
 import piupartslib.conf
 import piupartslib.packagesdb
 
 
 CONFIG_FILE = "/etc/piuparts/piuparts.conf"
+MAX_TGZ_AGE = 60*60*24*30
 
 
 def setup_logging(log_level, log_file_name):
@@ -235,13 +235,15 @@
         if self._config["chroot-tgz"] and not self._config["distro"]:
           logging.info("The option --chroot-tgz needs --distro.")
 
-        if self._config["chroot-tgz"] and not os.path.exists(self._config["chroot-tgz"]):
-            create_chroot(self._config, self._config["chroot-tgz"], self._config["distro"])
+        tarball = self._config["chroot-tgz"]
+        if tarball:
+            create_or_replace_chroot_tgz(self._config, tarball,
+                       MAX_TGZ_AGE, self._config["distro"])
 
-        if (self._config["upgrade-test-distros"] and self._config["upgrade-test-chroot-tgz"]
-            and not os.path.exists(self._config["upgrade-test-chroot-tgz"])):
-            create_chroot(self._config, self._config["upgrade-test-chroot-tgz"], 
-                        self._config["upgrade-test-distros"].split()[0])
+        tarball = self._config["upgrade-test-chroot-tgz"]
+        if self._config["upgrade-test-distros"] and tarball: 
+            create_or_replace_chroot_tgz(self._config, tarball,
+                       MAX_TGZ_AGE, self._config["upgrade-test-distros"].split()[0])
     
         for rdir in ["new", "pass", "fail"]:
             rdir = os.path.join(self._slave_directory, rdir)
@@ -416,6 +418,19 @@
     f.close()
     os.rename(tarball + ".new", tarball)
 
+def create_or_replace_chroot_tgz(config, tgz, max_age, distro):
+    age = 0 
+    if os.path.exists(tgz):
+        age = time.time() - os.stat(tgz)[stat.ST_CTIME]
+        if age > max_age:
+            os.rename(tgz, tgz + ".old")
+            logging.info("%s too old.  Renaming to force re-creation" % tgz)
+    if not os.path.exists(tgz):
+        create_chroot(config, tgz, distro)
+        if not os.path.exists(tgz) and age > 0 and age > max_age:
+            os.rename(tgz + ".old", tgz)
+            logging.info("Failed to create ... reverting to old %s" % tgz)
+            create_chroot(config, tgz, distro)
 
 def fetch_packages_file(config, distro):
     mirror = config["mirror"]
@@ -448,11 +463,11 @@
     # argument referring to a section in configuration file.  
     # If no argument is given, the "global" section is assumed.
     section_names = []
+    global_config = Config(section="global")
+    global_config.read(CONFIG_FILE)
     if len(sys.argv) > 1:
         section_names = sys.argv[1:]
     else:
-        global_config = Config(section="global")
-        global_config.read(CONFIG_FILE)
         section_names = global_config["sections"].split()
 
     sections = []

--- End Message ---
--- Begin Message ---
Source: piuparts
Source-Version: 0.41

We believe that the bug you reported is fixed in the latest version of
piuparts, which is due to be installed in the Debian FTP archive:

piuparts_0.41.dsc
  to main/p/piuparts/piuparts_0.41.dsc
piuparts_0.41.tar.gz
  to main/p/piuparts/piuparts_0.41.tar.gz
piuparts_0.41_all.deb
  to main/p/piuparts/piuparts_0.41_all.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Holger Levsen <[email protected]> (supplier of updated piuparts package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Wed, 24 Aug 2011 13:47:07 +0200
Source: piuparts
Binary: piuparts
Architecture: source all
Version: 0.41
Distribution: unstable
Urgency: low
Maintainer: piuparts developers team <[email protected]>
Changed-By: Holger Levsen <[email protected]>
Description: 
 piuparts   - .deb package installation, upgrading, and removal testing tool
Closes: 526045 588482 632046 632924 633033
Changes: 
 piuparts (0.41) unstable; urgency=low
 .
   * piupartslib/packagesdb.py: Apply patch by Scott Schaefer to also consider
     alternative depends: the algorithm used to select the "best" alternative
     is:
      1) Prefer first alternative in state "essential-required"
      2) If no "essential-required" alternatives, prefer first alternative
         in state "successfully-tested"
      3) Otherwise, prefer first alternative in state
         "waiting-to-be-tested" IF NO REMAINING alternatives are in one of the
         "unknown/fail" states
     For this two new states have been introduced:
      a) "unknown-preferred-alternative": equivalent of "unknown", this defers
         calculation of this package's state, since one or more of its
         alternative depends are "unknown" (or
         "unknown-preferred-alternative"), and no alternative is either
         "essential-required" or "successfully-tested".  The alternatives will
         be re-tested on subsequest pass.
      b) "no-dependency-from-alternatives-exists": if none of the alternatives
         can be found in the archive.
     (Closes: #526045)
   * piuparts-report.py:
     - correct a typo from the patch for #523950.
     - make_stats_graph: draw the two new states as well.
     - point to source code in git instead of svn.
   * piuparts.py:
     - use proxy settings either from apt configuration or http_proxy
       environment variable, the latter overwriting the former (if present)
       - Thanks to Scott Schaefer for the patch. (Closes: #632046)
     - new option "--no-install-purge-test" to only do upgrade tests
       - Thanks to Andreas Bergmann for the patch (Closes: #588482)
     - run dpkg with --force-unsafe-io by default and introduce new option
       "--dpkg-noforce-unsafe-io" to disable this feature. (Closes: #633033)
       Thanks to Scott once more!
     - new option: "--fail-on-broken-symlinks". Remove option "--warn-symlinks"
       as this is the default now.
   * piuparts-slave:
     - check if chroot-tgz is older than max-tgz-age (defaulting to 30 days)
       and recreate it, if it is. Keep backup and put in back in place when
       debootstrapping a new chroot-tgz fails. Retry after min-tgz-retry-delay
       seconds. Thanks to Scott Schaefer for the patch. (Closes: #632924)
     - document new configuration options max-tgz-age and min-tgz-retry-delay
       in README.txt.
     - fix bug in piuparts-slave which prevented running a single section by
       including section name as command-line argument - thanks again to Scott
       and see 632924 too.
   * debian/control:
     - require python >= 2.6.6-3~, get rid of python-support build-depends.
     - add X-Python-Version: pseudo-header
   * debian/rules: use dh_python2 instead of python-support to build the
     package
   * Makefile: build for python 2.6 and 2.7 instead of 2.5 and 2.6.
   * Source code is now stored in git.
     http://anonscm.debian.org/gitweb/?p=piuparts/piuparts.git
     git clone git+ssh://git.debian.org/git/piuparts/piuparts.git
     Thanks to Thomas Koch for setting those up and keeping history!
   * The configuration and scripts used on piatti.debian.org have also been
     moved to git, the URLs are the same, just s#piuparts#piatti#.
   * Add entry about git to NEWS.
   * Update Vcs-*-Headers in control to reflect move to git.
Checksums-Sha1: 
 c38f260e935a9d9e3d36ad55784206cf678b9462 986 piuparts_0.41.dsc
 71a3625ddf0abbb9aebe499aaf793e390b72d5b9 80650 piuparts_0.41.tar.gz
 9c75d7fd97984f652be01c47cb6a1ecc0405c782 93202 piuparts_0.41_all.deb
Checksums-Sha256: 
 c13746d26aa8f4a9a05ee6aa311bd7d3bc1c1b95b5ea3810576f68e4df90168b 986 
piuparts_0.41.dsc
 b086263f2ab231f3d8328a20563c0370a446b6e0882cdaed8abe559a9d304ad4 80650 
piuparts_0.41.tar.gz
 9e38774b9dbebe18f1911cc30bcf7fdb89933b214f51fc6916cfc56cc48146e9 93202 
piuparts_0.41_all.deb
Files: 
 a67496db2269b5cdf8ad2ad9ffc7efe0 986 devel extra piuparts_0.41.dsc
 eb13891471ea690f95230319849e8c93 80650 devel extra piuparts_0.41.tar.gz
 f753579e3100cfd853bae1df15db87ad 93202 devel extra piuparts_0.41_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iD8DBQFOVpE2UHLQNqxYNSARAg9uAKC3Z/keSG2Zh4q4ur4nOYQeM3RifQCggmjL
x592S2raqhL1kayhhku3a0k=
=zxk+
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to