Rich Burridge
2012-10-18 34ca1f12fbebd08739446b36815fa389cdae0177
7030489 userland pkglint should check for publisher information in pkg.fmris
2 files modified
18 ■■■■ changed files
tools/pkglintrc 5 ●●●● patch | view | raw | blame | history
tools/python/pkglint/userland.py 13 ●●●●● patch | view | raw | blame | history
tools/pkglintrc
@@ -18,11 +18,14 @@
#
# CDDL HEADER END
#
# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
#
[pkglint]
pkglint.ext.content = pkglint.userland
# Used by the publisher_in_fmri method in .../tools/python/pkglint/userland.py
userland.manifest002.allowed_pubs = userland userland-localizable
# temporarily work around defect 18884
pkglint.exclude = pkg.lint.pkglint_manifest.PkgManifestChecker.variants
tools/python/pkglint/userland.py
@@ -21,7 +21,7 @@
#
#
# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
#
# Some userland consolidation specific lint checks
@@ -399,3 +399,14 @@
    component_check.pkglint_dest = _(
        "license actions and ARC information are required if you deliver files.")
        def publisher_in_fmri(self, manifest, engine, pkglint_id="002"):
                lint_id = "%s%s" % (self.name, pkglint_id)
                allowed_pubs = engine.get_param(
                    "%s.allowed_pubs" % lint_id).split(" ")
                fmri = manifest.fmri
                if fmri.publisher and fmri.publisher not in allowed_pubs:
                        engine.error(_("package %s has a publisher set!") %
                            manifest.fmri,
                            msgid="%s%s.2" % (self.name, pkglint_id))