userland.py revision 1923
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] 1531N/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")
1531N/A # These lists are used to check if a 32/64-bit binary 1531N/A # is in a proper 32/64-bit directory. 1531N/A "i86pc-solaris-64int",
# perl path 1531N/A "sun4-solaris-64int" # perl path 1531N/A "i86pc-solaris-64",
# perl path 1531N/A "sun4-solaris-64" # perl path 186N/A """Initialize the checker with a dictionary of paths, so that we 186N/A can do link resolution. 186N/A This is copied from the core pkglint code, but should eventually 186N/A """Updates a dictionary of { attr: [(fmri, action), ..]} 186N/A where attr is the value of that attribute from 186N/A actions of a given type atype, in the given 186N/A # construct a set of FMRIs being presented for linting, and 186N/A # avoid seeding the reference dictionary with any for which 186N/A # we're delivering new packages. 186N/A _(
"Seeding reference action path dictionaries."))
186N/A # Only put this manifest into the reference dictionary 186N/A # if it's not an older version of the same package. 186N/A _(
"Seeding lint action path dictionaries."))
186N/A # we provide a search pattern, to allow users to lint a 186N/A # subset of the packages in the lint_repository 186N/A _(
"Seeding local action path dictionaries."))
186N/A """Merges the given src dictionary into the target 186N/A dictionary, giving us the target content as it would appear, 186N/A were the packages in src to get published to the 186N/A repositories that made up target. 186N/A We need to only merge packages at the same or successive 186N/A version from the src dictionary into the target dictionary. 186N/A If the src dictionary contains a package with no version 186N/A information, it is assumed to be more recent than the same 186N/A package with no version in the target.""" 186N/A """Builds a dictionary of fmri:action entries""" 186N/A # we want to remove entries deemed older than 186N/A # src_pfmri from targ_dic. 84N/A """Combine path and target to get the real path.""" 634N/A _(
"64-bit runpath in 32-bit binary, '%s' includes '%s'") % (
path,
dir),
634N/A _(
"32-bit runpath in 64-bit binary, '%s' includes '%s'") % (
path,
dir),
495N/A # ignore 64-bit executables in normal (non-32-bit-specific) 495N/A # locations, that's ok now. 45N/A """Checks for existence in the proto area.""" 84N/A # check for writable files without a preserve attribute 84N/A _(
"%(path)s is writable (%(mode)s), but missing a preserve" 145N/A _(
"%(path)s has a preserve action, but is not writable (%(mode)s)") % {
"path":
path,
"mode":
mode},
145N/A _(
"%(path)s has a preserve action, but no mode") % {
"path":
path,
"mode":
mode},
84N/A # checks that require a physical file to look at 84N/A _(
"%s missing from proto area, skipping" 84N/A # 32/64 bit in wrong place 84N/A """Checks for link resolution.""" 186N/A # Check against the target image (ref_paths), since links might 186N/A # resolve outside the packages delivering a particular 1923N/A # links to files should directly match a patch in the reference 1923N/A # If it didn't match a path in the reference repo, it may still 1923N/A # be a link to a directory that has no action because it uses 1923N/A # the default attributes. Look for a path that starts with 1923N/A # this value plus a trailing slash to be sure this it will be 1923N/A # resolvable on a fully installed system. 84N/A """Checks for SVR4 startup scripts.""" 84N/A _(
"SVR4 startup '%s', deliver SMF" 84N/A "SVR4 startup scripts should not be delivered.")
45N/A """An opensolaris.org-specific class to check manifests.""" 464N/A "license actions and ARC information are required if you deliver files.")