[Pkg-escience-soc2009] [SCM] Tool for creating VM images. branch, master, updated. gsoc-2009-final-1-g5af03f5

David Wendt (kmeisthax) dcrkid at yahoo.com
Sat Jan 30 00:10:12 UTC 2010


The following commit has been merged in the master branch:
commit 5af03f5eefcb3bdc8e723a3ff1919393f33259b2
Author: David Wendt (kmeisthax) <dcrkid at yahoo.com>
Date:   Fri Jan 29 18:58:44 2010 -0500

    Fixed the setup script so that it will actually generate the CORRECT list of data files by using os.walk on each templates dir instead of glob'ing each one, thus adding any subdirectores to the data files list (and killing the buildscript)

diff --git a/setup.py b/setup.py
index 44eb2e2..0b4d8d7 100755
--- a/setup.py
+++ b/setup.py
@@ -2,8 +2,7 @@
 
 from distutils.core import setup
 import VMBuilder.plugins
-from glob import glob
-import os.path
+import os
 import subprocess
 
 if os.path.exists('.bzr'):
@@ -15,7 +14,17 @@ if os.path.exists('.bzr'):
         o.close()
     except Exception, e:
         print repr(e)
-    
+
+vmbuilder_data = []
+
+for p in VMBuilder.plugins.find_plugins():
+    for pkg in [p.split('.')[-1]]:
+        vmbuilder_data.extend(['/etc/vmbuilder/%s' % (pkg,)])
+        
+        for root, dirs, files in os.walk('VMBuilder/plugins/%s/templates' % (pkg,)):
+            for filename in files:
+                vmbuilder_data.append(os.path.join(root, filename))
+
 setup(name='VMBuilder',
       version='0.11',
       description='Uncomplicated VM Builder',
@@ -23,6 +32,6 @@ setup(name='VMBuilder',
       author_email='soren at canonical.com',
       url='http://launchpad.net/vmbuilder/',
       packages=['VMBuilder', 'VMBuilder.plugins'] + VMBuilder.plugins.find_plugins(),
-      data_files=[('/etc/vmbuilder/%s' % (pkg,), glob('VMBuilder/plugins/%s/templates/*' % (pkg,))) for pkg in [p.split('.')[-1] for p in VMBuilder.plugins.find_plugins()]],
+      data_files=vmbuilder_data,
       scripts=['vmbuilder'], 
       )

-- 
Tool for creating VM images.



More information about the Pkg-escience-soc2009 mailing list