changeset 338:28df50b267f6

Expanded the pkg_revision_template dictionary to include rules revision
author Andre Heinecke <aheinecke@intevation.de>
date Tue, 13 Apr 2010 09:53:19 +0000
parents 781074885633
children 524ad62ab207
files bin/publishstaticweb.py treepkg/packager.py
diffstat 2 files changed, 14 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/bin/publishstaticweb.py	Tue Apr 13 09:48:19 2010 +0000
+++ b/bin/publishstaticweb.py	Tue Apr 13 09:53:19 2010 +0000
@@ -44,11 +44,16 @@
     parser = OptionParser()
     parser.set_defaults(config_file=os.path.join(treepkgcmd.topdir,
                                                  "staticweb.cfg"))
+    parser.set_defaults(update_cache_only=False)
     parser.add_option("--config-file",
                       help=("The configuration file. Default is staticweb.cfg"))
+    parser.add_option("--update-cache-only", action="store_true",
+                      help=("Stop after updating the cache."
+                            " This omits the last step of the publishing"
+                            " process"))
     return parser.parse_args()
 
-def publish_static_site(config_filename):
+def publish_static_site(config_filename, update_cache_only=False):
     config = read_config(config_filename)
 
     # create web-page on build host
@@ -62,14 +67,15 @@
                    " $cachedir",
                    **config))
 
-    # rsync the web pages from the local cache to the publishing host
-    call(cmdexpand("rsync -rL --delete $cachedir/"
-                   " $publish_user$@$publish_host:$publish_dir",
-                   **config))
+    if not update_cache_only:
+        # rsync the web pages from the local cache to the publishing host
+        call(cmdexpand("rsync -rL --delete $cachedir/"
+                       " $publish_user$@$publish_host:$publish_dir",
+                       **config))
 
 
 def main():
     options, args = parse_commandline()
-    publish_static_site(options.config_file)
+    publish_static_site(options.config_file, options.update_cache_only)
 
 main()
--- a/treepkg/packager.py	Tue Apr 13 09:48:19 2010 +0000
+++ b/treepkg/packager.py	Tue Apr 13 09:53:19 2010 +0000
@@ -251,7 +251,8 @@
 
         if pkg_revision is None:
             pkg_revision = (self.track.pkg_revision_template
-                            % dict(pkg_revision=1))
+                            % dict(pkg_revision=1,
+                                   rules_revision=rules_revision))
         self.pkg_revision = pkg_revision
 
         self.base_dir = self.track.pkg_dir_for_revision(self.revision,
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)