docker: switch to ubuntu:24.04 as base image

Change-Id: I6b7b8b4875e6f850e8ff2e26ca1cc106d5df455a
diff --git a/wscript b/wscript
index 732b516..0f0ea01 100644
--- a/wscript
+++ b/wscript
@@ -374,10 +374,12 @@
         cmd = ['git', 'describe', '--abbrev=8', '--always', '--match', f'{GIT_TAG_PREFIX}*']
         version_from_git = subprocess.run(cmd, capture_output=True, check=True, text=True).stdout.strip()
         if version_from_git:
-            if version_from_git.startswith(GIT_TAG_PREFIX):
-                Context.g_module.VERSION = version_from_git.lstrip(GIT_TAG_PREFIX)
+            if GIT_TAG_PREFIX and version_from_git.startswith(GIT_TAG_PREFIX):
+                Context.g_module.VERSION = version_from_git[len(GIT_TAG_PREFIX):]
+            elif not GIT_TAG_PREFIX and ('.' in version_from_git or '-' in version_from_git):
+                Context.g_module.VERSION = version_from_git
             else:
-                # no tags matched
+                # no tags matched (or we are in a shallow clone)
                 Context.g_module.VERSION = f'{VERSION_BASE}+git.{version_from_git}'
     except (OSError, subprocess.SubprocessError):
         pass