build: add whatdepends target to imagebuilder
authorPaul Spooren <mail@aparcar.org>
Fri, 21 Aug 2020 01:44:51 +0000 (15:44 -1000)
committerDaniel Golle <daniel@makrotopia.org>
Mon, 31 Aug 2020 10:18:24 +0000 (11:18 +0100)
The package manager `opkg` offers the function `whatdepends` to print
packages that depend on a specific package.

This feature is useful when used in a CI to not only build an upgraded
package but all packages with a dependency.

Usage:
    make whatdepends PACKAGE=libipset

The resulting list can be fed into a SDK building all packages and warn
if anything fails.

Signed-off-by: Paul Spooren <mail@aparcar.org>
target/imagebuilder/files/Makefile

index 326dd2ba2f83268398df1fab8a57d109f1b1391a..27d3cfa8dfd5e5b7de0465db2ebff277e2040a14 100644 (file)
@@ -220,4 +220,12 @@ manifest: FORCE
                $(if $(PROFILE),USER_PROFILE="$(PROFILE_FILTER)") \
                $(if $(PACKAGES),USER_PACKAGES="$(PACKAGES)"))
 
-.SILENT: help info image manifest
+whatdepends: FORCE
+ifeq ($(PACKAGE),)
+       @echo 'Variable `PACKAGE` is not set but required by `whatdepends`'
+       @exit 1
+endif
+       @$(MAKE) -s package_reload
+       @$(OPKG) whatdepends -A $(PACKAGE)
+
+.SILENT: help info image manifest whatdepends