Open nxhack opened 1 day ago
Invalid Version reported. `` Is this from a clean repository?
Invalid Release reported. `` Is this from a clean repository?
Invalid Target/Subtarget reported. `` Is this from a supported device?
Proposed an approach to fix apk description field escaping here: https://github.com/openwrt/openwrt/pull/16908#issuecomment-2466843625
Feel free to tidy up, test and submit it.
I applied this patch based on @geldot information.
diff --git a/include/package-pack.mk b/include/package-pack.mk
index 9d06c8b647..5b1dc22bc6 100644
--- a/include/package-pack.mk
+++ b/include/package-pack.mk
@@ -45,6 +45,7 @@ dep_if=$(if $(findstring !,$(1)),$(call dep_neg,$(1)),$(call dep_pos,$(1)))
dep_val=$(word 2,$(call dep_split,$(1)))
strip_deps=$(strip $(subst +,,$(filter-out @%,$(1))))
filter_deps=$(foreach dep,$(call strip_deps,$(1)),$(if $(findstring :,$(dep)),$(call dep_if,$(dep)),$(dep)))
+sanitize_field=$(subst ",\",$(subst `,\`,$(strip $(1))))
define AddDependency
$$(if $(1),$$(if $(2),$$(foreach pkg,$(1),$$(PACK_$$(pkg))): $$(foreach pkg,$(2),$$(PACK_$$(pkg)))))
@@ -339,7 +340,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 sanitize_field,$(Package/$(1)/description))" \
--info "arch:$(PKGARCH)" \
--info "license:$(LICENSE)" \
--info "origin:$(SOURCE)" \
I had assumed that the escape characters would still be there in the apk info because they were simply escaped, but they had disappeared.
root@OpenWrt:~# apk info -d node-homebridge-config-ui-x
node-homebridge-config-ui-x-4.62.0-r1 description:
Homebridge Config UI X is a web based management tool for Homebridge that allows you to manage all aspects of your Homebridge setup. Run as root: hb-service install --user homebridge -U /usr/share/homebridge hb-service restart TEST STRINGS: ` -A ` AAA *** The hb-service command is not full compatible with the openwrt environment. *** *** You can edit config.json using the Homebridge Config UI X. *** See: https://github.com/oznu/homebridge-config-ui-x/wiki/Manual-Configuration https://github.com/oznu/homebridge-config-ui-x/wiki/Manual-Configuration#logs-from-custom-command https://github.com/oznu/homebridge-config-ui-x/wiki/Manual-Configuration#sudo-mode "platforms": [ { "platform": "config", "name": "Config", "port": 8581, "restart": "sudo /etc/init.d/homebridge restart", "sudo": true, "log": { "method": "custom", "command": "sudo logread -f -l 100 -e homebridge" } } ]
Describe the bug
The error occurs if there are double quotes in the arguments when generating the apk package.
Example: my custom package description has double quotes and I had a problem when building this package.
https://github.com/nxhack/openwrt-node-packages/blob/master/node-homebridge-config-ui-x/Makefile#L34-L61
opkg has no problem.
OpenWrt version
r28076-27c2c140b1
OpenWrt release
SNAPSHOT
OpenWrt target/subtarget
mediatek/filogic
Device
GL.iNet GL-MT6000
Image kind
Self-built image
Steps to reproduce
No response
Actual behaviour
No response
Expected behaviour
No response
Additional info
No response
Diffconfig
No response
Terms