[matter] move env var MATTER_PORTAGE_BUILD_ARGS to .particle parameter build-args

This commit is contained in:
Fabio Erculiani
2013-02-18 22:42:11 +00:00
parent 3695655e66
commit 8f74262cbb
7 changed files with 31 additions and 12 deletions
+3 -7
View File
@@ -62,10 +62,6 @@ class PackageBuilder(object):
OVERLAYS_SYNC_CMD = shlex.split(os.getenv("MATTER_OVERLAYS_SYNC_CMD",
DEFAULT_OVERLAYS_SYNC_CMD))
DEFAULT_PORTAGE_BUILD_ARGS = "--verbose --nospinner"
PORTAGE_BUILD_ARGS = os.getenv("MATTER_PORTAGE_BUILD_ARGS",
DEFAULT_PORTAGE_BUILD_ARGS).split()
PORTAGE_BUILTIN_ARGS = ["--accept-properties=-interactive"]
def __init__(self, emerge_config, packages, params,
@@ -626,8 +622,8 @@ class PackageBuilder(object):
# non interactive properties, this is not really required
# accept-properties just sets os.environ...
build_args = []
build_args += PackageBuilder.PORTAGE_BUILD_ARGS
build_args += PackageBuilder.PORTAGE_BUILTIN_ARGS
build_args += self._params['build-args'],
build_args += ["=" + best_v for _x, best_v in packages]
myaction, myopts, myfiles = parse_opts(build_args)
@@ -754,7 +750,7 @@ class PackageBuilder(object):
return retval
@classmethod
def post_build(cls, emerge_config):
def post_build(cls, spec, emerge_config):
"""
Execute Portage post-build tasks.
"""
@@ -763,7 +759,7 @@ class PackageBuilder(object):
print_info("executing post-build operations, please wait...")
builtin_args = PackageBuilder.PORTAGE_BUILTIN_ARGS
_action, opts, _files = parse_opts(
PackageBuilder.PORTAGE_BUILD_ARGS + builtin_args)
builtin_args + spec['build-args'])
unmerge(emerge_trees[emerge_settings["ROOT"]]["root_config"],
opts, "clean", [], mtimedb["ldpath"], autoclean=1)
+1 -5
View File
@@ -145,7 +145,7 @@ def matter_main(binary_pms, nsargs, cwd, specs):
# call post-build cleanup operations,
# run it unconditionally
PackageBuilder.post_build(emerge_config)
PackageBuilder.post_build(spec, emerge_config)
completed.extend([x for x in local_completed \
if x not in completed])
@@ -245,8 +245,6 @@ Environment variables for Package Builder module:
default: %s
%s = alternative command used to sync Portage overlays
default: %s
%s = custom emerge arguments
default: %s
Environment variables passed to --post executables:
%s = exit status from previous execution phases, useful for detecting
@@ -266,8 +264,6 @@ Available Binary PMSs:
darkgreen(PackageBuilder.DEFAULT_PORTAGE_SYNC_CMD),
purple("MATTER_OVERLAYS_SYNC_CMD"),
darkgreen(PackageBuilder.DEFAULT_OVERLAYS_SYNC_CMD),
purple("MATTER_PORTAGE_BUILD_ARGS"),
darkgreen(PackageBuilder.DEFAULT_PORTAGE_BUILD_ARGS),
purple("MATTER_EXIT_STATUS"),
darkgreen(MatterResourceLock.LOCK_FILE_PATH),
matter_spec_params,
+11
View File
@@ -10,6 +10,7 @@
"""
import os
import shlex
from matter.utils import convert_to_unicode, get_stringtype
@@ -60,6 +61,9 @@ class GenericSpecFunctions(object):
def ve_integer_converter(self, x):
return int(x)
def ve_string_shlex_splitter(self, x):
return list(shlex.split(x))
def valid_ascii(self, x):
try:
x = str(x)
@@ -126,6 +130,13 @@ class MatterSpec(GenericSpecFunctions):
@rtype: dict
"""
return {
'build-args': {
'cb': self.ne_string,
've': self.ve_string_shlex_splitter,
'default': ["--verbose", "--nospinner"],
'desc': "Portage build arguments (default is --verbose\n "
"--nospinner)",
},
'dependencies': {
'cb': self.valid_yes_no,
've': self.ve_string_stripper,
+4
View File
@@ -29,6 +29,10 @@ repository: community0
# Default is: inherit
stable: inherit
# Provide custom build arguments to Portage.
# Default is: --verbose --nospinner
build-args: --verbose --nospinner
# Allow Source Package Manager (Portage) repository change?
# Valid values are either "yes" or "no"
# Default is: no
+4
View File
@@ -17,6 +17,10 @@ stable: inherit
# Mandatory, cannot be empty
repository: community0
# Provide custom build arguments to Portage.
# Default is: --verbose --nospinner
build-args: --verbose --nospinner
# Allow Source Package Manager (Portage) repository change?
# Valid values are either "yes" or "no"
# Default is: no
+4
View File
@@ -17,6 +17,10 @@ stable: inherit
# Mandatory, cannot be empty
repository: community0
# Provide custom build arguments to Portage.
# Default is: --verbose --nospinner
build-args: --verbose --nospinner
# Allow Source Package Manager (Portage) repository change?
# Valid values are either "yes" or "no"
# Default is: no
+4
View File
@@ -17,6 +17,10 @@ stable: inherit
# Mandatory, cannot be empty
repository: community0
# Provide custom build arguments to Portage.
# Default is: --verbose --nospinner
build-args: --verbose --nospinner
# Allow Source Package Manager (Portage) repository change?
# Valid values are either "yes" or "no"
# Default is: no