* added `mako` program for processing templates in invirt packages
authorYang Zhang <y_z@mit.edu>
Tue, 12 Aug 2008 20:01:45 +0000 (16:01 -0400)
committerYang Zhang <y_z@mit.edu>
Tue, 12 Aug 2008 20:01:45 +0000 (16:01 -0400)
svn path=/trunk/packages/sipb-xen-base/; revision=882

debian/changelog
debian/control
files/usr/bin/mako [new file with mode: 0755]

index 105376b..d90eab5 100644 (file)
@@ -1,3 +1,9 @@
+sipb-xen-base (8.16) unstable; urgency=low
+
+  * added `mako` program for processing templates in invirt packages
+
+ -- Yang Zhang <y_z@mit.edu>  Tue, 12 Aug 2008 16:00:43 -0400
+
 sipb-xen-base (8.15) unstable; urgency=low
 
   * put invirt-getconf in /usr/bin
index 59fea99..bf21250 100644 (file)
@@ -7,7 +7,7 @@ Standards-Version: 3.7.2
 
 Package: sipb-xen-base
 Architecture: all
-Depends: ${misc:Depends}, python-json (>= 3.4-2), python-yaml (>= 3.05)
+Depends: ${misc:Depends}, python-json (>= 3.4-2), python-yaml (>= 3.05), python-mako (>= 0.2.2)
 Description: Base configuration required for all SIPB xen servers
  This package includes apt configuration, .k5login and other files that
  should be synchronized among all our servers.
diff --git a/files/usr/bin/mako b/files/usr/bin/mako
new file mode 100755 (executable)
index 0000000..f83af5b
--- /dev/null
@@ -0,0 +1,9 @@
+#!/usr/bin/env python
+
+from sys import argv
+from mako.template import Template
+from invirt.common import with_closing
+
+for inpath in argv:
+    @with_closing(file(splitext(inpath)[0], 'w'))
+    def render(f): print >> f, Template(filename = inpath).render()