[Treepkg-commits] r267 - in trunk: bin treepkg

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Apr 13 11:53:21 CEST 2010


Author: aheinecke
Date: 2010-04-13 11:53:19 +0200 (Tue, 13 Apr 2010)
New Revision: 267

Modified:
   trunk/bin/publishstaticweb.py
   trunk/treepkg/packager.py
Log:
Expanded the pkg_revision_template dictionary to include rules revision


Modified: trunk/bin/publishstaticweb.py
===================================================================
--- trunk/bin/publishstaticweb.py	2010-04-13 09:48:19 UTC (rev 266)
+++ trunk/bin/publishstaticweb.py	2010-04-13 09:53:19 UTC (rev 267)
@@ -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()

Modified: trunk/treepkg/packager.py
===================================================================
--- trunk/treepkg/packager.py	2010-04-13 09:48:19 UTC (rev 266)
+++ trunk/treepkg/packager.py	2010-04-13 09:53:19 UTC (rev 267)
@@ -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,



More information about the Treepkg-commits mailing list