From 38b90453bc26e73b827104219f1cfd014ea5f6ca Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Sun, 17 Jun 2018 02:34:29 -0400 Subject: Packaging voodoo to support same code version on multiple releases. reprepro strictly follows the Debian package rule that two package files which have the same name must have identical content. Which is fine, except when we want to support the same version of a package on multiple releases of the same Debian-flavored operating system. The usual hack for this is to add a release-specific tag to the end of the version string. The brute force way of doing this requires modifying the source package for each release, but there's an obscure hack which lets us augment the binary package versions directly. --- Makefile | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 131df63..ccc61fd 100644 --- a/Makefile +++ b/Makefile @@ -102,6 +102,12 @@ ${TAMPER}: tamper tamper: ${MAKE} -C $(dir ${TAMPER}) +# For extra credit, figure out how to put the right path names into +# the initial source tarball so we don't need to mess with it in the loop. +# +# For more extra credit, figure out how to do the pbuilder stuff as +# GNU make $(eval) rules rather than as a shell for loop. Maybe. + dsc: rm -f source/debian/changelog ${PACKAGE_NAME}_*.dsc ${PACKAGE_NAME}_*.tar.xz ${PACKAGE_NAME}_*_source.build ${PACKAGE_NAME}_*_source.changes cd source; ../scripts/build-debian-control-files.py --debemail='${GPG_USER}' --package='${PACKAGE_NAME}' --newversion='${PACKAGE_VERSION}' --conflicts='${PACKAGE_CONFLICT}' @@ -110,14 +116,17 @@ dsc: pbuilder: rm -f ${PBUILDER_BASE}/*result/* touch -d 'last week' .pbuilder-sell-by-date - umask ${REPO_UMASK}; \ + set -x; umask ${REPO_UMASK}; \ for target in ${PBUILDER_TARGETS}; do echo $$target | tr '/' ' '; done | \ while read dist code arch; do \ - reprepro -b ${REPO_BASE}/apt/$$dist -A $$arch list $$code ${PACKAGE_NAME} | awk '{v = $$3} END {exit v != "${PACKAGE_VERSION}"}' && continue; \ + reprepro -b ${REPO_BASE}/apt/$$dist -A $$arch list $$code ${PACKAGE_NAME} | awk -v "c=$$code" '{v = $$3} END {exit v != "${PACKAGE_VERSION}~" c}' && continue; \ if test $${HOME}/pbuilder/$${code}-$${arch}-base.tgz -ot .pbuilder-sell-by-date; then pbuilder-dist $$code $$arch update; else true; fi; \ pbuilder-dist $$code $$arch build ${PACKAGE_NAME}_${PACKAGE_VERSION}.dsc; \ + test -f ${REPO_BASE}/brew/tarballs/${PACKAGE_NAME}_${PACKAGE_VERSION}.tar.xz || \ cp -p ${PBUILDER_BASE}/$${code}-$${arch}_result/${PACKAGE_NAME}_${PACKAGE_VERSION}.tar.xz ${REPO_BASE}/brew/tarballs/; \ - reprepro -b ${REPO_BASE}/apt/$$dist include $$code ${PBUILDER_BASE}/$${code}-$${arch}_result/${PACKAGE_NAME}_${PACKAGE_VERSION}_$${arch}.changes; \ + reprepro -b ${REPO_BASE}/apt/$$dist -T dsc list $$code ${PACKAGE_NAME} | awk '{v = $$3} END {exit v != "${PACKAGE_VERSION}"}' || \ + reprepro -b ${REPO_BASE}/apt/$$dist includedsc $$code ${PBUILDER_BASE}/$${code}-$${arch}_result/${PACKAGE_NAME}_${PACKAGE_VERSION}.dsc; \ + reprepro -b ${REPO_BASE}/apt/$$dist includedeb $$code ${PBUILDER_BASE}/$${code}-$${arch}_result/${PACKAGE_NAME}_${PACKAGE_VERSION}~$${code}_$${arch}.deb; \ done homebrew: -- cgit v1.2.3