Commit 5962845b authored by Jondy Zhao's avatar Jondy Zhao

Change platform section name from [arch-platform-name] to [name:platform]

parent 3fddde03
......@@ -227,11 +227,7 @@ Supported options
the former will be overridden by the latter allowing per-part customization.
The recipe uses separated part to support custom options in different
platforms. These platform's part has a pattern "platform-part" or
"arch-platform-part".
arch could be 'x86', 'x86_64', 'ia64' ... which equals
platform.machine().
platforms. These platform's part has a pattern "part:platform".
platform could be 'linux', 'cygwin', 'macos', 'sunos', 'freebsd',
'netbsd', 'unixware' ... which equals a formatted sys.platform.
......@@ -241,10 +237,10 @@ For example,
[bzip2]
recipe = slapos.recipe.cmmi
[x86-cygwin-bzip2]
[bzip2:cygwin]
patches = cygwin-bzip2-1.0.6.src.patch
All the options in the platform-part have high priority level.
All the options in the [part:platform] have high priority level.
The recipe first searches the exact match, if no found. Ignore arch
and search again, if still found nothing. Use no platform part.
......@@ -376,7 +372,7 @@ a custom location within the buildout::
... """ % src)
>>> print(system(buildout))
Uninstalling package.
Uninstalling packagex.
Installing foobar.
foobar: [ENV] TMP = /sample_buildout/parts/foobar/tmp
foobar: Extracting package to /sample_buildout/parts/foobar__compile__
......@@ -675,7 +671,7 @@ The recipe can specify build options for each platform. For example,
... pre-configure = echo "Configure in common platform"
... post-install = echo "Finished."
...
... [cygwin-package]
... [package:cygwin]
... pre-configure = echo "Configure in the CYGWIN platform"
... pre-install = echo "Installing in the CYGWIN"
... post-install = echo -n "CYGWIN " && ${package:post-install}
......@@ -698,7 +694,7 @@ are only ``pre-configure`` and ``post-install``. the output will be
Finished.
In the cygwin, the recipe merges the options in the parts 'package'
and 'cygwin-package'. The output will be
and 'package:cygwin'. The output will be
>>> print system(buildout)
Uninstalling package.
......@@ -715,14 +711,6 @@ and 'cygwin-package'. The output will be
package: Executing post-install
CYGWIN Finished.
Arch is supported either, For example,
[x86-cygwin-package]
...
The recipe will first search part looks like "arch-platform-part",
then "platform-part".
Union prefix
============
......@@ -1116,7 +1104,7 @@ Do nothing if one package has been installed.
... recipe = slapos.recipe.cmmi
... url = file://%s/package-0.0.0.tar.gz
... share = /usr/local/bin
... promises =
... promises =
... """ % (src,))
>>> print system(buildout)
......
......@@ -23,7 +23,7 @@ class Recipe(object):
self.name = name
# Merge options if there is a matched platform section
platform_options = self.get_platform_options()
platform_options = self.buildout.get("%s:%s" % (name, sys.platform))
if platform_options is None:
self.original_options = options
else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment