From a61d7b086872a5ecc372e6b9efc9ed89f658fde9 Mon Sep 17 00:00:00 2001 From: pstruebi Date: Mon, 5 Jan 2026 16:02:24 +0100 Subject: [PATCH] Fix project root path calculation in version and update functions - Correct path traversal from 4 to 3 levels up (server -> auracast -> src -> bumble-auracast) - Add clarifying comments for path calculation - Apply fix consistently across get_version(), check_update(), and system_update() functions --- src/auracast/server/multicast_server.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/auracast/server/multicast_server.py b/src/auracast/server/multicast_server.py index d0b0614..8f8f157 100644 --- a/src/auracast/server/multicast_server.py +++ b/src/auracast/server/multicast_server.py @@ -903,7 +903,8 @@ async def system_reboot(): async def get_version(): """Get the current software version (git tag or commit).""" try: - project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..', '..')) + # server -> auracast -> src -> bumble-auracast (3 levels up) + project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..')) # Try to get the current tag proc = await asyncio.create_subprocess_exec( @@ -937,7 +938,8 @@ async def get_version(): async def check_update(): """Check for available updates by comparing current version with latest release tag.""" try: - project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..', '..')) + # server -> auracast -> src -> bumble-auracast (3 levels up) + project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..')) # Fetch all tags and refs from origin proc = await asyncio.create_subprocess_exec( @@ -993,8 +995,8 @@ async def system_update(): except Exception: pass - # Project root is 4 levels up from this file: server -> auracast -> src -> bumble-auracast - project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..', '..')) + # server -> auracast -> src -> bumble-auracast (3 levels up) + project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..')) # 1. Fetch and checkout the latest tag from the release branch # First fetch all tags and the release branch