#
# 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
import stat
typemap = {
}
"""XXX Need a class comment."""
# map the path name to the SVR4 class it belongs to and
# scripts this package uses.
self.class_actions_dir = {}
# SolarisPackage.manifest is a list. Cache it into a dictionary
# based on pathname. The cpio archive contains the files as
# they would be in the directory structure -- that is, under
# install, reloc, or root, depending on whether they're i-type
# files, relocatable files, or unrelocatable files. Make sure
# we find the right object, even though the filenames in the
# package map don't have these directory names.
if p.type in "fevdsl":
d = "root"
else:
d = "reloc/"
elif p.type == "i":
# for some reason, some packages may have directories specified
# in the pkgmap that don't exist in the archive. They need to
# be found and iterated as well.
#
# Some of the blastwave packages also have directories in the
# archive that don't exist in the package metadata. I don't see
# a whole lot of point in faking those up.
if p.type not in "lsd":
continue
d = "root"
else:
d = "reloc/"
p.type in "ls":
"""Iterate through the datastream.
This is different than the directory-format package bundle,
which iterates through the package map. We do it this way
because the cpio archive might not be in the same order as
the package map, and we want never to seek backwards. This
implies that we're going to have to look up the meta info for
each file from the package map. We could get the file type
from the archive, but it's probably safe to assume that the
file type in the archive is the same as the file type in the
package map.
"""
yield data
continue
if act:
yield act
try:
except KeyError:
# XXX Return an unknown instead of a missing, for now.
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
# false positive
# file-builtin; pylint: disable=W1607
# check to see if we've seen this script
# before
pass
pass
else:
return None
else:
return act
return False
try:
return True
except MultiPackageDatastreamException:
raise InvalidBundleException(
_("Multi-package datastreams are not supported.\n"
"Please use pkgtrans(1) to convert this bundle to "
"multiple\nfilesystem format packages."))
except:
return False