From 9ab6921105adca97bdd37b22d5978b5374209d6d Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Mon, 7 Mar 2022 18:37:17 +0100 Subject: [PATCH] dpkg-repo: repackage in TMP/pkg, use TMP as output directory This avoids the deb file containing itself, and having a /builder-... installed. --- packaging/dpkg-repo.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packaging/dpkg-repo.sh b/packaging/dpkg-repo.sh index 0231bef..d2c0ac8 100755 --- a/packaging/dpkg-repo.sh +++ b/packaging/dpkg-repo.sh @@ -97,14 +97,18 @@ cleanup () { trap cleanup EXIT -dpkg-deb -R "${FILENAME}" "${TMP}" +PKG_ROOT="${TMP}/pkg" + +mkdir "${PKG_ROOT}" + +dpkg-deb -R "${FILENAME}" "${PKG_ROOT}" VERSION=$(dpkg-deb -f "${FILENAME}" Version) NEW_VERSION="${VERSION}"-"${BUILD_TIME}"-"${SHA}" -sed -i "" -e "s/Version:.*/Version: ${NEW_VERSION}/g" "${TMP}/DEBIAN/control" +sed -i "" -e "s/Version:.*/Version: ${NEW_VERSION}/g" "${PKG_ROOT}/DEBIAN/control" -dpkg-deb --build "${TMP}" "${TMP}" +dpkg-deb --build "${PKG_ROOT}" "${TMP}" if ! aptly repo show "${PLATFORM}" > /dev/null 2>&1; then aptly repo create --distribution="${PLATFORM}" "${PLATFORM}"