From d429af5d5347d369c3ca8b52f1d4d9f67b9b2ac9 Mon Sep 17 00:00:00 2001 From: Daniel 'f0o' Preussker Date: Wed, 2 Oct 2019 10:56:41 +0200 Subject: [PATCH] Add Gentoo platform detection in diskimage-create/diskimage-create.sh Change-Id: Iac685b424d6ab03a23c35c9eef8356f50a2fe952 Task: 36882 Story: 2006646 --- diskimage-create/diskimage-create.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/diskimage-create/diskimage-create.sh b/diskimage-create/diskimage-create.sh index 3cc7426b35..a0014d0d7a 100755 --- a/diskimage-create/diskimage-create.sh +++ b/diskimage-create/diskimage-create.sh @@ -336,6 +336,27 @@ elif [[ $platform =~ "SUSE" ]]; then exit 1 fi done +elif [[ $platform =~ "Gentoo" ]]; then + # Gentoo + # Check /var/db for dev-vcs/git and app-emulation/[qemu|xen-tools] sys-fs/multipath-tools + PKG_LIST="dev-vcs/git app-emulation/qemu|xen-tools sys-fs/multipath-tools" + for pkg in $PKG_LIST; do + if grep -qs '|' <<< "$pkg"; then + c=$(cut -d / -f 1 <<<"$pkg") + for p in $(cut -d / -f 2 <<<"$pkg" | tr "|" " "); do + if [ -d /var/db/pkg/$c/$p-* ]; then + continue 2 + fi + done + echo "Required package " ${pkg/\*} " is not installed. Exiting." + echo "Binary dependencies on this platform are: ${PKG_LIST}" + exit 1 + elif [ ! -d /var/db/pkg/$pkg-* ]; then + echo "Required package " ${pkg/\*} " is not installed. Exiting." + echo "Binary dependencies on this platform are: ${PKG_LIST}" + exit 1 + fi + done else # fedora/centos/rhel # Actual qemu-img name may be qemu-img, qemu-img-ev, qemu-img-rhev, ...