summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Marangi2024-11-17 18:09:31 +0000
committerChristian Marangi2024-11-17 18:09:31 +0000
commit43455f1075855d9ed2760f70b2d8acbe8e8bb16c (patch)
treed1309c0615bc0f36f3e1ef8b908b6f6d126b092c
parent4511fa4b30f73185597990ce563bbf3f96385292 (diff)
downloadopenwrt-43455f1075855d9ed2760f70b2d8acbe8e8bb16c.tar.gz
include/package-pack: escape package description for APK mkpkg
Escape special char for package description for APK mkpkg as the description is passed as an args to mkpkg with --info option and can easily escape from the "". Currently escaped char `, $, ", \. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
-rw-r--r--include/package-pack.mk6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/package-pack.mk b/include/package-pack.mk
index 9d06c8b647..830b39f8d7 100644
--- a/include/package-pack.mk
+++ b/include/package-pack.mk
@@ -8,6 +8,10 @@ endif
IPKG_STATE_DIR:=$(TARGET_DIR)/usr/lib/opkg
+define description_escape
+$(subst `,\`,$(subst $$,\$$,$(subst ",\",$(subst \,\\,$(1)))))
+endef
+
# Generates a make statement to return a wildcard for candidate ipkg files
# 1: package name
define gen_package_wildcard
@@ -339,7 +343,7 @@ else
$(FAKEROOT) $(STAGING_DIR_HOST)/bin/apk mkpkg \
--info "name:$(1)$$(ABIV_$(1))" \
--info "version:$(VERSION)" \
- --info "description:$$(strip $$(Package/$(1)/description))" \
+ --info "description:$$(call description_escape,$$(strip $$(Package/$(1)/description)))" \
--info "arch:$(PKGARCH)" \
--info "license:$(LICENSE)" \
--info "origin:$(SOURCE)" \