Skip to content

Commit 43455f1

Browse files
committed
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 <[email protected]>
1 parent 4511fa4 commit 43455f1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

include/package-pack.mk

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ endif
88

99
IPKG_STATE_DIR:=$(TARGET_DIR)/usr/lib/opkg
1010

11+
define description_escape
12+
$(subst `,\`,$(subst $$,\$$,$(subst ",\",$(subst \,\\,$(1)))))
13+
endef
14+
1115
# Generates a make statement to return a wildcard for candidate ipkg files
1216
# 1: package name
1317
define gen_package_wildcard
@@ -339,7 +343,7 @@ else
339343
$(FAKEROOT) $(STAGING_DIR_HOST)/bin/apk mkpkg \
340344
--info "name:$(1)$$(ABIV_$(1))" \
341345
--info "version:$(VERSION)" \
342-
--info "description:$$(strip $$(Package/$(1)/description))" \
346+
--info "description:$$(call description_escape,$$(strip $$(Package/$(1)/description)))" \
343347
--info "arch:$(PKGARCH)" \
344348
--info "license:$(LICENSE)" \
345349
--info "origin:$(SOURCE)" \

0 commit comments

Comments
 (0)