You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by ch...@apache.org on 2013/02/26 22:37:57 UTC

svn commit: r1450448 - in /uima/sandbox/uima-ducc/trunk/src/main/admin: ducc_post_install ducc_util.py

Author: challngr
Date: Tue Feb 26 21:37:57 2013
New Revision: 1450448

URL: http://svn.apache.org/r1450448
Log:
UIMA-2690
Unbreak derivation of JAVA_HOME.

Modified:
    uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_post_install
    uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_util.py

Modified: uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_post_install
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_post_install?rev=1450448&r1=1450447&r2=1450448&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_post_install (original)
+++ uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_post_install Tue Feb 26 21:37:57 2013
@@ -262,10 +262,12 @@ class PostInstall(DuccUtil):
 
         amqhome = self.ducc_properties.get('ducc.broker.home')
         os.chdir(amqhome + '/bin')
-        os.system("sed -i.bak 's/.$//' activemq")
+        os.system("sed -i.bak 's/\r//' activemq")
 
         os.chdir(here)
 
 if __name__ == "__main__":
+
+    os.environ['DUCC_POST_INSTALL'] = 'DUCC_POST_INSTALL'
     postinstall = PostInstall()
     postinstall.main(sys.argv[1:])

Modified: uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_util.py
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_util.py?rev=1450448&r1=1450447&r2=1450448&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_util.py (original)
+++ uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_util.py Tue Feb 26 21:37:57 2013
@@ -188,13 +188,6 @@ class DuccUtil:
         self.webserver_node = self.ducc_properties.get('ducc.ws.node')
         self.jvm            = self.ducc_properties.get('ducc.jvm')
 
-        if ( self.system == 'Darwin' ):
-            self.jvm_home = "/Library/Java/Home"
-        else:
-            ndx = self.jvm.rindex('/')
-            ndx = self.jvm.rindex('/', 0, ndx)
-            self.jvm_home = self.jvm[:ndx]
-
         # self.broker_url     = self.ducc_properties.get('ducc.broker.url')
         self.broker_protocol   = self.ducc_properties.get('ducc.broker.protocol')
         self.broker_host       = self.ducc_properties.get('ducc.broker.hostname')
@@ -223,6 +216,16 @@ class DuccUtil:
         return self.jvm
         
     def java_home(self):
+        if ( os.environ.has_key('DUCC_POST_INSTALL') ):
+            return 'JAVA_HOME'   # avoid npe during first-time setup
+
+        if ( self.system == 'Darwin' ):
+            self.jvm_home = "/Library/Java/Home"
+        else:
+            ndx = self.jvm.rindex('/')
+            ndx = self.jvm.rindex('/', 0, ndx)
+            self.jvm_home = self.jvm[:ndx]
+
         return self.jvm_home
         
     def find_netstat(self):