From cecefa315aece480d724bd07f990dee0334e7c60 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Thu, 1 May 2025 23:41:50 +0200 Subject: 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. --- examples/unschroot.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3