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/07 23:59:25 UTC

cvs commit: jakarta-gump/python/gump update.py build.py

ajack       2003/10/07 14:59:25

  Modified:    python/gump update.py build.py
  Log:
  1) Another try on parsing/managing ~/.cvspass
  2) Copy jars to a repository structure
  
  Revision  Changes    Path
  1.15      +17 -11    jakarta-gump/python/gump/update.py
  
  Index: update.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/update.py,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- update.py	29 Sep 2003 23:10:12 -0000	1.14
  +++ update.py	7 Oct 2003 21:59:25 -0000	1.15
  @@ -106,17 +106,22 @@
     # read the list of cvs repositories that the user is already logged into
     logins={}
     cvspassfile=os.path.expanduser(os.path.join('~','.cvspass'))
  +  # print 'CVS Password File : ' + cvspassfile
     try:
       cvspass=open(cvspassfile)
       for line in cvspass.readlines():
           clean=line.strip()
           parts=clean.split(' ')
  -        root=parts[0]
  -        mangle=parts[1]
  +      
           # Cope with new format .cvspass 
  -        if len(parts) > 2:
  -            root=parts[1]
  -            mangle=parts[2] 
  +        rootPart=0
  +        if '/1' == parts[0]:
  +            rootPart=1
  +        root=parts[rootPart]
  +        
  +        # Cope w/ spaces in mangles
  +        mangle=' '.join(parts[rootPart+1:])
  +        
           # Stash this mangle for this root               
           logins[root]=mangle
       cvspass.close()
  @@ -135,8 +140,9 @@
               # Open with append...
               try:
                   cvspassfile=os.path.expanduser(os.path.join('~','.cvspass'),'a')
  -                cvspassfile.write('/1 '+root+' '+newpass+'\n')
  -                cvspassfile.close()
  +                cvspass=open(cvspassfile,'a')
  +                cvspass.write('/1 '+root+' '+newpass+'\n')
  +                cvspass.close()
               except Exception, detail:
                   log.error('Failed to append to ~/.cvspass. Details: ' + str(detail))
                   
  @@ -245,7 +251,7 @@
     logins=readLogins()
     
     dump(logins)
  -  
  +          
     # update(workspace, ps, context)
     
     # dump(context)
  
  
  
  1.21      +29 -17    jakarta-gump/python/gump/build.py
  
  Index: build.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/build.py,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- build.py	7 Oct 2003 19:26:58 -0000	1.20
  +++ build.py	7 Oct 2003 21:59:25 -0000	1.21
  @@ -73,7 +73,9 @@
   
   from gump import log, load
   from gump.context import *
  -from gump.logic import getBuildSequenceForProjects, getBuildCommand, getProjectsForProjectExpression, getModulesForProjectList
  +from gump.logic import getBuildSequenceForProjects, getBuildCommand, \
  +        getProjectsForProjectExpression, getModulesForProjectList, \
  +        hasOutputs
   from gump.repository import JarRepository
   from gump.conf import dir, default, handleArgv
   from gump.model import Workspace, Module, Project
  @@ -202,22 +204,32 @@
               if not cmdResult.status==CMD_STATUS_SUCCESS:
                   pctxt.propagateErrorState(STATUS_FAILED,REASON_BUILD_FAILED)
               else:
  -                outputsOk=1
  -                for i in range(0,len(project.jar)):
  -                    jar=os.path.normpath(project.jar[i].path)
  -                    if jar:
  -                        if not os.path.exists(jar):
  -                            pctxt.propagateErrorState(STATUS_FAILED,REASON_MISSING_OUTPUTS)
  -                            outputsOk=0
  -                            pctxt.addError("Missing Output: " + str(jar))
  -                        else:
  +                if hasOutputs(project,pctxt):
  +                    outputsOk=1
  +                    for i in range(0,len(project.jar)):
  +                        jar=os.path.normpath(project.jar[i].path)
  +                        if jar:
  +                            if not os.path.exists(jar):
  +                                pctxt.propagateErrorState(STATUS_FAILED,REASON_MISSING_OUTPUTS)
  +                                outputsOk=0
  +                                pctxt.addError("Missing Output: " + str(jar))
  +                            
  +                    if outputsOk: 
  +                        for i in range(0,len(project.jar)):
  +                            jar=os.path.normpath(project.jar[i].path)
                               # Copy to repository
                               repository.publish( module.name, jar )
  -                            
  -                if outputsOk: 
  +                
  +                        pctxt.status=STATUS_SUCCESS  
  +                    
  +                        # For 'fun' list repository
  +                        listDirectoryAsWork(pctxt,repository.getGroupDir(module.name), \
  +                                                'list_repo_'+project.name) 
  +                    
  +                    elif project.home:
  +                        listDirectoryAsWork(pctxt,project.home,'list_'+project.name)                          
  +                else:
                       pctxt.status=STATUS_SUCCESS  
  -                elif project.home:
  -                    listDirectoryAsWork(pctxt,project.home,'list_'+project.name)      
   
   # static void main()
   if __name__=='__main__':