Add encumbered packages logic
3 files added
5 files modified
| | |
| | | # Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. |
| | | # |
| | | |
| | | include ../make-rules/shared-macros.mk |
| | | -include ../make-rules/shared-macros.mk |
| | | |
| | | # for now, the assumption is we build any directory with a Makefile. This may |
| | | # not always be the case. If we build a new make-like tool to drive the upper |
| | |
| | | | sed -f components.ignore \ |
| | | | sed -e 's;^;COMPONENT_DIRS += ;g' >$@ |
| | | |
| | | -include components.mk |
| | | -include $(WS_TOP)/components/$(ENCUMBERED)components.mk |
| | | |
| | | # depends.mk is auto-generated by concatenating 'depend.mk' files in each |
| | | # component directory. |
| | |
| | | | sed -e 's;$$;/depend.mk;g') >$@ \ |
| | | 2>/dev/null |
| | | |
| | | -include depends.mk |
| | | -include $(WS_TOP)/components/$(ENCUMBERED)depends.mk |
| | | |
| | | |
| | | download: TARGET = download |
| | |
| | | $(RM) components.mk depends.mk .profile |
| | | |
| | | clobber: $(COMPONENT_DIRS.nosetup) clean |
| | | @cd ../tools ; echo "clobbering tools..." ; $(GMAKE) clobber |
| | | @cd $(WS_TOP)/tools ; echo "clobbering tools..." ; $(GMAKE) clobber |
| | | $(RM) -r $(WS_REPO) $(WS_LOGS) $(WS_LINT_CACHE) |
| | | |
| | | |
| | |
| | | endif |
| | | |
| | | tools: |
| | | @cd ../tools ; echo "building tools..." ; $(GMAKE) clean setup |
| | | @cd $(WS_TOP)/tools ; echo "building tools..." ; $(GMAKE) clean setup |
| | | |
| | | # $(WS_COMPONENTS) is the home directory for the zone user, so create a profile |
| | | # to pass a few things on to zone based builds |
| | |
| | | # skip libm, it should be delivered by illumos-gate now |
| | | /^osol\/math$/d |
| | | |
| | | # Don't publish encumbered packages by default |
| | | /^encumbered\//d |
| | | |
| | | /^areca$/d |
| | | /^beanshell$/d |
| | | /^clisp$/d |
New file |
| | |
| | | # |
| | | # This file and its contents are supplied under the terms of the |
| | | # Common Development and Distribution License ("CDDL"), version 1.0. |
| | | # You may only use this file in accordance with the terms of version |
| | | # 1.0 of the CDDL. |
| | | # |
| | | # A full copy of the text of the CDDL should have accompanied this |
| | | # source. A copy of the CDDL is also available via the Internet at |
| | | # http://www.illumos.org/license/CDDL. |
| | | # |
| | | |
| | | # |
| | | # Copyright 2015 Alexander Pyhalov |
| | | # |
| | | |
| | | include ../../make-rules/shared-macros.mk |
| | | |
| | | include $(WS_TOP)/make-rules/encumbered.mk |
| | | |
| | | include $(WS_TOP)/components/Makefile |
New file |
| | |
| | | # this is a sed script |
New file |
| | |
| | | # |
| | | # This file and its contents are supplied under the terms of the |
| | | # Common Development and Distribution License ("CDDL"), version 1.0. |
| | | # You may only use this file in accordance with the terms of version |
| | | # 1.0 of the CDDL. |
| | | # |
| | | # A full copy of the text of the CDDL should have accompanied this |
| | | # source. A copy of the CDDL is also available via the Internet at |
| | | # http://www.illumos.org/license/CDDL. |
| | | # |
| | | |
| | | # |
| | | # Copyright 2015 Alexander Pyhalov |
| | | # |
| | | |
| | | WS_REPO = $(WS_TOP)/$(MACH)/encumbered-repo |
| | | |
| | | COMPONENT_PKGLINT_ENV += ENCUMBERED=true |
| | | |
| | | PUBLISHER = hipster-encumbered |
| | | |
| | | BASS_O_MATIC = $(WS_TOOLS)/bass-o-matic --subdir=/components/encumbered |
| | | |
| | | ENCUMBERED = encumbered/ |
| | |
| | | # lint the manifests all at once |
| | | $(BUILD_DIR)/.linted-$(MACH): $(BUILD_DIR)/.resolved-$(MACH) |
| | | @echo "VALIDATING MANIFEST CONTENT: $(RESOLVED)" |
| | | $(ENV) PYTHONPATH=$(WS_TOOLS)/python PROTO_PATH="$(PKG_PROTO_DIRS)"\ |
| | | $(ENV) PYTHONPATH=$(WS_TOOLS)/python PROTO_PATH="$(PKG_PROTO_DIRS)" $(COMPONENT_PKGLINT_ENV)\ |
| | | $(PKGLINT) $(CANONICAL_REPO:%=-c $(WS_LINT_CACHE)) \ |
| | | -f $(WS_TOOLS)/pkglintrc $(RESOLVED) |
| | | $(TOUCH) $@ |
| | | |
| | | lintme: FRC |
| | | @echo "VALIDATING MANIFEST CONTENT: $(RESOLVED)" |
| | | $(ENV) PYTHONPATH=$(WS_TOOLS)/python PROTO_PATH="$(PKG_PROTO_DIRS)"\ |
| | | $(ENV) PYTHONPATH=$(WS_TOOLS)/python PROTO_PATH="$(PKG_PROTO_DIRS)" $(COMPONENT_PKGLINT_ENV)\ |
| | | $(PKGLINT) $(CANONICAL_REPO:%=-c $(WS_LINT_CACHE)) \ |
| | | -f $(WS_TOOLS)/pkglintrc $(RESOLVED) |
| | | |
| | |
| | | # Locate SCM directories containing Userland components by searching from |
| | | # from a supplied top of tree for .p5m files. Once a .p5m file is located, |
| | | # that directory is added to the list and no children are searched. |
| | | def FindComponentPaths(path, debug=None): |
| | | def FindComponentPaths(path, debug=None, subdir='/components'): |
| | | expression = re.compile(".+\.p5m$", re.IGNORECASE) |
| | | |
| | | paths = [] |
| | |
| | | if debug: |
| | | print >>debug, "searching %s for component directories" % path |
| | | |
| | | for dirpath, dirnames, filenames in os.walk(path + '/components'): |
| | | for dirpath, dirnames, filenames in os.walk(path + subdir): |
| | | found = 0 |
| | | |
| | | for name in filenames: |
| | |
| | | make_arg=None |
| | | component_arg=None |
| | | template_zone=None |
| | | subdir="/components" |
| | | workspace = os.getenv('WS_TOP') |
| | | |
| | | try: |
| | | opts, args = getopt.getopt(sys.argv[1:], "w:c:d", |
| | | [ "debug", "workspace=", "components=", |
| | | "make", "component=", "template-zone=" ]) |
| | | "make", "component=", "template-zone=", "subdir=" ]) |
| | | except getopt.GetoptError, err: |
| | | print str(err) |
| | | usage() |
| | |
| | | component_arg = arg |
| | | elif opt in [ "--template-zone" ]: |
| | | template_zone = arg |
| | | elif opt in [ "--subdir" ]: |
| | | subdir = arg |
| | | elif opt in [ "-d", "--debug" ]: |
| | | debug = sys.stdout |
| | | else: |
| | | assert False, "unknown option" |
| | | |
| | | component_paths = FindComponentPaths(workspace, debug) |
| | | component_paths = FindComponentPaths(workspace, debug, subdir) |
| | | |
| | | if make_arg: |
| | | if template_zone: |
| | |
| | | |
| | | import pkg.lint.base as base |
| | | from pkg.lint.engine import lint_fmri_successor |
| | | import pkg.fmri |
| | | import pkg.elf as elf |
| | | import re |
| | | import os.path |
| | | import subprocess |
| | | import pkg.client.api |
| | | import pkg.client.api_errors |
| | | import pkg.client.progress |
| | | |
| | | class UserlandActionChecker(base.ActionChecker): |
| | | """An opensolaris.org-specific class to check actions.""" |
| | |
| | | def __init__(self, config): |
| | | super(UserlandManifestChecker, self).__init__(config) |
| | | |
| | | def forbidden_publisher(self, manifest, engine, pkglint_id="1001"): |
| | | if not os.environ.get("ENCUMBERED"): |
| | | for action in manifest.gen_actions_by_type("depend"): |
| | | for f in action.attrlist("fmri"): |
| | | pkg_name=pkg.fmri.PkgFmri(f).pkg_name |
| | | info_needed = pkg.client.api.PackageInfo.ALL_OPTIONS - \ |
| | | (pkg.client.api.PackageInfo.ACTION_OPTIONS | |
| | | frozenset([pkg.client.api.PackageInfo.LICENSES])) |
| | | progtracker = pkg.client.progress.NullProgressTracker() |
| | | interface=pkg.client.api.ImageInterface("/", pkg.client.api.CURRENT_API_VERSION, progtracker, lambda x: False, None,None) |
| | | ret = interface.info([pkg_name],True,info_needed) |
| | | if ret[pkg.client.api.ImageInterface.INFO_FOUND]: |
| | | for i in ret[pkg.client.api.ImageInterface.INFO_FOUND]: |
| | | if i.publisher not in ("openindiana.org","userland","on-nightly"): |
| | | engine.error(_("package %(pkg)s depends on %(name)s, which comes from forbidden publisher %(publisher)s") % |
| | | {"pkg":manifest.fmri,"name":pkg_name,"publisher":i.publisher}, msgid="%s%s.1" % (self.name, pkglint_id)) |
| | | |
| | | forbidden_publisher.pkglint_dest = _( |
| | | "Dependencies should come from standard publishers" ) |
| | | |
| | | def component_check(self, manifest, engine, pkglint_id="001"): |
| | | manifest_paths = [] |
| | | files = False |