From 1f906acd809e20e242ac5cb341a3b7723c3f88f0 Mon Sep 17 00:00:00 2001 From: Connor Johnstone Date: Mon, 14 Sep 2026 14:55:07 -0400 Subject: [PATCH] Drop empty link sources; make install refuse them MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Five directories swept in held no files — matplotlib, three gtk dirs and one mpv. Git cannot represent an empty directory, so they existed on mainframe where they were created but vanished on clone, and system76's install failed with "Nonexistent target". install now checks every link source exists before running dotbot, so this surfaces on the machine that introduced it rather than the next one to pull. --- install | 9 +++++++++ meta/base.conf.yaml | 1 - meta/hosts/mainframe.conf.yaml | 1 - meta/hosts/sctfw004.conf.yaml | 2 -- meta/hosts/system76.conf.yaml | 1 - 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/install b/install index 90ebe94..3912f75 100755 --- a/install +++ b/install @@ -20,6 +20,15 @@ if [[ ! -f "${HOSTCONF}" ]]; then exit 1 fi +# Git cannot represent an empty directory, so a link whose source contains no +# files disappears on clone and dotbot fails with "Nonexistent target". Catch +# it here rather than on someone else's machine. +missing=0 +while read -r src; do + [[ -e "${src}" ]] || { echo "install: link source missing from the repo: ${src}" >&2; missing=1; } +done < <(grep -hoE '^\s+~[^:]*:\s+\S+' meta/base.conf.yaml "${HOSTCONF}" | awk '{print $NF}') +(( missing )) && { echo "install: refusing to run with missing sources." >&2; exit 1; } + git submodule update --init --recursive "${DOTBOT_DIR}" echo "==> base" diff --git a/meta/base.conf.yaml b/meta/base.conf.yaml index bcd7573..5b0069b 100644 --- a/meta/base.conf.yaml +++ b/meta/base.conf.yaml @@ -28,4 +28,3 @@ ~/.config/lazygit: common/lazygit ~/.config/ncmpcpp: common/ncmpcpp ~/.config/neofetch: common/neofetch - ~/.config/matplotlib: common/matplotlib diff --git a/meta/hosts/mainframe.conf.yaml b/meta/hosts/mainframe.conf.yaml index 400da12..d124699 100644 --- a/meta/hosts/mainframe.conf.yaml +++ b/meta/hosts/mainframe.conf.yaml @@ -11,7 +11,6 @@ - link: ~/.config/bob: hosts/mainframe/config/bob - ~/.config/gtk-3.0: hosts/mainframe/config/gtk-3.0 ~/.config/inbox-tidy: hosts/mainframe/config/inbox-tidy ~/.config/llmfit: hosts/mainframe/config/llmfit ~/.config/mimeapps.list: hosts/mainframe/config/mimeapps.list diff --git a/meta/hosts/sctfw004.conf.yaml b/meta/hosts/sctfw004.conf.yaml index 565b6d9..e36429a 100644 --- a/meta/hosts/sctfw004.conf.yaml +++ b/meta/hosts/sctfw004.conf.yaml @@ -15,9 +15,7 @@ ~/.config/gh: hosts/sctfw004/config/gh ~/.config/gtk-2.0: hosts/sctfw004/config/gtk-2.0 ~/.config/gtk-3.0: hosts/sctfw004/config/gtk-3.0 - ~/.config/gtk-4.0: hosts/sctfw004/config/gtk-4.0 ~/.config/mimeapps.list: hosts/sctfw004/config/mimeapps.list - ~/.config/mpv: hosts/sctfw004/config/mpv ~/.config/pavucontrol.ini: hosts/sctfw004/config/pavucontrol.ini ~/.config/swayimg: hosts/sctfw004/config/swayimg ~/.config/swaync: hosts/sctfw004/config/swaync diff --git a/meta/hosts/system76.conf.yaml b/meta/hosts/system76.conf.yaml index 64aafc6..e2ddd6c 100644 --- a/meta/hosts/system76.conf.yaml +++ b/meta/hosts/system76.conf.yaml @@ -15,7 +15,6 @@ ~/.config/glow: hosts/system76/config/glow ~/.config/gtk-2.0: hosts/system76/config/gtk-2.0 ~/.config/gtk-3.0: hosts/system76/config/gtk-3.0 - ~/.config/gtk-4.0: hosts/system76/config/gtk-4.0 ~/.config/mimeapps.list: hosts/system76/config/mimeapps.list ~/.config/mpd: hosts/system76/config/mpd ~/.config/mpv: hosts/system76/config/mpv