build: add template for getting opkg package files from package names
authorFelix Fietkau <nbd@nbd.name>
Fri, 22 Jul 2016 10:22:16 +0000 (12:22 +0200)
committerFelix Fietkau <nbd@nbd.name>
Fri, 29 Jul 2016 08:18:26 +0000 (10:18 +0200)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
include/rootfs.mk
package/Makefile

index 90ee3126195d6c43a518c95a55036229d46886a3..2143ef804d8b0d35d06fe0b87ffe242429068773 100644 (file)
@@ -47,6 +47,9 @@ opkg = \
        --add-arch all:100 \
        --add-arch $(if $(ARCH_PACKAGES),$(ARCH_PACKAGES),$(BOARD)):200
 
+opkg_package_files = $(wildcard \
+       $(foreach dir,$(PACKAGE_SUBDIRS), \
+         $(foreach pkg,$(1), $(dir)/$(pkg)_*.ipk)))
 
 define prepare_rootfs
        @if [ -d $(TOPDIR)/files ]; then \
index 87dfe68e06330e5a37daf32315468632b7244cac..f5a73956438b0212b4d41ac9172a2bdd67a3db6d 100644 (file)
@@ -49,11 +49,7 @@ $(curdir)/install: $(TMP_DIR)/.build $(curdir)/system/opkg/host/install
        rm -rf $(TARGET_DIR)
        [ -d $(TARGET_DIR)/tmp ] || mkdir -p $(TARGET_DIR)/tmp
        $(call opkg,$(TARGET_DIR)) install \
-               $(wildcard \
-                 $(foreach dir,$(PACKAGE_SUBDIRS), \
-                   $(foreach pkg, \
-                     $(shell cat $(PACKAGE_INSTALL_FILES) 2>/dev/null), \
-                     $(dir)/$(pkg)_*.ipk)))
+               $(call opkg_package_files,$(shell cat $(PACKAGE_INSTALL_FILES) 2>/dev/null))
        @for file in $(PACKAGE_INSTALL_FILES); do \
                [ -s $$file.flags ] || continue; \
                for flag in `cat $$file.flags`; do \