summaryrefslogtreecommitdiff
path: root/usr/src/tools/scripts/validate_pkg.py
diff options
context:
space:
mode:
authorRichard Lowe <richlowe@richlowe.net>2010-10-15 02:19:06 -0400
committerRichard Lowe <richlowe@richlowe.net>2010-10-15 02:19:06 -0400
commitfe89515e649436ba27844b63b5f18b41113d99c8 (patch)
tree6a57fb8e18c7bb62e50dc3420c20df34982cb681 /usr/src/tools/scripts/validate_pkg.py
parent6d1aa5db0eb402876278ae0b25a9fab8284635cb (diff)
downloadillumos-gate-fe89515e649436ba27844b63b5f18b41113d99c8.tar.gz
346 validate_pkg uses now-removed action.get_variants()
Reviewed by: johnsonnenschein@gmail.com, garrett@nexenta.com Approved by: garrett@nexenta.com --HG-- extra : rebase_source : 8c86d0860bfe3facd8bffa7ccdf7988b92945dd9
Diffstat (limited to 'usr/src/tools/scripts/validate_pkg.py')
-rw-r--r--usr/src/tools/scripts/validate_pkg.py23
1 files changed, 16 insertions, 7 deletions
diff --git a/usr/src/tools/scripts/validate_pkg.py b/usr/src/tools/scripts/validate_pkg.py
index 0323bbc0f9..2ac1e009d0 100644
--- a/usr/src/tools/scripts/validate_pkg.py
+++ b/usr/src/tools/scripts/validate_pkg.py
@@ -90,7 +90,7 @@ class FileInfo(object):
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 @@ class FileInfo(object):
(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 @@ class ProtoTree(DirectoryTree):
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 @@ class ManifestTree(DirectoryTree):
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 @@ def main(argv):
if len(modechecks) == 0:
modechecks = None
-
+
if not arch:
usage("must specify architecture")
@@ -842,7 +851,7 @@ def main(argv):
if modechecks is not None:
sys.exit(0)
trees.append(manifesttree)
-
+
if len(protodirs) > 0:
for pdir in protodirs:
prototree.adddir(pdir, exceptions)