From 7771ced1411c3140f5ca17bfe282dc23a949c4a6 Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Wed, 13 May 2026 13:43:39 +0100 Subject: fix(lostfiles): emit parent directories alongside tracked files lostfiles flags directories whose parent is pacman-owned but the dir itself is not (drop-in dirs like /etc/systemd/{logind,system,user}.conf.d, /etc/systemd/system/getty@.service.d, /etc/pacman.d/hooks). Previous template only emitted tracked files, missing these. Walk each tracked path emitting every ancestor up to /etc, then sort -u. Over-emission of pacman-owned parents (e.g. /etc, /etc/systemd) is harmless: grep -vFx simply finds no match for those lines. --- etc/lostfiles.ignore.tmpl | 2 +- justfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/lostfiles.ignore.tmpl b/etc/lostfiles.ignore.tmpl index dee9be7..35e40fa 100644 --- a/etc/lostfiles.ignore.tmpl +++ b/etc/lostfiles.ignore.tmpl @@ -10,7 +10,7 @@ track these) and generated caches (pacman post-install regenerates them, so they will never be pacman-owned). */ -}} -{{ output "sh" "-c" (printf "cd %q && find etc -type f ! -name .ignore | sed -e 's|^etc|/etc|' -e 's|\\.tmpl$||' | LC_ALL=C sort -u" .chezmoi.sourceDir) -}} +{{ output "sh" "-c" (printf "cd %q && find etc -type f ! -name .ignore | sed -e 's|^etc|/etc|' -e 's|\\.tmpl$||' | awk -F/ 'BEGIN{OFS=\"/\"} {print; for (i=NF-1; i>1; i--) {$NF=\"\"; sub(/\\/$/, \"\"); print}}' | LC_ALL=C sort -u" .chezmoi.sourceDir) -}} # sudo-rs deploy script symlinks /etc/pam.d/sudo-i -> sudo /etc/pam.d/sudo-i # Host-private systemd-networkd units (contain secrets, not tracked) diff --git a/justfile b/justfile index b91d266..f8fed9a 100644 --- a/justfile +++ b/justfile @@ -18,7 +18,7 @@ sync: apply pkg-fix unit-apply # Deploy dotfiles AND /etc atomically (chezmoi apply; /etc handled by onchange template) apply: - chezmoi apply -S . + chezmoi apply -S . -v # ═══════════════════════════════════════════════════════════════════ # Updates -- cgit v1.3.1