[Checkins] SVN: grokproject/branches/jw-luciano-use-versions-file/grokproject/ Look for a versions cfg file on grok.zope.org by default, but allow

Jan-Wijbrand Kolman janwijbrand at gmail.com
Thu Oct 4 12:34:38 EDT 2007


Log message for revision 80621:
  Look for a versions cfg file on grok.zope.org by default, but allow
  an override on the commandline when running grokproject.
  
  

Changed:
  U   grokproject/branches/jw-luciano-use-versions-file/grokproject/__init__.py
  U   grokproject/branches/jw-luciano-use-versions-file/grokproject/template/buildout.cfg_tmpl

-=-
Modified: grokproject/branches/jw-luciano-use-versions-file/grokproject/__init__.py
===================================================================
--- grokproject/branches/jw-luciano-use-versions-file/grokproject/__init__.py	2007-10-04 16:31:30 UTC (rev 80620)
+++ grokproject/branches/jw-luciano-use-versions-file/grokproject/__init__.py	2007-10-04 16:34:38 UTC (rev 80621)
@@ -4,9 +4,13 @@
 import shutil
 import tempfile
 import pkg_resources
+import urllib
+import urlparse
 from paste.script import templates, command
 from paste.script.templates import var, NoDefault
 
+VERSIONINFO_INFO_URL = 'http://grok.zope.org/releaseinfo/current'
+
 class GrokProject(templates.Template):
     _template_dir = 'template'
     summary = "A grok project"
@@ -19,7 +23,7 @@
         var('passwd', 'Password for the initial administrator user',
             default=NoDefault),
         var('eggs_dir', 'Location where zc.buildout will look for and place '
-            'packages', default=os.path.expanduser('~/buildout-eggs'))
+            'packages', default=os.path.expanduser('~/buildout-eggs')),
         ]
 
     def check_vars(self, vars, cmd):
@@ -49,8 +53,9 @@
                       help="Import project to given repository location (this "
                       "will also create the standard trunk/ tags/ branches/ "
                       "hierarchy).")
-    parser.add_option('--newer', action="store_true", dest="newest",
-                      default=False, help="Check for newer versions of packages.")
+    parser.add_option(
+        '--version-info-url', dest="version_info_url", default=None,
+        help="The URL to a *.cfg file containing a [versions] section.")
     parser.add_option('-v', '--verbose', action="store_true", dest="verbose",
                       default=False, help="Be verbose.")
     options, args = parser.parse_args()
@@ -71,10 +76,11 @@
         option_args.append('-q')
 
     extra_args = []
-    if options.newest:
-        extra_args.append('newest=true')
-    else:
-        extra_args.append('newest=false')
+    version_info_url = options.version_info_url
+    if not version_info_url:
+        info = urllib.urlopen(VERSIONINFO_INFO_URL).read().strip()
+        version_info_url = urlparse.urljoin(VERSIONINFO_INFO_URL, info)
+    extra_args.append('extends=' + version_info_url)
 
     exit_code = runner.run(option_args + ['-t', 'grokproject', project]
                            + extra_args)

Modified: grokproject/branches/jw-luciano-use-versions-file/grokproject/template/buildout.cfg_tmpl
===================================================================
--- grokproject/branches/jw-luciano-use-versions-file/grokproject/template/buildout.cfg_tmpl	2007-10-04 16:31:30 UTC (rev 80620)
+++ grokproject/branches/jw-luciano-use-versions-file/grokproject/template/buildout.cfg_tmpl	2007-10-04 16:34:38 UTC (rev 80621)
@@ -3,7 +3,8 @@
 parts = app data zopectl i18n test
 find-links = http://download.zope.org/distribution/
 eggs-directory = ${eggs_dir}
-newest = ${newest}
+extends= ${extends}
+versions = versions
 
 [data]
 recipe = zc.recipe.filestorage



More information about the Checkins mailing list