pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk mk: add show-depends-all



details:   https://anonhg.NetBSD.org/pkgsrc/rev/f0459fc6b0ef
branches:  trunk
changeset: 376508:f0459fc6b0ef
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat Apr 09 00:46:12 2022 +0000

description:
mk: add show-depends-all

Previously, there was no easy way to list all dependencies of a package.
The target show-depends only lists the direct missing dependencies, the
target show-depends-dirs lists all direct dependencies, but neither
lists the indirect dependencies as well.  The newly added target
show-depends-all includes the indirect dependencies.

While here, document the existing targets since they differ subtly.

https://mail-index.netbsd.org/pkgsrc-users/2022/04/07/msg035444.html

diffstat:

 mk/bsd.utils.mk           |  54 +++++++++++++++++++++++++++++++++++++++++++---
 mk/depends/bsd.depends.mk |  11 +++++++-
 2 files changed, 59 insertions(+), 6 deletions(-)

diffs (108 lines):

diff -r 55e10504a4cc -r f0459fc6b0ef mk/bsd.utils.mk
--- a/mk/bsd.utils.mk   Sat Apr 09 00:37:02 2022 +0000
+++ b/mk/bsd.utils.mk   Sat Apr 09 00:46:12 2022 +0000
@@ -1,13 +1,28 @@
-# $NetBSD: bsd.utils.mk,v 1.12 2018/01/25 00:33:56 joerg Exp $
+# $NetBSD: bsd.utils.mk,v 1.13 2022/04/09 00:46:12 rillig Exp $
 #
 # This Makefile fragment is included by bsd.pkg.mk and defines utility
 # and otherwise miscellaneous variables and targets.
 #
 
-# DEPENDS_TYPE is used by the "show-depends-pkgpaths" target and specifies
-# which class of dependencies to output.  The special value "all" means
-# to output every dependency.
+# DEPENDS_TYPE
+#      Used by the "show-depends-pkgpaths" target to specify which
+#      class of direct dependencies to output.  The special value "all"
+#      means to output every dependency.
 #
+#      Possible:
+#              all             = build
+#                              + TEST_DEPENDS (if PKGSRC_RUN_TEST)
+#                              + install
+#              build           = BOOTSTRAP_DEPENDS
+#                              + TOOL_DEPENDS
+#                              + BUILD_DEPENDS
+#              install         = DEPENDS
+#              package         XXX: same as install?
+#
+#      Default:
+#              all
+#
+# Keywords: depends dependencies
 DEPENDS_TYPE?=  all
 .if !empty(DEPENDS_TYPE:Mbuild) || !empty(DEPENDS_TYPE:Mall)
 _ALL_DEPENDS+= ${BOOTSTRAP_DEPENDS} ${BUILD_DEPENDS} ${TOOL_DEPENDS}
@@ -28,6 +43,20 @@
                PWD_CMD=${TOOLS_PWD_CMD:Q} TEST=${TOOLS_TEST:Q}         \
        ${SH} ${.CURDIR}/../../mk/scripts/pkg_path
 
+# show-depends-dirs:
+# show-depends-pkgpaths:
+#      Lists the PKGPATH of all direct dependencies of the current
+#      package.
+#
+#      Parameters:
+#              PKGSRC_RUN_TEST
+#                      Whether to include test dependencies as well.
+#
+#      See also:
+#              show-depends
+#              show-depends-all
+#
+# Keywords: depends dependencies
 .PHONY: show-depends-dirs show-depends-pkgpaths
 show-depends-dirs show-depends-pkgpaths:
        @${_PKG_PATHS_CMD} ${_ALL_DEPENDS:C/^[^:]*://:O:u}
@@ -43,3 +72,20 @@
                MAKEFLAGS=${_DEPENDS_WALK_MAKEFLAGS:Q}                  \
                PKGSRCDIR=${PKGSRCDIR:Q} TEST=${TOOLS_TEST:Q}           \
        ${AWK} -f ${.CURDIR}/../../mk/scripts/depends-depth-first.awk --
+
+# show-depends-all:
+#      Lists the PKGPATH of all direct or indirect dependencies of the
+#      current package.
+#
+#      Parameters:
+#              DEPENDS_TYPE
+#                      all, build, install or package
+#              PKGSRC_RUN_TEST
+#                      Whether to include test dependencies as well.
+#
+#      See also:
+#              show-depends
+#              show-depends-pkgpaths
+# Keywords: depends dependencies recursive indirect
+show-depends-all: .PHONY
+       ${RUN} ${_DEPENDS_WALK_CMD} ${PKGPATH}
diff -r 55e10504a4cc -r f0459fc6b0ef mk/depends/bsd.depends.mk
--- a/mk/depends/bsd.depends.mk Sat Apr 09 00:37:02 2022 +0000
+++ b/mk/depends/bsd.depends.mk Sat Apr 09 00:46:12 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.depends.mk,v 1.30 2019/05/07 19:36:44 rillig Exp $
+# $NetBSD: bsd.depends.mk,v 1.31 2022/04/09 00:46:12 rillig Exp $
 #
 # This Makefile fragment is included by bsd.pkg.mk and provides all
 # variables and targets related to dependencies.
@@ -129,12 +129,19 @@
        ${RUN}${TOUCH} ${TOUCH_ARGS} ${_COOKIE.depends}
 
 # show-depends:
-#      Prints a list of dependencies.
+#      Prints the dependencies that need to be installed before this
+#      package can be installed.  Each line of the output has the format
+#      'dependency:directory', as in DEPENDS and the related variables.
 #
 #      Command line variables:
 #
 #      VARNAME
 #              DEPENDS, BUILD_DEPENDS, TEST_DEPENDS, or TOOL_DEPENDS.
 #
+# See also:
+#      show-depends-pkgpaths   Prints the PKGPATH of all direct dependencies.
+#      show-depends-all        Prints the PKGPATH of all direct and
+#                              indirect dependencies.
+#
 # Keywords: depends dependencies
 show-depends: .PHONY _pkgformat-show-depends



Home | Main Index | Thread Index | Old Index