From 81c42be4f48997a8dc3ef4f10b69812ecee55d53 Mon Sep 17 00:00:00 2001 From: arlophoenix Date: Mon, 27 Jul 2026 08:01:17 +1200 Subject: [PATCH] fix(timelapse): exclude linked component from Moonraker repo The Moonraker Timelapse installer symlinks its component into Moonraker's git repo at moonraker/components/timelapse.py. Because that file is not tracked by Moonraker's repository, update_manager permanently reports the repo as dirty: Repo has untracked source files: ['moonraker/components/timelapse.py'] This blocks clean update_manager status and can interfere with Moonraker updates, even though the component is intentional. Add the linked path to the repo's .git/info/exclude at install time (idempotent, guarded on .git/info existing) so update_manager stops flagging it. The uninstall path removes the exclude entry for symmetry. --- scripts/moonraker_timelapse.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/moonraker_timelapse.sh b/scripts/moonraker_timelapse.sh index ef23d42..5746247 100755 --- a/scripts/moonraker_timelapse.sh +++ b/scripts/moonraker_timelapse.sh @@ -29,6 +29,16 @@ function install_moonraker_timelapse(){ fi echo -e "Info: Linking file..." ln -sf "$TIMELAPSE_URL1" "$TIMELAPSE_FILE" + # The linked component is an untracked source file inside Moonraker's git + # repo, so update_manager permanently reports the repo as dirty + # ("Repo has untracked source files: ['moonraker/components/timelapse.py']"). + # Add it to the repo's local exclude list so update_manager stays happy. + MOONRAKER_REPO_DIR="${TIMELAPSE_FILE%/moonraker/components/timelapse.py}" + if [ -d "$MOONRAKER_REPO_DIR"/.git/info ]; then + echo -e "Info: Excluding linked component from Moonraker repo..." + grep -qxF "moonraker/components/timelapse.py" "$MOONRAKER_REPO_DIR"/.git/info/exclude 2>/dev/null \ + || echo "moonraker/components/timelapse.py" >> "$MOONRAKER_REPO_DIR"/.git/info/exclude + fi if [ "$model" = "K1_2025" ]; then # K1_2025 runs Klipper as the unprivileged 'creality' user, which cannot read a # symlink whose target is in the root-owned helper-script tree (Klipper then reports @@ -97,6 +107,11 @@ function remove_moonraker_timelapse(){ rm -f "$HS_CONFIG_FOLDER"/timelapse.cfg rm -f /usr/data/moonraker/moonraker/moonraker/components/timelapse.py rm -f /usr/data/moonraker/moonraker/moonraker/components/timelapse.pyc + # Drop the local exclude entry added at install time (symmetry). + MOONRAKER_REPO_DIR="${TIMELAPSE_FILE%/moonraker/components/timelapse.py}" + if [ -f "$MOONRAKER_REPO_DIR"/.git/info/exclude ]; then + sed -i '/^moonraker\/components\/timelapse\.py$/d' "$MOONRAKER_REPO_DIR"/.git/info/exclude + fi if [ -f /opt/bin/ffmpeg ]; then set +e "$ENTWARE_FILE" --autoremove remove ffmpeg