changeset 31:47d69e5d8ace

merge
author Bernhard Herzog <bh@intevation.de>
date Thu, 15 Mar 2007 11:42:03 +0100
parents beec3ed6e0df (current diff) 22192fad1f79 (diff)
children 9b10c81ffd0f
files treepkg/status.py
diffstat 5 files changed, 45 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/enterprise/kdei18n.py	Tue Mar 13 20:19:48 2007 +0100
+++ b/enterprise/kdei18n.py	Thu Mar 15 11:42:03 2007 +0100
@@ -84,11 +84,21 @@
         return tarball
 
     def do_package(self):
+        # Create a new kde-i18n-de tarball from current SVN and the base
+        # kde-i18n-de tarball.
         pkgbaseversion, pkgbasedir = self.export_sources()
         tarball = self.create_i18n_de_tarball(pkgbasedir, pkgbaseversion)
 
+        # We have to reuse the same directory when building the
+        # orig.tar.gz.  However, we need to preserver the scripts
+        # sub-directory because it's not needed for the kde-i18n-de
+        # tarball but for the .orig.tar.gz.
+        pkg_scripts_dir = os.path.join(pkgbasedir, "scripts")
+        tmp_scripts_dir = os.path.join(self.work_dir, "scripts")
+        os.rename(pkg_scripts_dir, tmp_scripts_dir)
         shutil.rmtree(pkgbasedir)
         os.mkdir(pkgbasedir)
+        os.rename(tmp_scripts_dir, pkg_scripts_dir)
 
         pkgbasename = self.pkg_basename + "_" + pkgbaseversion
         origtargz = os.path.join(self.work_dir,
--- a/runtreepkg.py	Tue Mar 13 20:19:48 2007 +0100
+++ b/runtreepkg.py	Thu Mar 15 11:42:03 2007 +0100
@@ -8,6 +8,7 @@
 
 """Starts the tree packager"""
 
+import sys
 import os
 import logging
 from optparse import OptionParser
@@ -28,7 +29,13 @@
     parser = OptionParser()
     parser.set_defaults(config_file=os.path.join(os.path.dirname(__file__),
                                                  "treepkg.cfg"))
-    parser.add_option("--config-file")
+    parser.add_option("--config-file",
+                      help=("The tree packager config file."
+                            " Default treepkg.cfg"))
+    parser.add_option("--once", action="store_true",
+                      help=("Check the packagers only once and exit afterwards."
+                            " Without this option, the tree packager will"
+                            " check periodically."))
     return parser.parse_args()
 
 def main():
@@ -37,9 +44,24 @@
     initialize_logging()
 
     treepkg_opts, packager_opts = read_config(options.config_file)
-    group = PackagerGroup([create_package_line(**opts)
-                           for opts in packager_opts],
-                          **treepkg_opts)
-    group.run()
+
+    if args:
+        packager_opts = [opts for opts in packager_opts if opts["name"] in args]
+        # check whether we got all of the names in args:
+        for opts in packager_opts:
+            name = opts["name"]
+            if name in args:
+                args.remove(name)
+        for name in args:
+            print >>sys.stderr, "No package lines found named %r" % name
+
+    if packager_opts:
+        group = PackagerGroup([create_package_line(**opts)
+                               for opts in packager_opts],
+                              **treepkg_opts)
+        if options.once:
+            group.check_package_lines()
+        else:
+            group.run()
 
 main()
--- a/treepkg/packager.py	Tue Mar 13 20:19:48 2007 +0100
+++ b/treepkg/packager.py	Thu Mar 15 11:42:03 2007 +0100
@@ -314,7 +314,7 @@
             subversion.update(localdir)
         else:
             logging.info("The working copy in %r doesn't exist yet."
-                         "  Checking out fromo %r", localdir,
+                         "  Checking out from %r", localdir,
                          self.svn_url)
             subversion.checkout(self.svn_url, localdir)
 
--- a/treepkg/report.py	Tue Mar 13 20:19:48 2007 +0100
+++ b/treepkg/report.py	Thu Mar 15 11:42:03 2007 +0100
@@ -76,20 +76,23 @@
                   cls=status_class(status))
 
 def prepare_report(group):
-    revisions = []
+    revisions = {}
     columns = []
     pkglines = group.get_package_lines()
     num_columns = len(pkglines)
     for column, line in enumerate(pkglines):
         columns.append((column, line.name))
         for revision in line.get_revisions():
-            row = [None] * num_columns
+            row = revisions.setdefault(revision.revision, [None] * num_columns)
             row[column] = struct(revno=revision.revision,
                                  revision=revision,
                                  column=column,
                                  name=line.name,
                                  status=prepare_status(revision.status))
-            revisions.append((revision.revision, row))
+
+    # convert the revisions dict into a sorted list of (revno, row)
+    # pairs
+    revisions = revisions.items()
     revisions.sort()
     revisions.reverse()
 
--- a/treepkg/status.py	Tue Mar 13 20:19:48 2007 +0100
+++ b/treepkg/status.py	Thu Mar 15 11:42:03 2007 +0100
@@ -54,7 +54,7 @@
 
 class Status(object):
 
-    fields = dict(status=StringFieldDesc(),
+    fields = dict(status=StringFieldDesc(default="unknown"),
                   start=DateFieldDesc(default=None),
                   stop=DateFieldDesc(default=None))
 
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)