diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 14:14:39 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 14:14:39 +0000 |
commit | ee17e45964b786b48b455959dfe68715971893fb (patch) | |
tree | 118f40aa65dc838499053413b05adfd00f839c62 /hooks/merged-usr/essential00.sh | |
parent | Initial commit. (diff) | |
download | mmdebstrap-ee17e45964b786b48b455959dfe68715971893fb.tar.xz mmdebstrap-ee17e45964b786b48b455959dfe68715971893fb.zip |
Adding upstream version 1.4.3.upstream/1.4.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'hooks/merged-usr/essential00.sh')
-rwxr-xr-x | hooks/merged-usr/essential00.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/hooks/merged-usr/essential00.sh b/hooks/merged-usr/essential00.sh new file mode 100755 index 0000000..d9a8130 --- /dev/null +++ b/hooks/merged-usr/essential00.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +set -eu + +if [ "${MMDEBSTRAP_VERBOSITY:-1}" -ge 3 ]; then + set -x +fi + +TARGET="$1" + +if [ "${MMDEBSTRAP_MODE:-}" = "chrootless" ]; then + APT_CONFIG=$MMDEBSTRAP_APT_CONFIG apt-get --yes install \ + -oDPkg::Chroot-Directory= \ + -oDPkg::Options::=--force-not-root \ + -oDPkg::Options::=--force-script-chrootless \ + -oDPkg::Options::=--root="$TARGET" \ + -oDPkg::Options::=--log="$TARGET/var/log/dpkg.log" \ + usr-is-merged + export DPKG_ROOT="$TARGET" + dpkg-query --showformat '${db:Status-Status}\n' --show usr-is-merged | grep -q '^installed$' + dpkg-query --showformat '${Source}\n' --show usr-is-merged | grep -q '^usrmerge$' + dpkg --compare-versions "1" "lt" "$(dpkg-query --showformat '${Version}\n' --show usr-is-merged)" +else + APT_CONFIG=$MMDEBSTRAP_APT_CONFIG apt-get --yes install usr-is-merged + chroot "$TARGET" dpkg-query --showformat '${db:Status-Status}\n' --show usr-is-merged | grep -q '^installed$' + chroot "$TARGET" dpkg-query --showformat '${Source}\n' --show usr-is-merged | grep -q '^usrmerge$' + dpkg --compare-versions "1" "lt" "$(chroot "$TARGET" dpkg-query --showformat '${Version}\n' --show usr-is-merged)" +fi |