Parcourir la source

Adapt to alpine-base not providing release files since v3.17 and on edge

https://gitlab.alpinelinux.org/alpine/aports/-/commit/23e66e85c95beef9d3f72a2ccc510671fdb3462d
Jakub Jirutka il y a 3 ans
Parent
commit
80a8e3f9d6
1 fichiers modifiés avec 10 ajouts et 5 suppressions
  1. 10 5
      alpine-make-rootfs

+ 10 - 5
alpine-make-rootfs

@@ -387,11 +387,16 @@ fi
 
 _apk add --root "$rootfs" --update-cache --initdb $rootfs_pkgs >&2
 
-if ! _apk info --root "$rootfs" --quiet --installed alpine-base; then
-	# This package contains /etc/os-release, /etc/alpine-release and /etc/issue,
-	# but we don't wanna install all its dependencies (e.g. openrc).
-	_apk fetch --root "$rootfs" --stdout alpine-base \
-		| tar -xz -C "$rootfs" etc >&2
+if ! [ -f "$rootfs"/etc/alpine-release ]; then
+	if _apk info --root "$rootfs" --quiet alpine-release >/dev/null; then
+		_apk add --root "$rootfs" alpine-release
+	else
+		# In Alpine <3.17, this package contains /etc/os-release,
+		# /etc/alpine-release and /etc/issue, but we don't wanna install all
+		# its dependencies (e.g. openrc).
+		_apk fetch --root "$rootfs" --stdout alpine-base \
+			| tar -xz -C "$rootfs" etc >&2
+	fi
 fi
 
 [ -e "$rootfs"/var/run ] || ln -s /run "$rootfs"/var/run