Skip to content

Commit 9596f1d

Browse files
committed
support single providers.json; add v.recipes provider (fixes #17, thank you @morytyann)
1 parent f3abfb1 commit 9596f1d

4 files changed

Lines changed: 194 additions & 109 deletions

File tree

Makefile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,27 @@ help
2222
Version: $(PKG_VERSION)-$(PKG_RELEASE)
2323
endef
2424

25+
# Consolidate individual provider JSON files into providers.json in the build tree.
26+
# luci.mk's Build/Prepare calls Build/Prepare/$(LUCI_NAME) as a per-package hook.
27+
# The merged file lands in root/ so luci.mk's install step copies it automatically.
28+
define Build/Prepare/luci-app-https-dns-proxy
29+
@if [ -d $(PKG_BUILD_DIR)/root/usr/share/https-dns-proxy/providers ] \
30+
&& ls $(PKG_BUILD_DIR)/root/usr/share/https-dns-proxy/providers/*.json >/dev/null 2>&1; then \
31+
sep=''; printf '[' > $(PKG_BUILD_DIR)/root/usr/share/https-dns-proxy/providers.json; \
32+
for f in $(PKG_BUILD_DIR)/root/usr/share/https-dns-proxy/providers/*.json; do \
33+
printf '%s' "$$$$sep" >> $(PKG_BUILD_DIR)/root/usr/share/https-dns-proxy/providers.json; \
34+
cat "$$$$f" >> $(PKG_BUILD_DIR)/root/usr/share/https-dns-proxy/providers.json; \
35+
sep=','; \
36+
done; \
37+
printf ']' >> $(PKG_BUILD_DIR)/root/usr/share/https-dns-proxy/providers.json; \
38+
fi
39+
@if grep -q '"title"' $(PKG_BUILD_DIR)/root/usr/share/https-dns-proxy/providers.json 2>/dev/null; then \
40+
rm -rf $(PKG_BUILD_DIR)/root/usr/share/https-dns-proxy/providers; \
41+
else \
42+
rm -f $(PKG_BUILD_DIR)/root/usr/share/https-dns-proxy/providers.json; \
43+
fi
44+
endef
45+
2546
include ../../luci.mk
2647

2748
# call BuildPackage - OpenWrt buildroot signature

0 commit comments

Comments
 (0)