Aurelien Larcher
2020-06-08 0ae59240438dd3d82650d02e905008e0f84cb90c
userland: add rule to print depend require actions
1 files added
1 files modified
50 ■■■■■ changed files
make-rules/ips.mk 21 ●●●●● patch | view | raw | blame | history
transforms/print-depend-require 29 ●●●●● patch | view | raw | blame | history
make-rules/ips.mk
@@ -151,6 +151,23 @@
HISTORICAL_MANIFESTS = $(shell $(NAWK) -v FUNCTION=name -f $(GENERATE_HISTORY) < $(HISTORY))
endif
define ips-print-depend-require-rule
$(shell cat $(1) $(WS_TOP)/transforms/print-depend-require |\
    $(PKGMOGRIFY) $(PKG_OPTIONS) /dev/fd/0 |\
    sed -e '/^$$/d' -e '/^#.*$$/d' | sort -u)
endef
define ips-print-depend-require-versioned-rule
$(foreach v,$($(1)V_VALUES),\
    $(shell cat $(2) $(WS_TOP)/transforms/print-pkgs |\
    $(PKGMOGRIFY) $(PKG_OPTIONS) -D $($(1)V_FMRI_VERSION)=$(v) /dev/fd/0 |\
    sed -e '/^$$/d' -e '/^#.*$$/d' | sort -u))
endef
define ips-print-depend-require-type-rule
$(foreach m,$($(1)_MANIFESTS),$(call ips-print-depend-require-versioned-rule,$(1),$(m)))
endef
define ips-print-names-rule
$(shell cat $(1) $(WS_TOP)/transforms/print-pkgs |\
    $(PKGMOGRIFY) $(PKG_OPTIONS) /dev/fd/0 |\
@@ -524,6 +541,10 @@
$(BUILD_DIR)/.published-$(MACH):    $(PUBLISHED)
    $(TOUCH) $@
print-depend-require:    canonical-manifests
    @echo $(call ips-print-depend-require-rule,$(NONVER_MANIFESTS)) \
        $(foreach t,$(VERSIONED_MANIFEST_TYPES),$(call ips-print-depend-require-type-rule,$(t))) | tr ' ' '\n'
print-package-names:    canonical-manifests $(MKGENERIC_SCRIPTS)
    @echo $(call ips-print-names-rule,$(NONVER_MANIFESTS)) \
        $(foreach t,$(VERSIONED_MANIFEST_TYPES),\
transforms/print-depend-require
New file
@@ -0,0 +1,29 @@
#
# 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
# or http://www.opensolaris.org/os/licensing.
# 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
#
# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
#
#
# These transforms print only the package name from the manifest.
#
<transform depend type=require fmri=(pkg:/)?(.+)@?.* -> print %<2> >
<transform -> drop>