You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@gump.apache.org by aj...@apache.org on 2003/10/29 19:36:31 UTC

cvs commit: jakarta-gump/python/gump __init__.py integrate.py launcher.py context.py tools.py build.py statistics.py check.py xdoc.py

ajack       2003/10/29 10:36:31

  Modified:    python/gump __init__.py integrate.py launcher.py context.py
                        tools.py build.py statistics.py check.py
  Removed:     python/gump xdoc.py
  Log:
  1) Removed obsolete xdoc.py
  2) Cleaned up __init__.py
  3) Made integrate call gump.conf.basicConf (dir problem on LSD)
  4) Better list directory 'name'
  5) do NOT log each execution, log if build fails, log if update fails.
  6) Make JDK version more prominent
  7) Check 'tmp' is available in execute command (see 3 above)
  
  Revision  Changes    Path
  1.17      +6 -6      jakarta-gump/python/gump/__init__.py
  
  Index: __init__.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/__init__.py,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- __init__.py	13 Oct 2003 18:51:20 -0000	1.16
  +++ __init__.py	29 Oct 2003 18:36:31 -0000	1.17
  @@ -102,13 +102,13 @@
   # Initialize
   ###############################################################################
   
  -# tell python what modules make up the gump package
  +# tell Python what modules make up the gump package
   __all__ = ["conf", "launcher", "view", "build", "gen", "check", "update", 
  -			"model", "xmlutils", "rss", "login", "xdoc", "statistics",
  +			"model", "xmlutils", "rss", "login", "statistics",
   			"document","tools"]
   
   
  -# ensure dirs exists
  +# Ensure dirs exists,
   conf.basicConfig()
   
   
  
  
  
  1.11      +6 -1      jakarta-gump/python/gump/integrate.py
  
  Index: integrate.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/integrate.py,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- integrate.py	23 Oct 2003 19:55:45 -0000	1.10
  +++ integrate.py	29 Oct 2003 18:36:31 -0000	1.11
  @@ -18,7 +18,7 @@
   import logging
   
   from gump import log, load
  -from gump.conf import dir, default, handleArgv
  +from gump.conf import dir, default, handleArgv, basicConfig
   from gump.model import Workspace, Module, Project
   from gump.check import checkEnvironment, check
   from gump.context import *
  @@ -113,10 +113,15 @@
       #set verbosity to show all messages of severity >= default.logLevel
       log.setLevel(default.logLevel)
   
  +    # Process command line
       args = handleArgv(sys.argv)
       ws=args[0]
       ps=args[1]
     
  +    # Ensure dirs exists,
  +    basicConfig()
  +
  +    # A place to write into...
       context=GumpContext()
    
       # get parsed workspace definition
  
  
  
  1.32      +18 -11    jakarta-gump/python/gump/launcher.py
  
  Index: launcher.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/launcher.py,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- launcher.py	26 Oct 2003 15:22:22 -0000	1.31
  +++ launcher.py	29 Oct 2003 18:36:31 -0000	1.32
  @@ -334,6 +334,14 @@
       start_time=time.time()
       try:
         try:          
  +        # Make the TMP if needed
  +        try:
  +            if not os.path.exists(tmp): os.mkdir(tmp)
  +        except Exception, details :
  +            # Log the problem and re-raise
  +            log.error('Failed to create TMP [' + tmp + ']. Details: ' + str(details))
  +            raise
  +              
           # Make the CWD if needed
           if cmd.cwd: 
             try:
  @@ -342,7 +350,7 @@
                 os.chdir(cwdpath)
             except Exception, details :
                 # Log the problem and re-raise
  -              log.error('Failed to create CWD. Details: ' + str(details))
  +              log.error('Failed to create CWD [' + cwdpath + ']. Details: ' + str(details))
                 raise
           
           # The command line
  @@ -378,7 +386,7 @@
                   if f: f.close()    
               
           #############################################################                
  -        log.info('Executing: ' + execString + ' (Output to ' + str(outputFile) + ')')
  +        log.debug('Executing: ' + execString + ' (Output to ' + str(outputFile) + ')')
       
           # Set the signal handler and an N-second alarm
           timeout=cmd.timeout or setting.timeout
  @@ -419,14 +427,7 @@
           #
           timer.cancel()            
                     
  -        #
  -        # Clean Up Empty Output Files
  -        #
  -        if os.path.exists(outputFile):
  -            if os.path.getsize(outputFile) > 0:
  -                result.output=outputFile
  -            else:
  -                os.remove(outputFile)
  +    
                   
         except Exception, details :
           log.error('Failed to launch command. Details: ' + str(details))
  @@ -435,8 +436,14 @@
           result.status=CMD_STATUS_FAILED
           
       finally:
  +      #
  +      # Clean Up Empty Output Files
  +      #
         if outputFile and os.path.exists(outputFile):
  -          result.output=outputFile
  +          if os.path.getsize(outputFile) > 0:
  +              result.output=outputFile
  +          else:
  +              os.remove(outputFile)
           
         # Keep time information
         end_time=time.time()
  
  
  
  1.33      +8 -1      jakarta-gump/python/gump/context.py
  
  Index: context.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/context.py,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- context.py	27 Oct 2003 16:40:54 -0000	1.32
  +++ context.py	29 Oct 2003 18:36:31 -0000	1.33
  @@ -619,7 +619,12 @@
               self.subcontexts[projectname] =  ProjectContext(projectname,self)
           return self.subcontexts[projectname]
           
  +    #
  +    # Get a full list of all the projects that depend
  +    # upon projects in this module 
  +    #
       def getDependees(self):   
  +        # Calculated once only...
           if self.totalDependees: return self.totalDependees
                   
           for pctxt in self:
  @@ -627,7 +632,9 @@
                   self.totalDependees.append(pctxt)
                   for ppctxt in pctxt.getDependees():
                       if not ppctxt in self.totalDependees:
  -                        self.totalDependees.append(ppctxt)                        
  +                        self.totalDependees.append(ppctxt)   
  +                        
  +        # Sort for prettiness...                     
           self.totalDependees.sort()
           return self.totalDependees
               
  
  
  
  1.8       +2 -2      jakarta-gump/python/gump/tools.py
  
  Index: tools.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/tools.py,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- tools.py	19 Oct 2003 17:46:36 -0000	1.7
  +++ tools.py	29 Oct 2003 18:36:31 -0000	1.8
  @@ -141,8 +141,8 @@
                   
           finally:
               if o: o.close()
  -    except:
  -        x.write('Failed to tail :' + file)    
  +    except Exception, details:
  +        log.error('Failed to tail :' + file + ' : ' + str(details))    
                               
       return taillines
   
  
  
  
  1.28      +8 -5      jakarta-gump/python/gump/build.py
  
  Index: build.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/build.py,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- build.py	17 Oct 2003 18:33:12 -0000	1.27
  +++ build.py	29 Oct 2003 18:36:31 -0000	1.28
  @@ -240,13 +240,16 @@
                                   if not dir in dirs and os.path.exists(dir):
                                       dircnt += 1
                                       listDirectoryAsWork(pctxt,dir,\
  -                                        'list_'+project.name+'_'+str(dircnt)+'_'+os.path.basename(dir))
  +                                        'list_'+project.name+'_dir'+str(dircnt)+'_'+os.path.basename(dir))
                                       dirs.append(dir)
                                   else:
                                       pctxt.addWarning("No such directory (where output is expect) : " + dir)
                   else:
                       pctxt.status=STATUS_SUCCESS  
  -
  +    
  +        if not pctxt.status == STATUS_SUCCESS:
  +            log.warn('Failed to build project [' + pctxt.name + ']')
  +            
   # static void main()
   if __name__=='__main__':
   
  
  
  
  1.5       +1 -0      jakarta-gump/python/gump/statistics.py
  
  Index: statistics.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/statistics.py,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- statistics.py	27 Oct 2003 05:36:58 -0000	1.4
  +++ statistics.py	29 Oct 2003 18:36:31 -0000	1.5
  @@ -259,6 +259,7 @@
                   s.sequenceInState += 1
               else:
                   s.sequenceInState = 1
  +                
               s.previousState=s.currentState
               s.currentState=projectcontext.status
               
  
  
  
  1.29      +11 -7     jakarta-gump/python/gump/check.py
  
  Index: check.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/check.py,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- check.py	21 Oct 2003 19:40:56 -0000	1.28
  +++ check.py	29 Oct 2003 18:36:31 -0000	1.29
  @@ -142,7 +142,7 @@
       checkExecutable(workspace, context, 'env','',0)
       checkExecutable(workspace, context, context.javaCommand,'-version',exitOnError)
       checkExecutable(workspace, context, 'javac','-help',exitOnError)
  -    checkExecutable(workspace, context, 'java com.sun.tools.javac.Main','-help',exitOnError,'check_java_compiler')    
  +    checkExecutable(workspace, context, 'java com.sun.tools.javac.Main','-help',exitOnError,0,'check_java_compiler')    
       checkExecutable(workspace, context, 'cvs','--version',exitOnError)
       if not context.noForrest and not checkExecutable(workspace, context, 'forrest','-projecthelp',0): 
           context.noForrest=1
  @@ -158,7 +158,7 @@
       
       context.setState(STATUS_SUCCESS);
       
  -def checkExecutable(workspace,context,command,options,mandatory,name=None):
  +def checkExecutable(workspace,context,command,options,mandatory,logOutput=0,name=None):
       ok=0
       try:
           if not name: name='check_'+command
  @@ -166,7 +166,7 @@
           result=execute(cmd)
           ok=result.status==CMD_STATUS_SUCCESS 
           if not ok:
  -            log.error('Failed to detect [' + command + ']')     
  +            log.error('Failed to detect [' + command + ']')   
       except Exception, details:
           ok=0
           log.error('Failed to detect [' + command + '] : ' + str(details))
  @@ -182,7 +182,11 @@
           for p in sys.path:
               print "  " + str(os.path.normpath(p))
           sys.exit(2)
  -    
  +        
  +    if logOutput and result.output:
  +        out=tailFileToString(result.output,10)
  +        context.addInfo(name + 'produce:\n' + out)
  +            
       return ok
       
   def checkEnvVariable(workspace, context,env,mandatory=1):