Mercurial > illumos > illumos-gate
changeset 13219:233eeb988b49
346 validate_pkg uses now-removed action.get_variants()
Reviewed by: johnsonnenschein@gmail.com, garrett@nexenta.com
Approved by: garrett@nexenta.com
author | Richard Lowe <richlowe@richlowe.net> |
---|---|
date | Fri, 15 Oct 2010 02:19:06 -0400 |
parents | c49928657241 |
children | fed843d791e9 |
files | usr/src/tools/scripts/validate_pkg.py |
diffstat | 1 files changed, 16 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/tools/scripts/validate_pkg.py Wed Oct 13 17:26:23 2010 -0400 +++ b/usr/src/tools/scripts/validate_pkg.py Fri Oct 15 02:19:06 2010 -0400 @@ -90,7 +90,7 @@ self.hardkey = None self.hardpaths = set() self.editable = False - + def name(self): """Return the IPS action name of a FileInfo object. """ @@ -279,7 +279,7 @@ (ftype, self.path, target, mode, owner, group, 0, 1) return out - + class ActionInfo(FileInfo): """Object to track information about manifest actions. @@ -498,7 +498,7 @@ def addprotolist(self, protolist, exceptions): """Read in the specified file, assumed to be the output of protolist. - + This has been tested minimally, and is potentially useful for comparing across the transition period, but should ultimately go away. @@ -631,11 +631,20 @@ continue # - # As with the manifest itself, if an action has specified + # As with the manifest itself, if an action has specified # variant.arch, we look for the target architecture # therein. # - var = action.get_variants() + var = None + + # + # The name of this method changed in pkg(5) build 150, we need to + # work with both sets. + # + if hasattr(action, 'get_variants'): + var = action.get_variants() + else: + var = action.get_variant_template() if "variant.arch" in var and arch not in var["variant.arch"]: return @@ -824,7 +833,7 @@ if len(modechecks) == 0: modechecks = None - + if not arch: usage("must specify architecture") @@ -842,7 +851,7 @@ if modechecks is not None: sys.exit(0) trees.append(manifesttree) - + if len(protodirs) > 0: for pdir in protodirs: prototree.adddir(pdir, exceptions)