SolarisPackageDirBundle.py revision 1955
#
# 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
class SolarisPackageDirBundle(object):
faspac = []
# Want to access the manifest as a dict.
pkgmap = {}
if act:
yield 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:
yield act
# Remove BASEDIR from the 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 type == "i":
return path
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 "fevbcdxpls":
if act:
yield act
elif p.type == "i":
if a:
yield a
preserve_dict = {
"renameold": "renameold",
"renamenew": "renamenew",
"preserve": "true",
"svmpreserve": "true"
}
# 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
return a
# for editable files, map klass onto IPS names; if match
# fails, make sure we at least preserve file
return None
else:
return True
return False