From bf35e3fbae404d1e7b5a3618caab6f3a61502583 Mon Sep 17 00:00:00 2001 From: Robur Date: Mon, 20 Nov 2023 12:11:52 +0000 Subject: [PATCH] repo scripts: remove existing packages In the end the packaging tooling does not like multiple versions of the same package. Thus we remove old packages before publishing. --- packaging/FreeBSD-repo.sh | 1 + packaging/dpkg-repo.sh | 2 ++ 2 files changed, 3 insertions(+) diff --git a/packaging/FreeBSD-repo.sh b/packaging/FreeBSD-repo.sh index 45dcfaf..9d76033 100755 --- a/packaging/FreeBSD-repo.sh +++ b/packaging/FreeBSD-repo.sh @@ -124,6 +124,7 @@ PKG_DIR="${REPO_DIR}/All" # and then move it before recreating the index pkg create -r "${PKG_ROOT}" -m "${MANIFEST}" -o "${TMP}" mkdir -p "${PKG_DIR}" +rm -f "${PKG_DIR}"/"${NAME}"-*.pkg mv "${TMP}/${NAME}-${FULL_VERSION}.pkg" "${PKG_DIR}" pkg repo "${REPO_DIR}" "${REPO_KEY}" diff --git a/packaging/dpkg-repo.sh b/packaging/dpkg-repo.sh index 8e8921b..4cfd61d 100755 --- a/packaging/dpkg-repo.sh +++ b/packaging/dpkg-repo.sh @@ -124,6 +124,8 @@ if ! aptly repo show "${PLATFORM}" > /dev/null 2>&1; then aptly repo create --distribution="${PLATFORM}" "${PLATFORM}" fi +PACKAGE=$(dpkg-deb -f "${FILENAME}" Package) +aptly repo remove "${PLATFORM}" "${PACKAGE}" aptly repo add "${PLATFORM}" "${TMP}" : "${REPO_KEYID:="D5E2DC92617877EDF7D4FD4345EA05FB7E26053D"}"