From e8099a713c5e8aa8132cfb6a15956a72ccb05d95 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Wed, 14 Sep 2022 14:17:25 +0200 Subject: [PATCH] Ensure that existing packages are not re-released Signed-off-by: Evan Lezar --- scripts/release-packages.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/release-packages.sh b/scripts/release-packages.sh index 2c020ebe..d15e2ae6 100755 --- a/scripts/release-packages.sh +++ b/scripts/release-packages.sh @@ -132,8 +132,17 @@ function sync() { done if [[ ${REPO} == "stable" ]]; then - cp ${src}/nvidia-container-runtime*.${pkg_type} ${dst} - cp ${src}/nvidia-docker*.${pkg_type} ${dst} + for f in $(ls ${src}/nvidia-container-runtime*.${pkg_type} ${src}/nvidia-docker*.${pkg_type}); do + df=${dst}/$(basename ${f}) + df_stable=${df//"/experimental/"/"/stable/"} + if [[ -f "${df}" ]]; then + echo "${df} already exists; skipping" + elif [[ ${REPO} == "experimental" && -f ${df_stable} ]]; then + echo "${df_stable} already exists; skipping" + else + cp ${f} ${df} + fi + done fi }