diff options
author | Andreas Dilger <adilger@dilger.ca> | 2023-05-09 22:57:57 -0600 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2023-12-01 11:06:26 -0500 |
commit | 1ac0061609c69cc9fe01bd116915632c2bc7c497 (patch) | |
tree | 4af82833feb6348398fa1a49b0e7fb7e6b908975 /configure.ac | |
parent | 4e16d629e016154139d7429ad84929e280681f3a (diff) |
build: split version and release in configure
Update configure.ac to separate Version from Release if there is
a '-' in version.h::E2FSPROGS_VERSION (e.g. "1.46.6-rc1").
Otherwise, the '-' in the version can make RPM building unhappy.
Simplify the generation of E2FSPROGS_VERESION, E2FSPROGS_DATE and
E2FSPROGS_DAY to avoid multiple grep/awk/sed/tr stages.
Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Link: https://lore.kernel.org/r/1683694677-9366-1-git-send-email-adilger@dilger.ca
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac index b905e999..371e2bf1 100644 --- a/configure.ac +++ b/configure.ac @@ -11,11 +11,9 @@ BINARY_TYPE=bin dnl dnl This is to figure out the version number and the date.... dnl -E2FSPROGS_VERSION=`grep E2FSPROGS_VERSION ${srcdir}/version.h \ - | awk '{print $3}' | tr \" " " | awk '{print $1}'` -E2FSPROGS_DATE=`grep E2FSPROGS_DATE ${srcdir}/version.h | awk '{print $3}' \ - | tr \" " " | awk '{print $1}'` -E2FSPROGS_DAY=$(echo $E2FSPROGS_DATE | awk -F- '{print $1}' | sed -e '/^[[1-9]]$/s/^/0/') +E2FSPROGS_VERSION=`awk -F\" '/E2FSPROGS_VERS/ { print $2 }' ${srcdir}/version.h` +E2FSPROGS_DATE=`awk -F\" '/E2FSPROGS_DATE/ { print $2 }' ${srcdir}/version.h` +E2FSPROGS_DAY=$(echo $E2FSPROGS_DATE | awk -F- '{ printf "%02d", $1 }') MONTH=`echo $E2FSPROGS_DATE | awk -F- '{print $2}'` YEAR=`echo $E2FSPROGS_DATE | awk -F- '{print $3}'` @@ -43,27 +41,31 @@ Dec) MONTH_NUM=12; E2FSPROGS_MONTH="December" ;; *) AC_MSG_WARN([Unknown month $MONTH??]) ;; esac -base_ver=`echo $E2FSPROGS_VERSION | \ - sed -e 's/-WIP//' -e 's/pre-//' -e 's/-PLUS//'` +base_ver=`echo $E2FSPROGS_VERSION | sed -e 's/pre-//' -e 's/-.*//'` +base_rel=`echo $E2FSPROGS_VERSION | awk -F- '{ print $2 }'` date_spec=${E2FSPROGS_YEAR}.${MONTH_NUM}.${E2FSPROGS_DAY} case $E2FSPROGS_VERSION in *-WIP|pre-*) - E2FSPROGS_PKGVER="$base_ver~WIP.$date_spec" + E2FSPROGS_PKGVER="$base_ver" + E2FSPROGS_PKGREL="WIP.$date_spec" ;; *) E2FSPROGS_PKGVER="$base_ver" + E2FSPROGS_PKGREL="$base_rel" ;; esac unset DATE MONTH YEAR base_ver pre_vers date_spec AC_MSG_RESULT([Generating configuration file for e2fsprogs version $E2FSPROGS_VERSION]) +AC_MSG_RESULT([Package version ${E2FSPROGS_PKGVER} release ${E2FSPROGS_PKGREL}]) AC_MSG_RESULT([Release date is ${E2FSPROGS_MONTH}, ${E2FSPROGS_YEAR}]) AC_SUBST(E2FSPROGS_YEAR) AC_SUBST(E2FSPROGS_MONTH) AC_SUBST(E2FSPROGS_DAY) AC_SUBST(E2FSPROGS_VERSION) +AC_SUBST(E2FSPROGS_PKGREL) AC_SUBST(E2FSPROGS_PKGVER) AC_SUBST(E2FSPROGS_DATE) dnl |