gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: rev 47162 - gump/trunk/python/gump/build
Date Fri, 24 Sep 2004 14:14:41 GMT
Author: ajack
Date: Fri Sep 24 07:14:40 2004
New Revision: 47162

Modified:
   gump/trunk/python/gump/build/script.py
Log:
Check if the script (without extension) is a file (not a directory).
This is (as Stefan predicted) 'cos bootstrap is also a directory in
ant's build.

Modified: gump/trunk/python/gump/build/script.py
==============================================================================
--- gump/trunk/python/gump/build/script.py	(original)
+++ gump/trunk/python/gump/build/script.py	Fri Sep 24 07:14:40 2004
@@ -101,24 +101,32 @@
         basedir = script.getBaseDirectory() or project.getBaseDirectory()
 
         scriptfullname=script.getName()
-        if not os.path.exists(os.path.join(basedir, scriptfullname)):
+        
+        # The script
+        scriptfile=os.path.abspath(os.path.join(basedir, scriptfullname))
+        
+        # If the script exists (and is a plain file, i.e. not a dir)
+        # use it's exact name, else add a platform specific extension.
+        if not os.path.exists(scriptfile) \
+            or not os.path.isfile(scriptfile):
             # Add .sh  or .bat as appropriate to platform
-            if not os.name == 'dos' and not os.name == 'nt':
+            if not os.name in ['dos', 'nt']:
                 scriptfullname += '.sh'
             else:
                 scriptfullname += '.bat'
+                                
+            # Recalculate with the script extension
+            scriptfile=os.path.abspath(os.path.join(basedir, scriptfullname))
   
-        # The script
-        scriptfile=os.path.abspath(os.path.join(basedir, scriptfullname))
-        
         # Needed for (at least) a compiler...
         (classpath,bootclasspath)=languageHelper.getClasspaths(project)
 
-        cmd=Cmd(scriptfile,'buildscript_'+project.getModule().getName()+'_'+project.getName(),\
-            basedir,{'CLASSPATH':classpath})    
+        cmd=Cmd( scriptfile,
+                 'buildscript_'+project.getModule().getName()+'_'+project.getName(),
+                 basedir,
+                 {'CLASSPATH':classpath})    
         
         return cmd
-        
         
     def preview(self,project,languageHelper,stats):        
         """

Mime
View raw message