diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2015-05-28 09:47:37 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2015-05-28 09:47:37 +0000 |
commit | ace825551c2dc07a621149451f987a1baf92b9da (patch) | |
tree | 7eac3005729b61c286fe41e2a4f158e83f40ba06 | |
parent | 99b93333557037a9177d1a4c60df2d67ad2126e5 (diff) | |
download | upstream-ace825551c2dc07a621149451f987a1baf92b9da.tar.gz upstream-ace825551c2dc07a621149451f987a1baf92b9da.tar.bz2 upstream-ace825551c2dc07a621149451f987a1baf92b9da.zip |
feeds: use common macro "FeedSourcesAppend" to populate opkg configurations
This introduces a common macro to assemble the correct url templates to
avoid code duplication and have the feed config handling in a central place.
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@45799 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r-- | include/feeds.mk | 13 | ||||
-rw-r--r-- | package/system/opkg/Makefile | 13 | ||||
-rw-r--r-- | target/imagebuilder/Makefile | 14 |
3 files changed, 16 insertions, 24 deletions
diff --git a/include/feeds.mk b/include/feeds.mk index 695b03b145..b1a8f81da9 100644 --- a/include/feeds.mk +++ b/include/feeds.mk @@ -24,3 +24,16 @@ $(strip $(if $(CONFIG_PER_FEED_REPO), \ $(abspath $(PACKAGE_DIR)/$(if $(Package/$(1)/feed),$(Package/$(1)/feed),base)), \ $(PACKAGE_DIR))) endef + +# 1: destination file +define FeedSourcesAppend +( \ + $(strip $(if $(CONFIG_PER_FEED_REPO), \ + $(foreach feed,base $(FEEDS_ENABLED),echo "src/gz %n_$(feed) %U/$(feed)";) \ + $(if $(CONFIG_PER_FEED_REPO_ADD_DISABLED), \ + $(foreach feed,$(FEEDS_DISABLED),echo "$(if $(CONFIG_PER_FEED_REPO_ADD_COMMENTED),# )src/gz %n_$(feed) %U/$(feed)";)) \ + , \ + echo "src/gz %n %U"; \ + )) \ +) >> $(1) +endef diff --git a/package/system/opkg/Makefile b/package/system/opkg/Makefile index 1b1f3f19e4..d313c442dd 100644 --- a/package/system/opkg/Makefile +++ b/package/system/opkg/Makefile @@ -115,18 +115,7 @@ define Package/opkg/Default/install ifneq ($(CONFIG_SIGNED_PACKAGES),) echo "option check_signature 1" >> $(1)/etc/opkg.conf endif - ifeq ($(CONFIG_PER_FEED_REPO),) - echo "src/gz %n %U" >> $(1)/etc/opkg.conf - else - for d in base $(FEEDS_ENABLED); do \ - echo "src/gz %n_$$$$d %U/$$$$d" >> $(1)/etc/opkg.conf; \ - done - ifneq ($(CONFIG_PER_FEED_REPO_ADD_DISABLED),) - for d in $(FEEDS_DISABLED); do \ - echo "$(if $(CONFIG_PER_FEED_REPO_ADD_COMMENTED),# )src/gz %n_$$$$d %U/$$$$d" >> $(1)/etc/opkg.conf; \ - done - endif - endif + $(call FeedSourcesAppend,$(1)/etc/opkg.conf) $(VERSION_SED) $(1)/etc/opkg.conf $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/opkg-cl $(1)/bin/opkg endef diff --git a/target/imagebuilder/Makefile b/target/imagebuilder/Makefile index 218def7e1d..7f48ed885f 100644 --- a/target/imagebuilder/Makefile +++ b/target/imagebuilder/Makefile @@ -37,20 +37,10 @@ $(BIN_DIR)/$(IB_NAME).tar.bz2: clean ifeq ($(CONFIG_IB_STANDALONE),) echo '## Remote package repositories' >> $(PKG_BUILD_DIR)/repositories.conf - ifeq ($(CONFIG_PER_FEED_REPO),) - echo "src/gz %n %U" >> $(PKG_BUILD_DIR)/repositories.conf - else - for d in base $(FEEDS_ENABLED); do \ - echo "src/gz %n_$$d %U/$$d" >> $(PKG_BUILD_DIR)/repositories.conf; \ - done - ifneq ($(CONFIG_PER_FEED_REPO_ADD_DISABLED),) - for d in $(FEEDS_DISABLED); do \ - echo "$(if $(CONFIG_PER_FEED_REPO_ADD_COMMENTED),# )src/gz %n_$$d %U/$$d" >> $(PKG_BUILD_DIR)/repositories.conf; \ - done - endif - endif + $(call FeedSourcesAppend,$(PKG_BUILD_DIR)/repositories.conf) endif + echo '' >> $(PKG_BUILD_DIR)/repositories.conf echo '## This is the local package repository, do not remove!' >> $(PKG_BUILD_DIR)/repositories.conf echo 'src imagebuilder file:packages' >> $(PKG_BUILD_DIR)/repositories.conf |