[Checkins] SVN: z3c.recipe.mkdir/trunk/ Update/extend docs/tests.

Ulrich Fouquet cvs-admin at zope.org
Tue Jun 26 02:33:47 UTC 2012


Log message for revision 127091:
  Update/extend docs/tests.

Changed:
  U   z3c.recipe.mkdir/trunk/README.txt
  U   z3c.recipe.mkdir/trunk/z3c/recipe/mkdir/README.txt

-=-
Modified: z3c.recipe.mkdir/trunk/README.txt
===================================================================
--- z3c.recipe.mkdir/trunk/README.txt	2012-06-26 00:27:19 UTC (rev 127090)
+++ z3c.recipe.mkdir/trunk/README.txt	2012-06-26 02:33:36 UTC (rev 127091)
@@ -24,7 +24,8 @@
 
 which will create 'foo/bar/' in the buildout root directory (not the
 ``parts/`` directory). Also intermediate directories are created (if
-they do not exist).
+they do not exist) except you set ``create-intermediate`` option
+(``yes`` by default) to ``no``.
 
 Starting with version 0.4 you can also set user, group, and mode if
 your system supports that::

Modified: z3c.recipe.mkdir/trunk/z3c/recipe/mkdir/README.txt
===================================================================
--- z3c.recipe.mkdir/trunk/z3c/recipe/mkdir/README.txt	2012-06-26 00:27:19 UTC (rev 127090)
+++ z3c.recipe.mkdir/trunk/z3c/recipe/mkdir/README.txt	2012-06-26 02:33:36 UTC (rev 127091)
@@ -429,10 +429,57 @@
   mydir: created path: /sample-buildout/mydir/with/existing/parent
   mydir:   mode 0750
 
-This is more to write down, but you can be sure that only explicitly
-named dirs are created and permissions set accordingly.
+This is more text to write down, but you can be sure that only
+explicitly named dirs are created and permissions set accordingly.
 
+For instance you can require a certain path to exist already and
+create only the trailing path parts. Say, we expect a local `etc/` to
+exist and want to create `etc/myapp/conf.d`. The following config
+would do the trick:
 
+  >>> write('buildout.cfg',
+  ... '''
+  ... [buildout]
+  ... parts = mydir
+  ... offline = true
+  ...
+  ... [mydir]
+  ... recipe = z3c.recipe.mkdir
+  ... paths = etc/myapp
+  ...         etc/myapp/conf.d
+  ... create-intermediate = no
+  ... mode = 750
+  ... ''')
+
+If the local `etc/` dir does not exist, we fail:
+
+  >>> print system(join('bin', 'buildout')),
+  Uninstalling mydir.
+  Installing mydir.
+  While:
+    Installing mydir.
+  Error: Cannot create: /sample-buildout/etc/myapp
+         Parent does not exist or not a directory.
+
+But if this dir exists:
+
+  >>> mkdir('etc')
+  >>> print system(join('bin', 'buildout')),
+  Installing mydir.
+  mydir: created path: /sample-buildout/etc/myapp
+  mydir:   mode 0750
+  mydir: created path: /sample-buildout/etc/myapp/conf.d
+  mydir:   mode 0750
+
+the subdirectories are created as expected.
+
+It does, by the way, not matter, in which order you put the partial
+parts into ``paths`` as this list is sorted before being
+processed. So, any path `a/b/` will be processed before `a/b/c/`
+regardless of the order in which both parts appear in the
+configuration file.
+
+
 Paths are normalized
 ====================
 



More information about the checkins mailing list