2 # Copyright (C) 2014 OpenWrt.org
3 # Copyright (C) 2016 LEDE Project
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
9 -include $(TMP_DIR)/.packagesubdirs
11 FEEDS_INSTALLED:=$(notdir $(wildcard $(TOPDIR)/package/feeds/*))
12 FEEDS_AVAILABLE:=$(sort $(FEEDS_INSTALLED) $(shell $(SCRIPT_DIR)/feeds list -n))
13 FEEDS_ENABLED:=$(foreach feed,$(FEEDS_AVAILABLE),$(if $(CONFIG_FEED_$(feed)),$(feed)))
14 FEEDS_DISABLED:=$(filter-out $(FEEDS_ENABLED),$(FEEDS_AVAILABLE))
16 PACKAGE_SUBDIRS=$(PACKAGE_DIR)
17 ifneq ($(CONFIG_PER_FEED_REPO),)
18 PACKAGE_SUBDIRS += $(OUTPUT_DIR)/packages/$(ARCH_PACKAGES)/base
19 ifneq ($(CONFIG_PER_FEED_REPO_ADD_DISABLED),)
20 PACKAGE_SUBDIRS += $(foreach FEED,$(FEEDS_AVAILABLE),$(OUTPUT_DIR)/packages/$(ARCH_PACKAGES)/$(FEED))
22 PACKAGE_SUBDIRS += $(foreach FEED,$(FEEDS_ENABLED),$(OUTPUT_DIR)/packages/$(ARCH_PACKAGES)/$(FEED))
26 opkg_package_files = $(wildcard \
27 $(foreach dir,$(PACKAGE_SUBDIRS), \
28 $(foreach pkg,$(1), $(dir)/$(pkg)_*.ipk)))
32 $(strip $(if $(CONFIG_PER_FEED_REPO), \
33 $(if $(Package/$(1)/subdir), \
34 $(abspath $(OUTPUT_DIR)/packages/$(ARCH_PACKAGES)/$(Package/$(1)/subdir)), \
40 define FeedSourcesAppend
42 echo "src/gz %d_core %U/targets/%S/packages"; \
43 $(strip $(if $(CONFIG_PER_FEED_REPO), \
44 $(foreach feed,base $(FEEDS_ENABLED),echo "src/gz %d_$(feed) %U/packages/%A/$(feed)";) \
45 $(if $(CONFIG_PER_FEED_REPO_ADD_DISABLED), \
46 $(foreach feed,$(FEEDS_DISABLED),echo "$(if $(CONFIG_PER_FEED_REPO_ADD_COMMENTED),# )src/gz %d_$(feed) %U/packages/%A/$(feed)";)))) \