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

Andreas Beckmann debian at abeckmann.de
Fri Dec 23 10:25:55 UTC 2011


The following commit has been merged in the master branch:
commit 342c6b6fb3e192c01da0fa1a7fa7964c7055de36
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Mon Nov 21 01:25:54 2011 +0100

    log tarball creation in *.tgz.log
    
    Record the output from tarball creation in *.tgz.log.
    This log will always contain information from the last recreation
    attempt to ease troubleshooting failures.
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/piuparts-slave.py b/piuparts-slave.py
index 13d300b..9d8b145 100644
--- a/piuparts-slave.py
+++ b/piuparts-slave.py
@@ -412,14 +412,24 @@ def test_package(config, package, packages_files):
 
 
 def create_chroot(config, tarball, distro):
+    output_name = tarball + ".log"
+    logging.debug("Opening log file %s" % output_name)
     logging.info("Creating new tarball %s" % tarball)
     command = "%s -ad %s -s %s.new -m %s hello" % \
                 (config["piuparts-cmd"], distro, tarball, config["mirror"])
+    output = file(output_name, "w")
+    output.write(time.strftime("Start: %Y-%m-%d %H:%M:%S %Z\n\n",
+                               time.gmtime()))
+    output.write("Executing: " + command)
     logging.debug("Executing: " + command)
     f = os.popen("{ %s; } 2>&1" % command, "r")
     for line in f:
+        output.write(line)
         logging.debug(">> " + line.rstrip())
     f.close()
+    output.write(time.strftime("\nEnd: %Y-%m-%d %H:%M:%S %Z\n",
+                               time.gmtime()))
+    output.close()
     if os.path.exists(tarball + ".new"):
         os.rename(tarball + ".new", tarball)
 

-- 
piuparts git repository



More information about the Piuparts-commits mailing list