Skip to content

Commit 14faa25

Browse files
committed
apk: avoid silent file overwrites between packages
Actually "apk" allow silent files overwrites between packages sharing the "--info origin" field, that is for example, all packages implementing VARIANTs which are precisely those with highest posible file conflicts [1]. We are preventing this at the package level conflicts restrictions, but in some cases like packages using ALTERNATIVES mechanism would not catch those file conflicts as it allow to install packages whitin the same VARIANT(same "origin") side-by-side. And more cases without VARIANTs (ca-certs, v2ray-*, etc.) This is a feature of the apk package manager to allow old packages be replaced but since "apk" also offers the field "replaces" which allow these overwrites explicitly [2]. Modify the "origin" field appending the package name in order to make this field unique in all cases and get back the expected behavior since "opkg" times. [1]: apk docs https://gitlab.alpinelinux.org/alpine/apk-tools/-/blob/master/doc/apk-package.5.scd?#L127 [2]: apk docs replaces https://gitlab.alpinelinux.org/alpine/apk-tools/-/blob/master/doc/apk-package.5.scd?#L217 Fixes: openwrt#20802 (comment) Signed-off-by: Mario Andrés Pérez <mapb_@outlook.com>
1 parent 5c5823a commit 14faa25

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

include/package-pack.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ else
597597
--info "description:$$(call description_escape,$$(strip $$(Package/$(1)/description)))" \
598598
$(if $(findstring all,$(PKGARCH)),--info "arch:noarch",--info "arch:$(PKGARCH)") \
599599
--info "license:$(LICENSE)" \
600-
--info "origin:$(SOURCE)" \
600+
--info "origin:$(SOURCE)/$(1)" \
601601
--info "url:$(URL)" \
602602
--info "maintainer:$(MAINTAINER)" \
603603
$$(if $$(Package/$(1)/PROVIDES),--info "provides:$$(Package/$(1)/PROVIDES)") \

0 commit comments

Comments
 (0)