[source] build: rework opkg command invocation

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


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

commit 5d30bf83039aa1089e70d8c80b6ad03ba92bfc2a
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Fri Jul 22 12:10:17 2016 +0200

    build: rework opkg command invocation
    
    Drop included $(XARGS), add support for passing target dir via parameter
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 include/rootfs.mk | 8 ++++----
 package/Makefile  | 9 +++++++--
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/include/rootfs.mk b/include/rootfs.mk
index 4b4482c..90ee312 100644
--- a/include/rootfs.mk
+++ b/include/rootfs.mk
@@ -34,11 +34,11 @@ ifdef CONFIG_USE_MKLIBS
 endif
 
 # where to build (and put) .ipk packages
-OPKG:= \
+opkg = \
   IPKG_NO_SCRIPT=1 \
-  IPKG_INSTROOT=$(TARGET_DIR) \
-  $(XARGS) $(STAGING_DIR_HOST)/bin/opkg \
-	--offline-root $(TARGET_DIR) \
+  IPKG_INSTROOT=$(1) \
+  $(STAGING_DIR_HOST)/bin/opkg \
+	--offline-root $(1) \
 	--force-depends \
 	--force-overwrite \
 	--force-postinstall \
diff --git a/package/Makefile b/package/Makefile
index 857c2eb..87dfe68 100644
--- a/package/Makefile
+++ b/package/Makefile
@@ -48,11 +48,16 @@ $(curdir)/install: $(TMP_DIR)/.build $(curdir)/system/opkg/host/install
 	- find $(STAGING_DIR_ROOT) -type d | $(XARGS) chmod 0755
 	rm -rf $(TARGET_DIR)
 	[ -d $(TARGET_DIR)/tmp ] || mkdir -p $(TARGET_DIR)/tmp
-	@echo $(wildcard $(foreach dir,$(PACKAGE_SUBDIRS),$(foreach pkg,$(shell cat $(PACKAGE_INSTALL_FILES) 2>/dev/null),$(dir)/$(pkg)_*.ipk))) | $(OPKG) install
+	$(call opkg,$(TARGET_DIR)) install \
+		$(wildcard \
+		  $(foreach dir,$(PACKAGE_SUBDIRS), \
+		    $(foreach pkg, \
+		      $(shell cat $(PACKAGE_INSTALL_FILES) 2>/dev/null), \
+		      $(dir)/$(pkg)_*.ipk)))
 	@for file in $(PACKAGE_INSTALL_FILES); do \
 		[ -s $$file.flags ] || continue; \
 		for flag in `cat $$file.flags`; do \
-			$(OPKG) flag $$flag < $$file; \
+			$(call opkg,$(TARGET_DIR)) flag $$flag `cat $$file`; \
 		done; \
 	done || true
 	@-$(MAKE) package/preconfig



More information about the lede-commits mailing list