From e24c62228c49766935f434192db0d1cb4fdde820 Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Tue, 21 Apr 2026 01:24:35 +0100 Subject: fix(etc-restore): preserve mtime so pacman -Qkk sees file as unmodified MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 'bsdtar -xOf | doas tee' wrote pristine content but with mtime=now, which caused 'pacman -Qkk' (and therefore 'just etc') to still flag the file as drifted — pacman compares stored metadata, not content. Switch to 'doas bsdtar -xpf -C / ', which extracts the single file in place with its original owner, mode, and mtime from the package archive. --- justfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'justfile') diff --git a/justfile b/justfile index f8205ff..e7c9912 100644 --- a/justfile +++ b/justfile @@ -479,7 +479,9 @@ etc-restore +paths: [ -n "$cache" ] || { echo "error: no cache for ${pkg}-${ver}; mirror may have moved past installed version" >&2; exit 1; } bsdtar -tf "$cache" "${live#/}" >/dev/null 2>&1 \ || { echo "error: $live not present in $pkg archive" >&2; exit 1; } - bsdtar -xOf "$cache" "${live#/}" | doas tee "$live" >/dev/null + # Extract with -p to preserve owner/mode/mtime so pacman -Qkk sees the + # file as unmodified (same metadata as install time, not just same bytes). + doas bsdtar -xpf "$cache" -C / "${live#/}" echo "restored (from $pkg): $live" done -- cgit v1.2.3-70-g09d2