X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;ds=sidebyside;f=modules%2Fporterbox%2Ffiles%2Fdd-schroot-cmd;h=6506b6ed10b4ab62f7f44bfe9555cc840e7f5842;hb=2f5682a9f5ac9d32029bfa7c2e1d93c3ac728d8f;hp=e2d2111efe0aaad20297200856966787c8846e39;hpb=b7e872963ed3267dd33855abd1c34bdfd3720764;p=mirror%2Fdsa-puppet.git diff --git a/modules/porterbox/files/dd-schroot-cmd b/modules/porterbox/files/dd-schroot-cmd index e2d2111ef..6506b6ed1 100755 --- a/modules/porterbox/files/dd-schroot-cmd +++ b/modules/porterbox/files/dd-schroot-cmd @@ -80,7 +80,7 @@ def ensure_ok(session): die("Session owner mismatch.") def os_supports_unshare(): - if platform.uname()[0] == 'GNU/kFreeBSD': + if platform.uname()[0] in ('GNU/kFreeBSD', 'GNU'): return False return True @@ -88,7 +88,7 @@ class WrappedRunner(): def __init__(self, session, args, unshare=True): self.unshare = unshare if not os_supports_unshare(): self.unshare = False - s,r = self.run('schroot', '-c', session, '--run-session', '--', 'env', 'DEBIAN_FRONTEND=noninteractive', *args) + s,r = self.run('schroot', '-c', session, '--directory=/', '--run-session', '--', 'env', 'DEBIAN_FRONTEND=noninteractive', *args) if s != 0: die("Command %s exited due to signal %d."%(' '.join(args), s)) if r != 0: @@ -180,7 +180,7 @@ class AptSchroot: self.apt_simulate_and_ask(['install', '--'] + packages) def apt_build_dep(self, packages, archonly=False): - cmd = ['build-dep'] + (['--arch-only'] if archonly else []) + ['--'] + cmd = (['--arch-only'] if archonly else []) + ['build-dep', '--'] self.apt_simulate_and_ask(cmd + packages) def apt_simulate_and_ask(self, cmd, split_download=True, run_clean=True):