From c47b00b961dbdf2f3266de72c2c1f7c829d7f4f0 Mon Sep 17 00:00:00 2001 From: Gitouche <26656-gitouche@users.noreply.framagit.org> Date: Sun, 6 Feb 2022 22:00:45 +0100 Subject: [PATCH] docker_rpmbuild-rebuild_msmtp.sh : more variables - can be used to rebuild other packages --- docker_rpmbuild-rebuild_msmtp.sh | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/docker_rpmbuild-rebuild_msmtp.sh b/docker_rpmbuild-rebuild_msmtp.sh index 0dcdffc..901da74 100755 --- a/docker_rpmbuild-rebuild_msmtp.sh +++ b/docker_rpmbuild-rebuild_msmtp.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash FROMFEDORA='34' +PACKAGE='msmtp' ABSDIR="$( dirname "$(readlink -f -- "$0")" )" cd ${ABSDIR} @@ -8,28 +9,28 @@ cd ${ABSDIR} type -P docker >/dev/null && DOCKER=$(which docker) type -P podman >/dev/null && DOCKER=$(which podman) -if ! JSONLINE=$(curl -s https://src.fedoraproject.org/_dg/bodhi_updates/rpms/msmtp | grep -e "fc${FROMFEDORA}\","); then - echo "ERROR : No msmtp release available for Fedora ${FROMFEDORA}" - echo "Please check https://src.fedoraproject.org/rpms/msmtp to choose the right release." +if ! JSONLINE=$(curl -s https://src.fedoraproject.org/_dg/bodhi_updates/rpms/${PACKAGE} | grep -e "fc${FROMFEDORA}\","); then + echo "ERROR : No ${PACKAGE} release available for Fedora ${FROMFEDORA}" + echo "Please check https://src.fedoraproject.org/rpms/${PACKAGE} to choose the right release." exit 1 fi -MSMTP_VERSION=$(echo "${JSONLINE}" | sed -e "s/^\s*\"stable\": \"msmtp-\(.*\)\.fc${FROMFEDORA}\",\s*$/\1/") +VERSION=$(echo "${JSONLINE}" | sed -e "s/^\s*\"stable\": \"${PACKAGE}-\(.*\)\.fc${FROMFEDORA}\",\s*$/\1/") ARCH=$(${DOCKER} run --rm docker.io/library/rockylinux:8 uname -i) -${DOCKER} build -t docker-msmtp-build -f- . <