From e7b8f757d4391518cf09d4a9a2ca5c2a8b70ad57 Mon Sep 17 00:00:00 2001 From: Lars Karlitski Date: Thu, 13 Jun 2019 19:30:19 +0200 Subject: [PATCH] osbuid: introduce libdir Run stages and the runner from a libdir, which is either $prefix/lib or the current directory. --- osbuild | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/osbuild b/osbuild index a0dd5745..cf013d68 100755 --- a/osbuild +++ b/osbuild @@ -8,6 +8,12 @@ import sys import tempfile +if os.path.dirname(__file__) == f"{sys.prefix}/bin": + libdir = f"{sys.prefix}/lib" +else: + libdir = os.path.abspath(".") + + RESET = "\033[0m" BOLD = "\033[1m" RED = "\033[31m" @@ -69,8 +75,8 @@ class BuildRoot: } binds = [ - (f"{os.getcwd()}/run-stage", "/tmp/run-stage"), - (f"{os.getcwd()}/stages/{stage}", "/tmp/stage"), + (f"{libdir}/run-stage", "/tmp/run-stage"), + (f"{libdir}/stages/{stage}", "/tmp/stage"), ("/etc/pki", "/etc/pki") ]