userland.py revision 1531
45N/A# The contents of this file are subject to the terms of the 45N/A# Common Development and Distribution License (the "License"). 45N/A# You may not use this file except in compliance with the License. 45N/A# See the License for the specific language governing permissions 45N/A# and limitations under the License. 45N/A# When distributing Covered Code, include this CDDL HEADER in each 45N/A# If applicable, add the following below this CDDL HEADER, with the 45N/A# fields enclosed by brackets "[]" replaced with your own identifying 45N/A# information: Portions Copyright [yyyy] [name of copyright owner] 84N/A# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. 45N/A# Some userland consolidation specific lint checks 45N/A """An opensolaris.org-specific class to check actions.""" 45N/A "checks Userland packages for common content errors")
84N/A # These lists are used to check if a 32/64-bit binary 45N/A # is in a proper 32/64-bit directory. 84N/A "i86pc-solaris-64int",
# perl path 84N/A "sun4-solaris-64int" # perl path 84N/A "i86pc-solaris-64",
# perl path 84N/A "sun4-solaris-64" # perl path 84N/A """Initialize the checker with a dictionary of paths, so that we 84N/A can do link resolution. 84N/A This is copied from the core pkglint code, but should eventually 84N/A """Updates a dictionary of { attr: [(fmri, action), ..]} 84N/A where attr is the value of that attribute from 84N/A actions of a given type atype, in the given 84N/A # construct a set of FMRIs being presented for linting, and 84N/A # avoid seeding the reference dictionary with any for which 84N/A # we're delivering new packages. 84N/A _(
"Seeding reference action path dictionaries."))
84N/A # Only put this manifest into the reference dictionary 84N/A # if it's not an older version of the same package. 84N/A _(
"Seeding lint action path dictionaries."))
84N/A # we provide a search pattern, to allow users to lint a 84N/A # subset of the packages in the lint_repository 84N/A _(
"Seeding local action path dictionaries."))
84N/A """Merges the given src dictionary into the target 84N/A dictionary, giving us the target content as it would appear, 84N/A were the packages in src to get published to the 84N/A repositories that made up target. 84N/A We need to only merge packages at the same or successive 84N/A version from the src dictionary into the target dictionary. 84N/A If the src dictionary contains a package with no version 84N/A information, it is assumed to be more recent than the same 84N/A package with no version in the target.""" 84N/A """Builds a dictionary of fmri:action entries""" 84N/A # we want to remove entries deemed older than 84N/A # src_pfmri from targ_dic. 84N/A """Combine path and target to get the real path.""" _(
"64-bit runpath in 32-bit binary, '%s' includes '%s'") % (
path,
dir),
_(
"32-bit runpath in 64-bit binary, '%s' includes '%s'") % (
path,
dir),
result = _(
"bad RUNPATH, '%%s' includes '%s'" %
# ignore 64-bit executables in normal (non-32-bit-specific) # locations, that's ok now. result = _(
"32-bit object '%s' in 64-bit path")
result = _(
"64-bit object '%s' in 32-bit path")
"""Checks for existence in the proto area.""" # check for writable files without a preserve attribute _(
"%(path)s is writable (%(mode)s), but missing a preserve" " attribute") % {
"path":
path,
"mode":
mode},
_(
"%(path)s has a preserve action, but is not writable (%(mode)s)") % {
"path":
path,
"mode":
mode},
_(
"%(path)s has a preserve action, but no mode") % {
"path":
path,
"mode":
mode},
# checks that require a physical file to look at _(
"%s missing from proto area, skipping" " content checks") %
path,
# 32/64 bit in wrong place """Checks for link resolution.""" # Check against the target image (ref_paths), since links might # resolve outside the packages delivering a particular _(
"%s %s has unresolvable target '%s'") %
"""Checks for SVR4 startup scripts.""" if action.
name not in [
"file",
"dir",
"link",
"hardlink"]:
_(
"SVR4 startup '%s', deliver SMF" " service instead") %
path,
"SVR4 startup scripts should not be delivered.")
"""An opensolaris.org-specific class to check manifests.""" name =
"userland.manifest" if 'org.opensolaris.arc-caseid' not in manifest:
engine.
error( _(
"missing ARC data (org.opensolaris.arc-caseid)"),
"license actions and ARC information are required if you deliver files.")