From 6c1ff12d74c3971d5c5e14a3429c5d1ca9da4b58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Ospal=C3=BD?= Date: Wed, 12 Jan 2022 19:00:19 +0100 Subject: [PATCH] F one-infra#39: Add weak dependency support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New variable RECOMMENDS can be used as a weak dependency list on rpm and deb based distros. The package open-vm-tools is moved to RECOMMENDS on el7 and el8 due to the absence of arm64 version of these packages in RH distros. Signed-off-by: Petr OspalĂ˝ --- generate.sh | 2 ++ targets.sh | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/generate.sh b/generate.sh index 49107ac..8080c10 100755 --- a/generate.sh +++ b/generate.sh @@ -198,6 +198,8 @@ else --rpm-os linux \ --rpm-summary "${SUMMARY}" \ ${DEPENDS:+ --depends ${DEPENDS// / --depends }} \ + ${RECOMMENDS:+ --rpm-tag Recommends:${RECOMMENDS// / --rpm-tag Recommends:}} \ + ${RECOMMENDS:+ --deb-recommends ${RECOMMENDS// / --deb-recommends }} \ ${REPLACES:+ --replaces ${REPLACES// / --replaces }} \ ${CONFLICTS:+ --conflicts ${CONFLICTS// / --conflicts }} \ ${PROVIDES:+ --provides ${PROVIDES// / --provides }} \ diff --git a/targets.sh b/targets.sh index 660c44d..38589ed 100644 --- a/targets.sh +++ b/targets.sh @@ -53,7 +53,8 @@ case "${TARGET}" in RELSUFFIX=${RELSUFFIX:-.el7} TYPE=${TYPE:-rpm} TAGS=${TAGS:-linux rpm systemd one network-scripts} - DEPENDS=${DEPENDS:-util-linux bash curl bind-utils cloud-utils-growpart parted ruby rubygem-json sudo shadow-utils openssh-server open-vm-tools qemu-guest-agent gawk virt-what} + DEPENDS=${DEPENDS:-util-linux bash curl bind-utils cloud-utils-growpart parted ruby rubygem-json sudo shadow-utils openssh-server qemu-guest-agent gawk virt-what} + RECOMMENDS=${RECOMMENDS:-open-vm-tools} PROVIDES=${PROVIDES:-} REPLACES=${REPLACES:-cloud-init} CONFLICTS=${CONFLICTS:-${REPLACES} one-context-ec2} @@ -68,7 +69,8 @@ case "${TARGET}" in RELSUFFIX=${RELSUFFIX:-.el8} TYPE=${TYPE:-rpm} TAGS=${TAGS:-linux rpm systemd one network-scripts} - DEPENDS=${DEPENDS:-util-linux bash curl bind-utils cloud-utils-growpart parted ruby rubygem-json sudo shadow-utils openssh-server open-vm-tools qemu-guest-agent network-scripts gawk virt-what} + DEPENDS=${DEPENDS:-util-linux bash curl bind-utils cloud-utils-growpart parted ruby rubygem-json sudo shadow-utils openssh-server qemu-guest-agent network-scripts gawk virt-what} + RECOMMENDS=${RECOMMENDS:-open-vm-tools} PROVIDES=${PROVIDES:-} REPLACES=${REPLACES:-cloud-init} CONFLICTS=${CONFLICTS:-${REPLACES} one-context-ec2}