From a057a05f403f35ba42a96775e906b683972ced51 Mon Sep 17 00:00:00 2001 From: bbhtt Date: Tue, 24 Oct 2023 08:57:55 +0530 Subject: [PATCH 1/2] Support git revisions in version --- .version | 1 + Makefile.am | 2 ++ configure.ac | 2 +- version.sh | 24 ++++++++++++++++++++++++ 4 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 .version create mode 100755 version.sh diff --git a/.version b/.version new file mode 100644 index 000000000..fff8b7773 --- /dev/null +++ b/.version @@ -0,0 +1 @@ +v1.15.4 diff --git a/Makefile.am b/Makefile.am index fd29cf6ab..a011d19d2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -68,6 +68,8 @@ data_convertdir = $(datadir)/GConf/gsettings dist_data_convert_DATA = liferea.convert EXTRA_DIST = \ + .version \ + version.sh \ net.sf.liferea.gschema.xml.in \ po/liferea.pot \ $(desktop_in_files) \ diff --git a/configure.ac b/configure.ac index d94f67239..b1d444e7a 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([liferea],[1.15.4],[liferea-devel@lists.sourceforge.net]) +AC_INIT([liferea],[m4_esyscmd([./version.sh|tr -d '\n'])],[liferea-devel@lists.sourceforge.net]) AC_CANONICAL_HOST AC_CONFIG_SRCDIR([src/feedlist.c]) diff --git a/version.sh b/version.sh new file mode 100755 index 000000000..f4192e1f9 --- /dev/null +++ b/version.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env sh + +set -eu + +DIR=$(dirname "$0") + +VER_FILE="${DIR}/.version" + +touch -c "${VER_FILE}" + +if [ -d "$DIR/.git" ]; then + EXACT_TAG=$(git name-rev --name-only --tags HEAD) + if [ "$EXACT_TAG" = 'undefined' ]; then + HEAD=$(git rev-parse --short HEAD) + DATE=$(git log -1 --format=%cd --date=format:'%Y-%m-%d') + VER="${HEAD}"-"${DATE}" + else + VER="$EXACT_TAG" + fi +else + VER="$(head -1 "${VER_FILE}")" +fi + +echo "$VER" From aa98369789df0079f123d384fc83739cb4442fd8 Mon Sep 17 00:00:00 2001 From: bbhtt Date: Tue, 24 Oct 2023 11:35:56 +0530 Subject: [PATCH 2/2] Cleanup some automake files to prevent reporting wrong versions --- autogen.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/autogen.sh b/autogen.sh index 928c17d0f..f1f8b51de 100755 --- a/autogen.sh +++ b/autogen.sh @@ -18,6 +18,9 @@ if [ "$tmp" = "" ]; then exit 1 fi +rm -f configure aclocal.m4 autom4te.cache/* +rmdir --ignore-fail-on-non-empty autom4te.cache +find . -iname "Makefile" -o -iname "Makefile.in" -o -iname "Makefile.in.in" -type f -exec rm -f '{}' + autoreconf -i intltoolize if test -z "$NOCONFIGURE"; then