diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-14 19:04:12 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-14 19:04:12 +0000 |
commit | 9694ed60541853cf6bb8d955b4b240dd853fa3fc (patch) | |
tree | a760946cc7522fd4789c07d8c154677317c6d1e3 /hooks/maybe-merged-usr/setup00.sh | |
parent | Adding upstream version 1.4.3. (diff) | |
download | mmdebstrap-9694ed60541853cf6bb8d955b4b240dd853fa3fc.tar.xz mmdebstrap-9694ed60541853cf6bb8d955b4b240dd853fa3fc.zip |
Adding upstream version 1.5.0.upstream/1.5.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-x | hooks/maybe-merged-usr/setup00.sh | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/hooks/maybe-merged-usr/setup00.sh b/hooks/maybe-merged-usr/setup00.sh index a6bd712..6568af2 100755 --- a/hooks/maybe-merged-usr/setup00.sh +++ b/hooks/maybe-merged-usr/setup00.sh @@ -4,12 +4,22 @@ set -eu env --chdir="$1" APT_CONFIG="$MMDEBSTRAP_APT_CONFIG" apt-get update --error-on=any -# if the usr-is-merged package cannot be installed with apt, do nothing -if ! env --chdir="$1" APT_CONFIG="$MMDEBSTRAP_APT_CONFIG" apt-cache show --no-all-versions usr-is-merged > /dev/null 2>&1; then - echo "no package called usr-is-merged found -- not running merged-usr setup hook" >&2 - exit 0 +if env --chdir="$1" APT_CONFIG="$MMDEBSTRAP_APT_CONFIG" apt-cache show --no-all-versions usr-is-merged > /dev/null 2>&1; then + # if apt-cache exited successfully, then usr-is-merged exists either as + # a real or virtual package + if env --chdir="$1" APT_CONFIG="$MMDEBSTRAP_APT_CONFIG" apt-cache show --no-all-versions usr-is-merged 2>/dev/null | grep -q "Package: usr-is-merged"; then + echo "usr-is-merged found -- running merged-usr setup hook" >&2 + else + # The usr-is-merged must be virtual, so assume that nothing + # has to be done. This is the case with Debian Trixie or later + # or with Ubuntu Lunar or later + echo "usr-is-merged found but not real -- not running merged-usr setup hook" >&2 + exit 0 + fi else - echo "package usr-is-merged found -- running merged-usr setup hook" >&2 + # if the usr-is-merged package cannot be installed with apt, do nothing + echo "no package providing usr-is-merged found -- not running merged-usr setup hook" >&2 + exit 0 fi # resolve the script path using several methods in order: |