[matter] pass a full Spec object to Binary PMS commit() methods

This makes possible to use the extra pieces of information in order
to implement more complex features
This commit is contained in:
Fabio Erculiani
2013-02-18 23:00:38 +00:00
parent 5d3cb7a878
commit a7dfdafe3c
3 changed files with 8 additions and 5 deletions

View File

@@ -197,10 +197,12 @@ class BaseBinaryPMS(object):
"preserved libraries are found on "
"the system, aborting.")
def commit(self, repository, packages):
def commit(self, spec, packages):
"""
Commit packages to the BinaryPMS repository.
Commit packages to the BinaryPMS repository specified in the
Spec object.
"""
repository = spec["repository"]
pkgdir = self._build_pkgdir(repository)
env = os.environ.copy()
env["PKGDIR"] = pkgdir
@@ -215,7 +217,7 @@ class BaseBinaryPMS(object):
def push(self, repository):
"""
Push all the packages built by PackageBuilder to the
given repository.
repository.
"""
pkgpush_f = self._nsargs.portage_pkgpush
if pkgpush_f is None:

View File

@@ -209,10 +209,11 @@ class EntropyBinaryPMS(BaseBinaryPMS):
"""
return self._entropy.Mirrors.sync_repository(repository)
def commit(self, repository, packages):
def commit(self, spec, packages):
"""
Overridden from BaseBinaryPMS.
"""
repository = spec["repository"]
spm = self._entropy.Spm()
spm_atoms = set()
exit_st = 0

View File

@@ -158,7 +158,7 @@ def matter_main(binary_pms, nsargs, cwd, specs):
if local_completed and nsargs.commit:
_rc = binary_pms.commit(
spec["repository"],
spec,
local_completed)
if exit_st == 0 and _rc != 0:
exit_st = _rc