[Checkins] SVN: grokproject/trunk/ Merge features from jw-luciano-use-versions-file; the created

Jan-Wijbrand Kolman janwijbrand at gmail.com
Wed Oct 10 05:08:15 EDT 2007


Log message for revision 80778:
  Merge features from jw-luciano-use-versions-file; the created 
  buildout.cfg will now include an extends directive that points to the
  URL of versions *.cfg file of the most current grok release.

Changed:
  U   grokproject/trunk/README.txt
  U   grokproject/trunk/grokproject/__init__.py
  U   grokproject/trunk/grokproject/template/buildout.cfg_tmpl

-=-
Modified: grokproject/trunk/README.txt
===================================================================
--- grokproject/trunk/README.txt	2007-10-10 08:58:51 UTC (rev 80777)
+++ grokproject/trunk/README.txt	2007-10-10 09:08:14 UTC (rev 80778)
@@ -32,6 +32,10 @@
 
 * Added buildout support for i18n (thanks to lovely.recipe.i18n).
 
+* The buildout.cfg that is created now has an extends directive that points
+  to URL of the version.cfg of the current Grok release. This URL can be
+  overridden with the --version-info-url commandline option.
+
 0.5.1 (2007-07-14)
 ------------------
 

Modified: grokproject/trunk/grokproject/__init__.py
===================================================================
--- grokproject/trunk/grokproject/__init__.py	2007-10-10 08:58:51 UTC (rev 80777)
+++ grokproject/trunk/grokproject/__init__.py	2007-10-10 09:08:14 UTC (rev 80778)
@@ -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):
@@ -51,6 +55,9 @@
                       "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()
@@ -76,6 +83,12 @@
     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)
     # TODO exit_code

Modified: grokproject/trunk/grokproject/template/buildout.cfg_tmpl
===================================================================
--- grokproject/trunk/grokproject/template/buildout.cfg_tmpl	2007-10-10 08:58:51 UTC (rev 80777)
+++ grokproject/trunk/grokproject/template/buildout.cfg_tmpl	2007-10-10 09:08:14 UTC (rev 80778)
@@ -4,6 +4,8 @@
 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