[source] build: add template for getting opkg package files from package names

LEDE Commits lede-commits at lists.infradead.org
Fri Jul 29 04:38:05 PDT 2016


nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/?p=source.git;a=commitdiff;h=731b166528658e0b89f6bd0e589f029eb665f7a6

commit 731b166528658e0b89f6bd0e589f029eb665f7a6
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Fri Jul 22 12:22:16 2016 +0200

    build: add template for getting opkg package files from package names
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 include/rootfs.mk | 3 +++
 package/Makefile  | 6 +-----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/include/rootfs.mk b/include/rootfs.mk
index 90ee312..2143ef8 100644
--- a/include/rootfs.mk
+++ b/include/rootfs.mk
@@ -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 \
diff --git a/package/Makefile b/package/Makefile
index 87dfe68..f5a7395 100644
--- a/package/Makefile
+++ b/package/Makefile
@@ -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 \



More information about the lede-commits mailing list