SolarisPackageDirBundle.py revision 2625
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
#
import os
hollow_attr = "pkg.send.convert.sunw-pkg-hollow"
# map the path name to the SVR4 class it belongs to and
# scripts this package uses.
self.class_actions_dir = {}
# A list of pkg.action.AttributeActions with pkginfo
# attributes for items that don't map to pkg(5) equivalents
def _walk_bundle(self):
faspac = []
# Want to access the manifest as a dict.
pkgmap = {}
if act:
return
def j(path):
faspac_contents = set()
# We accept either bz2 or 7zip'd files
for x in [".bz2", ".7z"]:
break
ci.extractfile())
if act:
# Remove BASEDIR from a relocatable path. The extra work is
# because if BASEDIR is not empty (non-"/"), then we probably
# need to strip an extra slash from the beginning of the path,
# but if BASEDIR is "" ("/" in the pkginfo file), then we don't
# need to do anything extra.
if ptype == "i":
return path
return path[1:]
if p[0] == "/":
p = p[1:]
return p
# Just do the files that remain. Only regular file
# types end up compressed; so skip them and only them.
# Files with special characters in their names may not
# end up in the faspac archive, so we still need to emit
# the ones that aren't.
p.pathname in faspac_contents:
continue
# These are the only valid file types in SysV packages
if p.type in "ifevbcdxpls":
if p.type == "i":
d = "install"
d = "root"
else:
d = "reloc"
if act:
# This relies on the fact that
# license actions have their
# hash set to the package path.
else:
yield entry[-1]
preserve_dict = {
"renameold": "renameold",
"renamenew": "renamenew",
"preserve": "true",
"svmpreserve": "true"
}
act = None
# If any one of the mode, owner, or group is "?", then we're
# clearly not capable of delivering the object correctly, so
# ignore it.
return None
# Add a preserve attribute if klass is known to be used
# for preservation. For editable and volatile files,
# always do at least basic preservation.
if not preserve:
preserve = "true"
# check to see if we've seen this script
# before
pass
pass
else:
return None
else:
return act
"""Creates a list of pkg.action.AttributeActions corresponding
to pkginfo fields that aren't directly mapped to pkg(5)
equivalents."""
# these keys get converted to a legacy action
legacy_keys = [
"arch",
"category",
"name",
"desc",
"hotline",
"pkg",
"vendor",
"version"
]
# parameters defined in pkginfo(4) that we always ignore.
# by default, we also ignore SUNW_*
ignored_keys = [
"pstamp",
"pkginst",
"maxinst",
"classes",
"basedir",
"intonly",
"istates",
"order",
"rstates",
"ulimit",
# XXX pkg.sysvpkg adds this, ignoring for now.
"pkg.plat",
]
actions = []
continue
continue
legacy_attrs = {}
if name in legacy_keys:
if "DESC" in pkginfo:
if "NAME" in pkginfo:
return actions
return True
return False