build: improve feed handling for opkg.conf
authorJo-Philipp Wich <jow@openwrt.org>
Thu, 16 Oct 2014 10:30:16 +0000 (10:30 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Thu, 16 Oct 2014 10:30:16 +0000 (10:30 +0000)
 - Consider not installed feeds as well
 - Add option to decide whether to comment disabled feeds

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

include/feeds.mk
package/base-files/image-config.in
package/system/opkg/Makefile

index 97b14491f0d538024e17c7f77ac6782698c620db..695b03b145e8046b6a4d0b94d0632066cad51989 100644 (file)
 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_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 \
 
 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
        $(foreach feed,$(FEEDS_INSTALLED),CONFIG_FEED_$(feed))
 
 # 1: package name
index 67604cdd54f1a4575918697fe0312514acbe9c0d..c679a5b33a9f4fe8d3390458cf5128e4847c370a 100644 (file)
@@ -217,11 +217,18 @@ menuconfig PER_FEED_REPO
                for the core packages and each enabled feed.
 
        config PER_FEED_REPO_ADD_DISABLED
                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
                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"
 
 
 source "tmp/.config-feeds.in"
 
index 8a63fb4352c648cef58c03ee6f02950a7d2030d5..6dd3f318185f9d153944c3d4803ff15995afa71b 100644 (file)
@@ -113,7 +113,7 @@ define Package/opkg/Default/install
        done
     ifneq ($(CONFIG_PER_FEED_REPO_ADD_DISABLED),)
        for d in $(FEEDS_DISABLED); do \
        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
        done
     endif
   endif