From a0297a62b274ee2995bf06aa0bb836f46780df00 Mon Sep 17 00:00:00 2001
From: Timo Teras <timo.teras@iki.fi>
Date: Wed, 4 Mar 2009 08:31:17 +0200
Subject: [PATCH] initramfs-init: use apk's --clean-protected

---
 initramfs-init | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/initramfs-init b/initramfs-init
index 0ddf10dc01a5..bb4aae1d6dea 100755
--- a/initramfs-init
+++ b/initramfs-init
@@ -185,13 +185,12 @@ done
 if [ -n "$KOPT_chart" ]; then
 	pkgs="$pkgs acct"
 fi
-apk add --root /newroot --initdb --quiet --progress $pkgs >/dev/null
-eend $?
-
-# kill .apk-new files
+apkflags=""
 if [ -z "$KOPT_keep_apk_new" ]; then
-	find /newroot/etc -name '*.apk-new' | xargs rm -f
+	apkflags="--clean-protected"
 fi
+apk add --root /newroot --initdb --quiet --progress $apkflags $pkgs >/dev/null
+eend $?
 
 # copy alpine release info
 cp $ALPINE_MNT/.alpine-release $NEWROOT/
-- 
GitLab