docs: relocate DRIVER-MANAGER-MIGRATION-PLAN to archive + cleanup
The DRIVER-MANAGER-MIGRATION-PLAN was self-declared complete (the driver-manager cutover happened 2026-07-23 per local/AGENTS.md). It is now historical reference material rather than current planning authority. Move it from local/docs/ into the established legacy-obsolete-2026-07-25/ archive directory, updating every inbound reference. Also includes minor cross-doc alignment for the previous round's relocations: - local/AGENTS.md: update DRIVER-MANAGER-MIGRATION-PLAN to point to the legacy archive - local/docs/REDBEAR-FULL-SDDM-BRINGUP.md: alignment update - local/docs/CONSOLE-TO-KDE-DESKTOP-PLAN.md: alignment update - local/docs/archived/README.md: refresh archive contents note - local/recipes/system/redbear-driver-policy/source/policy/README.md: policy doc drift alignment - local/scripts/guard-recipes.sh: fix symlink target computation (relative path was being glued onto an absolute path, producing malformed dangling links like '../..//mnt/.../recipe.toml') -- this is a real bug fix discovered during this audit round.
This commit is contained in:
@@ -73,12 +73,14 @@ case "$MODE" in
|
||||
FIXED=0
|
||||
find "$LOCAL_RECIPES" -name "recipe.toml" -type f | while read -r local_recipe; do
|
||||
rel="${local_recipe#$LOCAL_RECIPES/}"
|
||||
# Compute relative symlink path
|
||||
depth=$(echo "$rel" | tr -cd '/' | wc -c)
|
||||
up=""
|
||||
for ((i=0; i<depth; i++)); do up="../$up"; done
|
||||
target="$up$local_recipe"
|
||||
main="$MAIN_RECIPES/${rel%/*}/recipe.toml"
|
||||
# Relative symlink target from the link's directory to the real
|
||||
# recipe under local/recipes/. Computed with realpath so the depth
|
||||
# is always correct. The previous "$up$local_recipe" form glued a
|
||||
# relative prefix onto an ABSOLUTE path (local_recipe comes from
|
||||
# `find "$LOCAL_RECIPES"`, which is absolute), producing malformed
|
||||
# dangling links like "../..//mnt/.../recipe.toml".
|
||||
target="$(realpath -m --relative-to="$(dirname "$main")" "$local_recipe")"
|
||||
|
||||
if [ ! -L "$main" ] || [ "$(readlink "$main")" != "$target" ]; then
|
||||
# If the parent directory is a symlink into local/recipes/, the
|
||||
@@ -148,11 +150,11 @@ case "$MODE" in
|
||||
echo "Restoring all symlinks from local/recipes/..."
|
||||
find "$LOCAL_RECIPES" -name "recipe.toml" -type f | while read -r local_recipe; do
|
||||
rel="${local_recipe#$LOCAL_RECIPES/}"
|
||||
depth=$(echo "$rel" | tr -cd '/' | wc -c)
|
||||
up=""
|
||||
for ((i=0; i<depth; i++)); do up="../$up"; done
|
||||
target="$up$local_recipe"
|
||||
main="$MAIN_RECIPES/${rel%/*}/recipe.toml"
|
||||
# See --fix branch above: use realpath so the relative target is
|
||||
# always well-formed (never a relative prefix glued onto an
|
||||
# absolute path).
|
||||
target="$(realpath -m --relative-to="$(dirname "$main")" "$local_recipe")"
|
||||
|
||||
mkdir -p "$(dirname "$main")"
|
||||
rm -f "$main"
|
||||
|
||||
Reference in New Issue
Block a user