diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 09:34:11 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 09:34:11 +0000 |
commit | 7ad64c4ba5ccab524960c8f1d468d7a47f7f72a9 (patch) | |
tree | 8594f58c909db66c01c175a5bad8bead9d3e4d52 /debian/tests/fake/pbuilder-0.228.4-1 | |
parent | Adding upstream version 1.0.123+deb11u2. (diff) | |
download | debootstrap-7ad64c4ba5ccab524960c8f1d468d7a47f7f72a9.tar.xz debootstrap-7ad64c4ba5ccab524960c8f1d468d7a47f7f72a9.zip |
Adding debian version 1.0.123+deb11u2.debian/1.0.123+deb11u2debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/tests/fake/pbuilder-0.228.4-1')
-rwxr-xr-x | debian/tests/fake/pbuilder-0.228.4-1 | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/debian/tests/fake/pbuilder-0.228.4-1 b/debian/tests/fake/pbuilder-0.228.4-1 new file mode 100755 index 0000000..308ed34 --- /dev/null +++ b/debian/tests/fake/pbuilder-0.228.4-1 @@ -0,0 +1,31 @@ +#!/bin/sh +# fake/pbuilder-0.228.4-1 -- emulate how pbuilder/0.228.4-1 would chroot. +# It mounts /dev/pts, without explicitly requesting a new instance or a +# usable /dev/pts/ptmx. +# (There is of course a lot more that it does, but these are the parts that +# affect pty users like script(1).) +# +# Copyright © 2017 Simon McVittie +# SPDX-License-Identifier: MIT +# (see debian/copyright) + +set -e + +chroot="$1" +shift +if test -z "$chroot" || test -z "$1"; then + echo "Usage: $0 CHROOT COMMAND...">&2 + exit 2 +fi + +mkdir -p "$chroot/dev/pts" +mount -t devpts none "$chroot/dev/pts" -onoexec,nosuid,gid=5,mode=620 + +ls -l "$chroot/dev/ptmx" | sed -e 's/^/# fake-pbuilder: /' >&2 +ls -l "$chroot/dev/pts/ptmx" | sed -e 's/^/# fake-pbuilder: /' >&2 + +e=0 +chroot "$chroot" "$@" || e=$? + +umount "$chroot/dev/pts" +exit "$e" |