From 02aa7372419aa7672372c2778527691768173160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jelmer=20Vernoo=C4=B3?= Date: Mon, 29 Mar 2021 18:42:09 +0100 Subject: [PATCH] Don't require cwd when path is absolute. --- ognibuild/session/schroot.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ognibuild/session/schroot.py b/ognibuild/session/schroot.py index f7f45b2..ff5b436 100644 --- a/ognibuild/session/schroot.py +++ b/ognibuild/session/schroot.py @@ -185,6 +185,8 @@ class SchrootSession(Session): self.check_call(["chown", user, home], cwd="/", user="root") def external_path(self, path: str) -> str: + if os.path.isabs(path): + return os.path.join(self.location, path.lstrip("/")) if self._cwd is None: raise ValueError("no cwd set") return os.path.join(self.location, os.path.join(self._cwd, path).lstrip("/"))