BB: build: improve feed handling for opkg.conf

- Consider not installed feeds as well
 - Add option to decide whether to comment disabled feeds

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

Backport of r42931

git-svn-id: svn://svn.openwrt.org/openwrt/branches/barrier_breaker@44441 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
jow 2015-02-13 11:59:16 +00:00
parent 4ae7fc39a5
commit edefd1ad42
3 changed files with 13 additions and 4 deletions

View File

@ -10,10 +10,12 @@
FEEDS_AVAILABLE:=$(shell $(SCRIPT_DIR)/feeds list -n)
FEEDS_INSTALLED:=$(notdir $(wildcard $(TOPDIR)/package/feeds/*))
FEEDS_ENABLED:=$(foreach feed,$(FEEDS_INSTALLED),$(if $(CONFIG_FEED_$(feed)),$(feed)))
FEEDS_DISABLED:=$(filter-out $(FEEDS_ENABLED),$(FEEDS_INSTALLED))
FEEDS_DISABLED:=$(filter-out $(FEEDS_ENABLED),$(FEEDS_AVAILABLE))
PKG_CONFIG_DEPENDS += \
CONFIG_PER_FEED_REPO \
CONFIG_PER_FEED_REPO_ADD_DISABLED \
CONFIG_PER_FEED_REPO_ADD_COMMENTED \
$(foreach feed,$(FEEDS_INSTALLED),CONFIG_FEED_$(feed))
# 1: package name

View File

@ -217,11 +217,18 @@ menuconfig PER_FEED_REPO
for the core packages and each enabled feed.
config PER_FEED_REPO_ADD_DISABLED
bool "Add installed but disabled feeds to opkg.conf"
bool "Add available but not enabled feeds to opkg.conf"
default y
depends on PER_FEED_REPO
help
Add installed but disabled feeds as commented out source lines to opkg.conf.
Add not installed or disabled feeds from feeds.conf to opkg.conf.
config PER_FEED_REPO_ADD_COMMENTED
bool "Comment out not enabled feeds"
default y
depends on PER_FEED_REPO && PER_FEED_REPO_ADD_DISABLED
help
Add not enabled feeds as commented out source lines to opkg.conf.
source "tmp/.config-feeds.in"

View File

@ -113,7 +113,7 @@ define Package/opkg/Default/install
done
ifneq ($(CONFIG_PER_FEED_REPO_ADD_DISABLED),)
for d in $(FEEDS_DISABLED); do \
echo "# src/gz %n_$$$$d %U/$$$$d" >> $(1)/etc/opkg.conf; \
echo "$(if $(CONFIG_PER_FEED_REPO_ADD_COMMENTED),# )src/gz %n_$$$$d %U/$$$$d" >> $(1)/etc/opkg.conf; \
done
endif
endif