You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2007/02/23 05:39:02 UTC

svn commit: r510814 - in /geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util: BastardChildReaper.groovy ShellExecutor.groovy

Author: jdillon
Date: Thu Feb 22 20:39:02 2007
New Revision: 510814

URL: http://svn.apache.org/viewvc?view=rev&rev=510814
Log:
Added static execute() helpers, drop sh() bits

Modified:
    geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util/BastardChildReaper.groovy
    geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util/ShellExecutor.groovy

Modified: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util/BastardChildReaper.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util/BastardChildReaper.groovy?view=diff&rev=510814&r1=510813&r2=510814
==============================================================================
--- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util/BastardChildReaper.groovy (original)
+++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util/BastardChildReaper.groovy Thu Feb 22 20:39:02 2007
@@ -34,17 +34,6 @@
 {
     private AntBuilder ant = new gbuild.system.util.AntBuilder()
     
-    private String sh(String script, List args) {
-        assert script
-        
-        def shell = new ShellExecutor(script)
-        return shell.execute(args)
-    }
-    
-    private String sh(String script) {
-        return sh(script, null)
-    }
-    
     private List ps(String pattern) {
         log.info "Getting process list, pattern: $pattern"
         
@@ -65,7 +54,7 @@
         }
         cl += ' | grep -v $0' // Exclude the invoking script
         
-        List raw = sh(cl).tokenize('\n')
+        List raw = ShellExecutor.execute(cl).tokenize('\n')
         List header
         List result = []
         
@@ -136,14 +125,13 @@
     private void debugSpawn(String script) {
         assert script
         
-        def shell = new ShellExecutor(script)
-        shell.execute()
+        return ShellExecutor.execute(script)
     }
     
     def reap() {
         log.info 'Checking for bastard children...'
         
-        String pid = sh('echo $PPID')
+        String pid = ShellExecutor.execute('echo $PPID')
         
         log.info "Reaping bastard children of $pid"
         

Modified: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util/ShellExecutor.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util/ShellExecutor.groovy?view=diff&rev=510814&r1=510813&r2=510814
==============================================================================
--- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util/ShellExecutor.groovy (original)
+++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util/ShellExecutor.groovy Thu Feb 22 20:39:02 2007
@@ -107,5 +107,13 @@
     def execute() {
         return execute(null)
     }
+    
+    static def execute(String script, List args) {
+        return new ShellExecutor(script).execute(args)
+    }
+    
+    static def execute(String script) {
+        return execute(script, null)
+    }
 }