summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2025-05-01 23:41:50 +0200
committerHelmut Grohne <helmut@subdivi.de>2025-05-01 23:41:50 +0200
commitcecefa315aece480d724bd07f990dee0334e7c60 (patch)
treefe0bfe09a8e988e85eab6ffedcd27df184b55497
parent426f547d5b542daf679fcce34d1e9739107d6987 (diff)
downloadpython-linuxnamespaces-cecefa315aece480d724bd07f990dee0334e7c60.tar.gz
examples/unschroot.py: fix sbuild compatibility
The parent commit regressed working with "chroot:" prefixed chroots. Directory chroots are required to emit a "Mount Location" to be considered valid by sbuild.
-rwxr-xr-xexamples/unschroot.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/unschroot.py b/examples/unschroot.py
index 58e14b7..32a93b5 100755
--- a/examples/unschroot.py
+++ b/examples/unschroot.py
@@ -231,6 +231,9 @@ class DirectorySessionChroot(SessionChroot):
data = super().infodata()
data["Type"] = "directory"
data["Directory"] = str(self.source.path)
+ # It's a gross lie, but sbuild does not work without. It has to
+ # actually exist and should not occur inside build logs.
+ data["Location"] = str(self.source.path)
return data
def mount(self) -> pathlib.Path:
@@ -308,7 +311,7 @@ def do_info(args: argparse.Namespace) -> None:
def do_begin_session(args: argparse.Namespace) -> None:
"""Begin a session; returns the session ID"""
chrootmap = scan_chroots()
- source = chrootmap[args.chroot]
+ source = chrootmap[args.chroot.removeprefix("chroot:")]
assert isinstance(source, SourceChroot)
session = source.newsession()
print(session.name)