[elbe-devel] [PATCH 12/19] elbepack: drop pack_dir

Thomas Weißschuh thomas.weissschuh at linutronix.de
Tue Mar 19 08:47:41 CET 2024


Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 elbepack/directories.py | 3 ---
 elbepack/version.py     | 9 +++------
 2 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/elbepack/directories.py b/elbepack/directories.py
index 2754dc025af3..20df3da2334d 100644
--- a/elbepack/directories.py
+++ b/elbepack/directories.py
@@ -20,8 +20,5 @@ def get_cmdlist():
     return [x for _, x, _ in iter_modules(elbepack.commands.__path__)]
 
 
-pack_dir = elbepack.__path__[0]
-
-
 def run_elbe(args, **kwargs):
     return subprocess.run([sys.executable, elbe_exe, *args], **kwargs)
diff --git a/elbepack/version.py b/elbepack/version.py
index 2f84ef8e5d01..aa3ae39d1986 100644
--- a/elbepack/version.py
+++ b/elbepack/version.py
@@ -2,8 +2,8 @@
 # SPDX-License-Identifier: GPL-3.0-or-later
 # SPDX-FileCopyrightText: 2013-2018 Linutronix GmbH
 
-
-from elbepack.directories import pack_dir
+import pathlib
+import sys
 
 elbe_version = '14.9.3'
 
@@ -14,7 +14,4 @@ elbe_initvm_packagelist = ['python3-elbe-buildenv',
                            'elbe-schema',
                            'python3-elbe-bin']
 
-if pack_dir.startswith('/usr/lib/python'):
-    is_devel = False
-else:
-    is_devel = True
+is_devel = not pathlib.Path(__file__).is_relative_to(sys.prefix)

-- 
2.44.0



More information about the elbe-devel mailing list