From 078d48730d74893a1333bb4076aef18d34484326 Mon Sep 17 00:00:00 2001 From: Robur Date: Fri, 25 Feb 2022 13:34:24 +0000 Subject: [PATCH] Debian package repository: take aptly repo vs publish into account --- packaging/README.md | 4 ++++ packaging/dpkg-repo.sh | 7 +------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/packaging/README.md b/packaging/README.md index 17a08bd..a70938f 100644 --- a/packaging/README.md +++ b/packaging/README.md @@ -41,6 +41,10 @@ deb https://apt.robur.coop/ debian-10 main The `debian-10` can be exchanged with any platform you're building debian packages for. +Currently, the `dpkg-repo.sh` sets the HOME to `/home/builder` (where aptly +expects its configuration), and uses the platform (from builder) as +distribution. + ## FreeBSD package repository The dependency is FreeBSD's pkg utility. diff --git a/packaging/dpkg-repo.sh b/packaging/dpkg-repo.sh index bac2d58..0231bef 100755 --- a/packaging/dpkg-repo.sh +++ b/packaging/dpkg-repo.sh @@ -106,12 +106,7 @@ sed -i "" -e "s/Version:.*/Version: ${NEW_VERSION}/g" "${TMP}/DEBIAN/control" dpkg-deb --build "${TMP}" "${TMP}" -REPO_EXISTS=1 if ! aptly repo show "${PLATFORM}" > /dev/null 2>&1; then - REPO_EXISTS=0 -fi - -if [ "${REPO_EXISTS}" -eq 0 ]; then aptly repo create --distribution="${PLATFORM}" "${PLATFORM}" fi @@ -119,7 +114,7 @@ aptly repo add "${PLATFORM}" "${TMP}" : "${REPO_KEYID:="D5E2DC92617877EDF7D4FD4345EA05FB7E26053D"}" -if [ "${REPO_EXISTS}" -eq 0 ]; then +if ! aptly publish show "${PLATFORM}" > /dev/null 2>&1; then aptly publish repo -gpg-key="${REPO_KEYID}" "${PLATFORM}" else aptly publish update -gpg-key="${REPO_KEYID}" "${PLATFORM}"