[source] build: create a package feed directory containing all packages

LEDE Commits lede-commits at lists.infradead.org
Mon Aug 1 02:16:11 PDT 2016


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

commit 180465c38f1599f7339a00f80b383620c7c3818d
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Mon Aug 1 11:12:15 2016 +0200

    build: create a package feed directory containing all packages
    
    Needed for proper dependency handling for per-device rootfs
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 include/feeds.mk |  2 ++
 package/Makefile | 10 +++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/include/feeds.mk b/include/feeds.mk
index 4ca7b3a..cbb3997 100644
--- a/include/feeds.mk
+++ b/include/feeds.mk
@@ -23,6 +23,8 @@ ifneq ($(CONFIG_PER_FEED_REPO),)
   endif
 endif
 
+PACKAGE_DIR_ALL := $(PACKAGE_DIR)_all
+
 PKG_CONFIG_DEPENDS += \
 	CONFIG_PER_FEED_REPO \
 	CONFIG_PER_FEED_REPO_ADD_DISABLED \
diff --git a/package/Makefile b/package/Makefile
index f5a7395..9f39395 100644
--- a/package/Makefile
+++ b/package/Makefile
@@ -44,7 +44,15 @@ PACKAGE_INSTALL_FILES:= \
 $(curdir)/cleanup: $(TMP_DIR)/.build
 	rm -rf $(STAGING_DIR_ROOT)
 
-$(curdir)/install: $(TMP_DIR)/.build $(curdir)/system/opkg/host/install
+$(curdir)/merge:
+	rm -rf $(PACKAGE_DIR_ALL)
+	mkdir -p $(PACKAGE_DIR_ALL)
+	-$(foreach pdir,$(PACKAGE_SUBDIRS),$(if $(wildcard $(pdir)/*.ipk),ln -s $(pdir)/*.ipk $(PACKAGE_DIR_ALL);))
+
+$(curdir)/merge-index: $(curdir)/merge
+	(cd $(PACKAGE_DIR_ALL) && $(SCRIPT_DIR)/ipkg-make-index.sh . 2>&1 > Packages; )
+
+$(curdir)/install: $(TMP_DIR)/.build $(curdir)/system/opkg/host/install $(curdir)/merge $(if $(CONFIG_TARGET_PER_DEVICE_ROOTFS),$(curdir)/merge-index)
 	- find $(STAGING_DIR_ROOT) -type d | $(XARGS) chmod 0755
 	rm -rf $(TARGET_DIR)
 	[ -d $(TARGET_DIR)/tmp ] || mkdir -p $(TARGET_DIR)/tmp



More information about the lede-commits mailing list