From d986554833d798402cb24a18b6cda8e59965a52d Mon Sep 17 00:00:00 2001 From: Renaud Lepage Date: Wed, 13 Nov 2024 11:09:01 -0800 Subject: [PATCH] Clever way to fix version string, and checkout upstream at intended version --- .github/build-nest-v3 | 2 +- debian/changelog | 6 ++++++ main.sh | 10 +++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/build-nest-v3 b/.github/build-nest-v3 index 8fdd954..b393560 100644 --- a/.github/build-nest-v3 +++ b/.github/build-nest-v3 @@ -1 +1 @@ -22 \ No newline at end of file +23 \ No newline at end of file diff --git a/debian/changelog b/debian/changelog index 2c4dc1b..115b398 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +sbctl (0.16.0-101pika2) pika; urgency=low + + * Build proper version sources + + -- cybik Wed, 13 Nov 2024 11:15:00 -0800 + sbctl (0.16.0-101pika1) pika; urgency=low * Upstream release diff --git a/main.sh b/main.sh index 0cb4ee9..e27ef22 100755 --- a/main.sh +++ b/main.sh @@ -12,7 +12,7 @@ VERSION="0.16" UPSTREAM_NAME="sbctl" # Checkout and munch -git clone https://github.com/Foxboron/sbctl.git "${UPSTREAM_NAME}" +git clone https://github.com/Foxboron/sbctl.git "${UPSTREAM_NAME}" -b "${VERSION}" cp -rvf ./debian ./${UPSTREAM_NAME}/ # easier than figuring out the right way to override the prefix in the makefile @@ -22,6 +22,14 @@ sed -i "s/\$(PREFIX)\/bin/\$(PREFIX)\/sbin/" "${UPSTREAM_NAME}/Makefile" # Get in there. pushd "./${UPSTREAM_NAME}/" || exit 1 +# Clever way to auto-add a .0 if the upstream version is not semver +VER_PER_COUNT="${VERSION//[^\.]}" +if (( ${#VER_PER_COUNT} < 2 )); then + TRUE_VERSION="${VERSION}.0" +else + TRUE_VERSION="${VERSION}" +fi + # Get build deps LOGNAME=root dh_make --createorig -y -l -p ${UPSTREAM_NAME}_"$VERSION".0 || echo "dh-make: Ignoring Last Error" apt-get build-dep ./ -y