gump-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: rev 36637 - in gump/trunk: bin python/gump/build python/gump/repository python/gump/runner python/gump/utils
Date Thu, 19 Aug 2004 21:25:38 GMT
Author: ajack
Date: Thu Aug 19 14:25:37 2004
New Revision: 36637

Added:
   gump/trunk/bin/repo.py
Modified:
   gump/trunk/python/gump/build/builder.py
   gump/trunk/python/gump/repository/artifact.py
   gump/trunk/python/gump/runner/demand.py
   gump/trunk/python/gump/utils/sync.py
Log:
A repository examination/cleaning tool...

Added: gump/trunk/bin/repo.py
==============================================================================
--- (empty file)
+++ gump/trunk/bin/repo.py	Thu Aug 19 14:25:37 2004
@@ -0,0 +1,55 @@
+#!/usr/bin/python
+
+# Copyright 2003-2004 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""	
+    Works on the Gump Repository
+"""
+
+import os.path
+import sys
+import pprint
+
+from gump import log
+from gump.core.gumpinit import gumpinit
+
+import gump.repository.artifact
+
+# static void main()
+if __name__=='__main__':
+    gumpinit()
+
+    result = 1
+    
+    if not len(sys.argv) >= 1:
+        raise RuntimeError, 'Usage: repo.py \'repo directory\' [\'clean\']'
+        
+    dir   = sys.argv[1]
+    clean = len(sys.argv) == 2
+    
+    if not os.path.exists(dir): raise RuntimeError, 'No such directory : ' + `dir`    
+    if not os.path.isdir(dir): raise RuntimeError, 'Not a directory : ' + `dir`  
+           
+    repo=gump.repository.artifact.ArtifactRepository(dir)
+
+    for group in repo.getGroups():
+        print '---------------------------------------------------------'
+        print 'Group : ' + group
+        pprint.pprint(repo.extractGroup(group))
+    
+    log.info('Gump Repository Tool Complete. Exit code:' + str(result))
+          
+    # bye!
+    sys.exit(result)
\ No newline at end of file

Modified: gump/trunk/python/gump/build/builder.py
==============================================================================
--- gump/trunk/python/gump/build/builder.py	(original)
+++ gump/trunk/python/gump/build/builder.py	Thu Aug 19 14:25:37 2004
@@ -406,14 +406,15 @@
      
         log.info(' ------ Attempt Repository Search for : '+ project.getName())
 
+        group=project.getArtifactGroup()
+        
         # See if we have any...
-        artifacts = self.repository.extractMostRecentGroup(project.getArtifactGroup())
+        artifacts = self.repository.extractMostRecentGroup(group)
         if not artifacts:
             self.checkUpstreamRepositories(project)
             # Then try again...
-            artifacts = self.repository.extractMostRecentGroup(project.getArtifactGroup())
+            artifacts = self.repository.extractMostRecentGroup(group)
             
-        
         # :TODO:
         # If not artifacts, download using Depot?
         
@@ -434,8 +435,8 @@
                     # Stash this fallback...
                     jar.setPath(path)
                 else:
-                    log.info('Failed to find artifact for id %s (Gump Repo has %s)' % \
-                            (id, artifacts.keys()))
+                    log.info('Failed to find artifact for id %s (Gump Repo has %s in %s)'
% \
+                            (id, artifacts.keys(), group))
                             
                     artifactsOk=False
                     break

Modified: gump/trunk/python/gump/repository/artifact.py
==============================================================================
--- gump/trunk/python/gump/repository/artifact.py	(original)
+++ gump/trunk/python/gump/repository/artifact.py	Thu Aug 19 14:25:37 2004
@@ -80,7 +80,7 @@
         """
         Get all groups in the repository
         """
-        return os.path.listdir(getRepositoryDir())
+        return os.listdir(self.getRepositoryDir())
         
     def cleanRepository(self):
         for group in self.getGroups():
@@ -172,5 +172,4 @@
          """
          (dates,mostRecent)=self.extractGroup(group)
          if dates: return dates[mostRecent]
-         
-        
\ No newline at end of file
+         
\ No newline at end of file

Modified: gump/trunk/python/gump/runner/demand.py
==============================================================================
--- gump/trunk/python/gump/runner/demand.py	(original)
+++ gump/trunk/python/gump/runner/demand.py	Thu Aug 19 14:25:37 2004
@@ -189,7 +189,7 @@
             if gumpOptions.isUpdate():
                 # W/ multiple project in one module, it may be done
                 if not module.isUpdated():
-                    log.debug('Update module *inlined* ' + `module` + '.')     
+                    log.debug('Update module *inlined* (not in background thread) ' + `module`
+ '.')     
                     inlined+=1
                     self.performUpdate(module)
 

Modified: gump/trunk/python/gump/utils/sync.py
==============================================================================
--- gump/trunk/python/gump/utils/sync.py	(original)
+++ gump/trunk/python/gump/utils/sync.py	Thu Aug 19 14:25:37 2004
@@ -66,7 +66,7 @@
         if self.output:
             if isinstance(self.output,types.StringTypes):
                 doClose=1
-                log.debug('       changes to  [' + self.output + ']')
+                #log.debug('       changes to  [' + self.output + ']')
                 self.outputStream=open(self.output,'w')
             else:
                 self.outputStream=self.output
@@ -104,7 +104,7 @@
                     if not os.path.getsize(self.output) > 0:
                         try:
                             os.remove(self.output)
-                            log.debug('No changes, removed  [' + self.output + ']')
+                            #log.debug('No changes, removed  [' + self.output + ']')
                         except: pass
                 
         return (self.actionsOccured, self.inboundActions, self.cleanupActions)

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@gump.apache.org
For additional commands, e-mail: general-help@gump.apache.org


Mime
View raw message