[rhmessaging-commits] rhmessaging commits: r3950 - in mgmt/newdata/cumin: bin and 1 other directories.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Mon May 10 11:42:53 EDT 2010


Author: justi9
Date: 2010-05-10 11:42:52 -0400 (Mon, 10 May 2010)
New Revision: 3950

Added:
   mgmt/newdata/cumin/bin/install-python-code
Removed:
   mgmt/newdata/cumin/bin/cumin-database-destroy
   mgmt/newdata/cumin/bin/cumin-database-init
   mgmt/newdata/cumin/bin/cumin-server
Modified:
   mgmt/newdata/cumin/Makefile
   mgmt/newdata/cumin/bin/cumin-admin
   mgmt/newdata/cumin/bin/cumin-data
   mgmt/newdata/cumin/bin/cumin-test
   mgmt/newdata/cumin/bin/cumin-web
   mgmt/newdata/cumin/python/cumin/config.py
Log:
 * Put cumin python code under its home dir, not in site-packages

 * Make the cumin home default to /usr/share/cumin

 * Remove unused entry points



Modified: mgmt/newdata/cumin/Makefile
===================================================================
--- mgmt/newdata/cumin/Makefile	2010-05-06 20:28:40 UTC (rev 3949)
+++ mgmt/newdata/cumin/Makefile	2010-05-10 15:42:52 UTC (rev 3950)
@@ -3,40 +3,31 @@
 include ../etc/Makefile.common
 
 name := cumin
-lib := ${PYTHON_LIB_DIR}/${name}
-etc := ${ETC_DIR}/${name}
-doc := ${DOC_DIR}/${name}
-log := ${VAR_DIR}/log/${name}
-share := ${SHARE_DIR}/${name}
+home := ${SHARE_DIR}/${name}
 
 build:
 	python -m compileall -x '/\.svn' -f python
 
 install: build
-	install -d ${lib}
-	install -pm 0644 python/cumin/*.py python/cumin/*.pyc python/cumin/*.strings ${lib}
-	install -d ${lib}/account
-	install -pm 0644 python/cumin/account/*.py python/cumin/account/*.pyc python/cumin/account/*.strings ${lib}/account
-	install -d ${lib}/messaging
-	install -pm 0644 python/cumin/messaging/*.py python/cumin/messaging/*.pyc python/cumin/messaging/*.strings ${lib}/messaging
-	install -d ${lib}/grid
-	install -pm 0644 python/cumin/grid/*.py python/cumin/grid/*.pyc python/cumin/grid/*.strings ${lib}/grid
-	install -d ${lib}/usergrid
-	install -pm 0644 python/cumin/usergrid/*.py python/cumin/usergrid/*.pyc python/cumin/usergrid/*.strings ${lib}/usergrid
-	install -d ${lib}/inventory
-	install -pm 0644 python/cumin/inventory/*.py python/cumin/inventory/*.pyc python/cumin/inventory/*.strings ${lib}/inventory
 	install -d ${BIN_DIR}
 	install -pm 0755 bin/* ${BIN_DIR}
-	install -d ${doc}
-	install -pm 0644 LICENSE COPYING ${doc}
-	install -d ${share}/model
-	install -pm 0644 model/*.xml ${share}/model
-	install -d ${share}/resources
-	install -pm 0644 resources/* ${share}/resources
-	ln -sf ../wooly/resources ${share}/resources-wooly
-	install -d ${etc}
-	install -pm 0644 etc/cumin.* ${etc}
-	install -pm 0755 etc/sysvinit-cumin ${etc}
-	install -d ${log}
+	install -d ${DOC_DIR}/${name}
+	install -pm 0644 LICENSE COPYING ${DOC_DIR}/${name}
+	install -d ${home}/model
+	install -pm 0644 model/*.xml ${home}/model
+	install -d ${home}/resources
+	install -pm 0644 ../wooly/resources/* ${home}/resources
+	install -pm 0644 resources/* ${home}/resources
+	install -d ${ETC_DIR}/${name}
+	ln -sf ${ETC_DIR}/${name} ${home}/etc
+	install -pm 0644 etc/cumin.* ${ETC_DIR}/${name}
+	install -pm 0755 etc/sysvinit-cumin ${ETC_DIR}/${name}
+	install -d ${VAR_DIR}/log/${name}
+	ln -sf ${VAR_DIR}/log/${name} ${home}/log
+	bin/install-python-code python ${home}/python
+	bin/install-python-code ../wooly/python ${home}/python 
+	bin/install-python-code ../rosemary/python ${home}/python 
+	bin/install-python-code ../mint/python ${home}/python 
+	bin/install-python-code ../parsley/python ${home}/python 
 
 clean: clean-python-files

Modified: mgmt/newdata/cumin/bin/cumin-admin
===================================================================
--- mgmt/newdata/cumin/bin/cumin-admin	2010-05-06 20:28:40 UTC (rev 3949)
+++ mgmt/newdata/cumin/bin/cumin-admin	2010-05-10 15:42:52 UTC (rev 3950)
@@ -1,5 +1,11 @@
 #!/usr/bin/python
 
+import os
+import sys
+
+home = os.environ.get("CUMIN_HOME", os.path.normpath("/usr/share/cumin"))
+sys.path.append(os.path.join(home, "python"))
+
 from parsley.collectionsex import defaultdict
 
 from cumin import *

Modified: mgmt/newdata/cumin/bin/cumin-data
===================================================================
--- mgmt/newdata/cumin/bin/cumin-data	2010-05-06 20:28:40 UTC (rev 3949)
+++ mgmt/newdata/cumin/bin/cumin-data	2010-05-10 15:42:52 UTC (rev 3950)
@@ -1,5 +1,11 @@
 #!/usr/bin/python
 
+import os
+import sys
+
+home = os.environ.get("CUMIN_HOME", os.path.normpath("/usr/share/cumin"))
+sys.path.append(os.path.join(home, "python"))
+
 from cumin.config import *
 from cumin.util import *
 from mint import *

Deleted: mgmt/newdata/cumin/bin/cumin-database-destroy
===================================================================
--- mgmt/newdata/cumin/bin/cumin-database-destroy	2010-05-06 20:28:40 UTC (rev 3949)
+++ mgmt/newdata/cumin/bin/cumin-database-destroy	2010-05-10 15:42:52 UTC (rev 3950)
@@ -1,6 +0,0 @@
-#!/bin/bash -e
-
-echo "Warning: this command is deprecated; it has been replaced by"
-echo "the command 'mint-database destroy'"
-
-exec mint-database destroy

Deleted: mgmt/newdata/cumin/bin/cumin-database-init
===================================================================
--- mgmt/newdata/cumin/bin/cumin-database-init	2010-05-06 20:28:40 UTC (rev 3949)
+++ mgmt/newdata/cumin/bin/cumin-database-init	2010-05-10 15:42:52 UTC (rev 3950)
@@ -1,6 +0,0 @@
-#!/bin/bash -e
-
-echo "Warning: this command is deprecated; it has been replaced by"
-echo "the command 'mint-database create'"
-
-exec mint-database create

Deleted: mgmt/newdata/cumin/bin/cumin-server
===================================================================
--- mgmt/newdata/cumin/bin/cumin-server	2010-05-06 20:28:40 UTC (rev 3949)
+++ mgmt/newdata/cumin/bin/cumin-server	2010-05-10 15:42:52 UTC (rev 3950)
@@ -1,9 +0,0 @@
-#!/usr/bin/python
-
-from cumin.tools import CuminServerTool
-
-if __name__ == "__main__":
-    try:
-        CuminServerTool("cumin-server").main()
-    except KeyboardInterrupt:
-        pass

Modified: mgmt/newdata/cumin/bin/cumin-test
===================================================================
--- mgmt/newdata/cumin/bin/cumin-test	2010-05-06 20:28:40 UTC (rev 3949)
+++ mgmt/newdata/cumin/bin/cumin-test	2010-05-10 15:42:52 UTC (rev 3950)
@@ -1,7 +1,11 @@
 #!/usr/bin/python
 
-import sys, os
+import os
+import sys
 
+home = os.environ.get("CUMIN_HOME", os.path.normpath("/usr/share/cumin"))
+sys.path.append(os.path.join(home, "python"))
+
 from cumin.tools import CuminTestTool
 
 if __name__ == "__main__":

Modified: mgmt/newdata/cumin/bin/cumin-web
===================================================================
--- mgmt/newdata/cumin/bin/cumin-web	2010-05-06 20:28:40 UTC (rev 3949)
+++ mgmt/newdata/cumin/bin/cumin-web	2010-05-10 15:42:52 UTC (rev 3950)
@@ -1,5 +1,11 @@
 #!/usr/bin/python
 
+import os
+import sys
+
+home = os.environ.get("CUMIN_HOME", os.path.normpath("/usr/share/cumin"))
+sys.path.append(os.path.join(home, "python"))
+
 from cumin import *
 from cumin.config import *
 from cumin.util import *

Added: mgmt/newdata/cumin/bin/install-python-code
===================================================================
--- mgmt/newdata/cumin/bin/install-python-code	                        (rev 0)
+++ mgmt/newdata/cumin/bin/install-python-code	2010-05-10 15:42:52 UTC (rev 3950)
@@ -0,0 +1,19 @@
+#!/bin/bash -e
+
+if [[ $# != 2 ]]; then
+    echo "install-python-code SOURCE-DIR DESTINATION-DIR"
+    exit 1
+fi
+
+src_top=$1
+dst_top=$2
+
+find $src_top -type d -not -path "**/.svn*" | while read src_dir
+do
+    dst_dir="${dst_top}${src_dir#$src_top}"
+
+    install -d "$dst_dir"
+    install -pm 0644 ${src_dir}/*.py "$dst_dir" 2> /dev/null || :
+    install -pm 0644 ${src_dir}/*.pyc "$dst_dir" 2> /dev/null || :
+    install -pm 0644 ${src_dir}/*.strings "$dst_dir" 2> /dev/null || :
+done


Property changes on: mgmt/newdata/cumin/bin/install-python-code
___________________________________________________________________
Name: svn:executable
   + *

Modified: mgmt/newdata/cumin/python/cumin/config.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/config.py	2010-05-06 20:28:40 UTC (rev 3949)
+++ mgmt/newdata/cumin/python/cumin/config.py	2010-05-10 15:42:52 UTC (rev 3950)
@@ -11,7 +11,7 @@
     def __init__(self):
         super(CuminConfig, self).__init__()
 
-        hdef = os.path.normpath("/var/lib/cumin")
+        hdef = os.path.normpath("/usr/share/cumin")
         self.home = os.environ.get("CUMIN_HOME", hdef)
 
         if not os.path.isdir(self.home):



More information about the rhmessaging-commits mailing list