From c89ea4ab4c6c1acd1ce6034806b2026ee1bab411 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Wed, 27 Apr 2022 19:42:37 +0200 Subject: [PATCH] Improve build.sh logging and try to fix version detection method --- build.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/build.sh b/build.sh index 5928984..d93ee43 100755 --- a/build.sh +++ b/build.sh @@ -6,16 +6,19 @@ QUIET_ARG="" # Enter source directory cd $( dirname $0 ) -# Clean previous build +echo "Clean previous build..." rm -fr dist deb_dist -# Set version in pyproject.toml -VERSION="$( git describe --tags )" +echo "Detect version using git describe..." +VERSION="$( git describe --tags --always )" + +echo "Set version in setup.py using sed..." sed -i "s/^version *=.*$/version = '$VERSION'/" setup.py if [ -d venv ] then VENV=$( realpath venv ) + echo "Use existing virtualenv $VENV to install build dependencies" TEMP_VENV=0 else VENV=$(mktemp -d) @@ -30,7 +33,7 @@ $VENV/bin/python3 -m pip install stdeb GitPython wheel $QUIET_ARG echo "Build wheel package..." $VENV/bin/python3 setup.py bdist_wheel -# Check gitdch is installed +echo "Check gitdch is installed..." GITDCH=$(which gitdch) set -e if [ -z "$GITDCH" ] @@ -41,6 +44,7 @@ then GITDCH=$TMP_GITDCH/gitdch/gitdch else TMP_GITDCH="" + echo "Use existing installation of gitdch ($GITDCH)" fi echo "Build debian source package using stdeb sdist_dsc command..." @@ -57,7 +61,7 @@ find deb_dist/ -maxdepth 1 -type f ! -name '*.orig.tar.gz' -delete echo "Enter in debian package directory..." cd deb_dist/mylib-$VERSION -echo "Generate EE debian codename..." +echo "Retreive debian codename using lsb_release..." DEBIAN_CODENAME=$( lsb_release -c -s ) [ $( lsb_release -r -s ) -ge 9 ] && DEBIAN_CODENAME="${DEBIAN_CODENAME}-ee"