[Checkins] SVN: zc.recipe.deployment/branches/jim-name/ let config parts control output file named

jim cvs-admin at zope.org
Wed Apr 24 18:20:10 UTC 2013


Log message for revision 130200:
  let config parts control output file named

Changed:
  U   zc.recipe.deployment/branches/jim-name/CHANGES.txt
  U   zc.recipe.deployment/branches/jim-name/src/zc/recipe/deployment/README.txt
  U   zc.recipe.deployment/branches/jim-name/src/zc/recipe/deployment/__init__.py

-=-
Modified: zc.recipe.deployment/branches/jim-name/CHANGES.txt
===================================================================
--- zc.recipe.deployment/branches/jim-name/CHANGES.txt	2013-04-24 18:17:18 UTC (rev 130199)
+++ zc.recipe.deployment/branches/jim-name/CHANGES.txt	2013-04-24 18:20:09 UTC (rev 130200)
@@ -1,7 +1,12 @@
 Changes
 *******
 
+1.0.0 (2013-04-2?)
+==================
 
+- Added a ``name`` option to the ``configuration`` recipe to allow
+  explicit control of generated file paths.
+
 0.10.3 (unreleased)
 ===================
 

Modified: zc.recipe.deployment/branches/jim-name/src/zc/recipe/deployment/README.txt
===================================================================
--- zc.recipe.deployment/branches/jim-name/src/zc/recipe/deployment/README.txt	2013-04-24 18:17:18 UTC (rev 130199)
+++ zc.recipe.deployment/branches/jim-name/src/zc/recipe/deployment/README.txt	2013-04-24 18:20:09 UTC (rev 130200)
@@ -597,7 +597,71 @@
     location = PREFIX/etc/foo/x.cfg
     ...
 
+By default, the part name is used as the file name.  You can specify a
+name explicitly using the name option:
 
+    >>> write('buildout.cfg',
+    ... '''
+    ... [buildout]
+    ... parts = foo x.cfg
+    ...
+    ... [foo]
+    ... recipe = zc.recipe.deployment
+    ... prefix = %s
+    ... user = %s
+    ... etc-user = %s
+    ...
+    ... [x.cfg]
+    ... recipe = zc.recipe.deployment:configuration
+    ... name = y.cfg
+    ... text = this is y
+    ... deployment = foo
+    ... ''' % (sample_buildout, user, user))
+
+    >>> print system(join('bin', 'buildout')), # doctest: +NORMALIZE_WHITESPACE
+    Uninstalling x.cfg.
+    Updating foo.
+    Installing x.cfg.
+    zc.recipe.deployment:
+        Updating 'PREFIX/etc/foo',
+        mode 755, user 'USER', group 'GROUP'
+
+    >>> cat(os.path.join(sample_buildout, 'etc/foo/y.cfg'))
+    this is y
+
+The name can be a path, or even absolute:
+
+
+    >>> write('buildout.cfg',
+    ... '''
+    ... [buildout]
+    ... parts = foo x.cfg
+    ...
+    ... [foo]
+    ... recipe = zc.recipe.deployment
+    ... prefix = %s
+    ... user = %s
+    ... etc-user = %s
+    ...
+    ... [x.cfg]
+    ... recipe = zc.recipe.deployment:configuration
+    ... name = ${buildout:directory}/y.cfg
+    ... text = this is y also
+    ... deployment = foo
+    ... ''' % (sample_buildout, user, user))
+
+    >>> print system(join('bin', 'buildout')), # doctest: +NORMALIZE_WHITESPACE
+    Uninstalling x.cfg.
+    Updating foo.
+    Installing x.cfg.
+    zc.recipe.deployment:
+        Updating 'PREFIX/etc/foo',
+        mode 755, user 'USER', group 'GROUP'
+
+    >>> cat('y.cfg')
+    this is y also
+
+
 Cron support
 ============
 

Modified: zc.recipe.deployment/branches/jim-name/src/zc/recipe/deployment/__init__.py
===================================================================
--- zc.recipe.deployment/branches/jim-name/src/zc/recipe/deployment/__init__.py	2013-04-24 18:17:18 UTC (rev 130199)
+++ zc.recipe.deployment/branches/jim-name/src/zc/recipe/deployment/__init__.py	2013-04-24 18:20:09 UTC (rev 130200)
@@ -130,7 +130,8 @@
         created = []
         try:
             make_dir(options['etc-directory'], etc_uid, etc_gid, 0755, created)
-            make_dir(options['cache-directory'], run_uid, run_gid, 0755, created)
+            make_dir(options['cache-directory'],
+                     run_uid, run_gid, 0755, created)
             make_dir(options['lib-directory'], run_uid, run_gid, 0755, created)
             make_dir(options['log-directory'], run_uid, run_gid, 0755, created)
             make_dir(options['run-directory'], run_uid, run_gid, 0750, created)
@@ -211,7 +212,7 @@
             directory = os.path.join(
                 buildout['buildout']['parts-directory'])
         options["directory"] = directory
-        options["location"] = os.path.join(directory, name)
+        options["location"] = os.path.join(directory, options.get('name', name))
 
     def install(self):
         options = self.options



More information about the checkins mailing list