[Checkins] SVN: zope.release/branches/3.4/src/zope/release/ Now the upload scripts inspects the KGS config file to determine any

Stephan Richter srichter at cosmos.phy.tufts.edu
Tue Jan 27 09:29:48 EST 2009


Log message for revision 95211:
  Now the upload scripts inspects the KGS config file to determine any 
  other files that need to be uploaded.
  

Changed:
  U   zope.release/branches/3.4/src/zope/release/README.txt
  U   zope.release/branches/3.4/src/zope/release/upload.py

-=-
Modified: zope.release/branches/3.4/src/zope/release/README.txt
===================================================================
--- zope.release/branches/3.4/src/zope/release/README.txt	2009-01-27 14:24:43 UTC (rev 95210)
+++ zope.release/branches/3.4/src/zope/release/README.txt	2009-01-27 14:29:48 UTC (rev 95211)
@@ -9,7 +9,7 @@
 Here is an examplatory controlled packages configuration file:
 
   >>> import tempfile
-  >>> cfgFile = tempfile.mktemp('-cp.cfg')
+  >>> cfgFile = tempfile.mktemp('-controlled-packages.cfg')
   >>> open(cfgFile, 'w').write('''\
   ... [DEFAULT]
   ... tested = true
@@ -17,6 +17,8 @@
   ... [KGS]
   ... name = zope-dev
   ... version = 1.0.0
+  ... changelog = CHANGES.txt
+  ... files = zope-dev-1.0.0.tgz
   ...
   ... [packageA]
   ... versions = 1.0.0
@@ -32,6 +34,12 @@
   ... ''')
 
 
+  >>> import os
+  >>> dir = os.path.dirname(cfgFile)
+
+  >>> open(os.path.join(dir, 'CHANGES.txt'), 'w').write('Changes')
+  >>> open(os.path.join(dir, 'zope-dev-1.0.0.tgz'), 'w').write('TGZ')
+
 Uploading Files
 ---------------
 
@@ -46,9 +54,10 @@
 of the ``zope.kgs`` package will do the rest for us.
 
   >>> upload.main((cfgFile, 'download.zope.org:/zope-dev'))
-  scp ...-cp.cfg download.zope.org:/zope-dev/...-cp.cfg
+  scp ...controlled-packages.cfg ...controlled-packages.cfg
+  scp .../CHANGES.txt download.zope.org:/zope-dev/CHANGES.txt
+  scp ...zope-dev-1.0.0.tgz download.zope.org:/zope-dev/zope-dev-1.0.0.tgz
 
-
 Updating the Zope 3 Tree
 ------------------------
 

Modified: zope.release/branches/3.4/src/zope/release/upload.py
===================================================================
--- zope.release/branches/3.4/src/zope/release/upload.py	2009-01-27 14:24:43 UTC (rev 95210)
+++ zope.release/branches/3.4/src/zope/release/upload.py	2009-01-27 14:29:48 UTC (rev 95211)
@@ -31,6 +31,7 @@
   The server name and path of the remote directory.
 """
 import os, sys
+from zope.kgs import kgs
 
 DRY_RUN = False
 
@@ -42,11 +43,29 @@
             sys.exit(status)
 
 def upload(fileSpecs, destination):
-    """Generate a ``buildout.cfg`` from the list of controlled packages."""
+    """Upload files to the server."""
     for localPath, remoteName in fileSpecs:
         destinationPath = os.path.join(destination, remoteName)
         do('scp %s %s' %(localPath, destinationPath))
 
+def getAllFileSpecs(files):
+    fileSpecs = []
+    for filePath, name in files:
+        fileSpecs.append((filePath, name))
+        if not filePath.endswith('controlled-packages.cfg'):
+            continue
+        set = kgs.KGS(filePath)
+        if set.changelog:
+            fileSpecs.append((
+                set.changelog, os.path.split(set.changelog)[-1]))
+        if set.announcement:
+            fileSpecs.append((
+                set.announcement, os.path.split(set.announcement)[-1]))
+        for filePath in set.files:
+            fileSpecs.append((filePath, os.path.split(filePath)[-1]))
+    return fileSpecs
+
+
 def main(args=None):
     if args is None:
         args = sys.argv[1:]
@@ -66,4 +85,4 @@
             spec = spec.strip()
             fileSpecs.append(
                 (spec, os.path.split(spec)[-1]))
-    upload(fileSpecs, destination)
+    upload(getAllFileSpecs(fileSpecs), destination)



More information about the Checkins mailing list