[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 17/21] Avoid redundancy in package version number/string
From: |
John Darrington |
Subject: |
[PATCH 17/21] Avoid redundancy in package version number/string |
Date: |
Sun, 12 Jan 2014 12:00:30 +0100 |
* configure.ac: Extract the GS_ symbols from the version number
provided to AC_INIT instead of duplicating it.
---
configure.ac | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac
index d6e2be0..dcce828 100644
--- a/configure.ac
+++ b/configure.ac
@@ -38,10 +38,23 @@ CPPFLAGS="${CPPFLAGS:=}"
CXXFLAGS="${CXXFLAGS:=}"
LDFLAGS="${LDFLAGS:=}"
-GS_VERSION_MAJOR=9
-GS_VERSION_MINOR=6
-GS_VERSION_PATCH=0
GS_REVISIONDATE=20130101
+# Extract major.minor.micro from the version number provided to AC_INIT above
+majmin=${PACKAGE_VERSION%\.*}
+
+major=${PACKAGE_VERSION/%\.*\.*/}
+minor=${majmin/#*\./}
+micro=${PACKAGE_VERSION/#*\.*\./}
+
+# Strip any leading zeros
+GS_VERSION_MAJOR=${major#"${major%%[!0]*}"}
+GS_VERSION_MINOR=${minor#"${minor%%[!0]*}"}
+GS_VERSION_PATCH=${micro#"${micro%%[!0]*}"}
+
+# If any component is now "" replace it with "0"
+GS_VERSION_MAJOR=${GS_VERSION_MAJOR:-0}
+GS_VERSION_MINOR=${GS_VERSION_MINOR:-0}
+GS_VERSION_PATCH=${GS_VERSION_PATCH:-0}
GS_VERSION=`expr $GS_VERSION_MAJOR \* 10000 + $GS_VERSION_MINOR \* 100 +
$GS_VERSION_PATCH`
--
1.7.10.4
- [PATCH 02/21] Makefile.in (top_srcdir): New variable, (continued)
- [PATCH 02/21] Makefile.in (top_srcdir): New variable, John Darrington, 2014/01/12
- [PATCH 06/21] configure: Fix endianess test while cross-compiling, John Darrington, 2014/01/12
- [PATCH 07/21] Fix test for fontconfig when cross building, John Darrington, 2014/01/12
- [PATCH 09/21] Simplify the conditional inclusion of the contrib directory., John Darrington, 2014/01/12
- [PATCH 08/21] configure.ac, Makefile.in: Use CC_FOR_BUILD for native compilation., John Darrington, 2014/01/12
- [PATCH 04/21] Fix crash on startup if the configuration file is missing., John Darrington, 2014/01/12
- [PATCH 13/21] Improve reliability of freetype library (esp. wrt cross-building), John Darrington, 2014/01/12
- [PATCH 05/21] base/lib.mak: Fix broken build dependency, John Darrington, 2014/01/12
- [PATCH 10/21] Fix test for dbus when cross building, John Darrington, 2014/01/12
- [PATCH 11/21] Fix incorrect determination of host/build OS, John Darrington, 2014/01/12
- [PATCH 17/21] Avoid redundancy in package version number/string,
John Darrington <=
- [PATCH 16/21] Remove the code running ./configure from autogen.sh - I am of the opinion, that the bootstrap process and the configuration should be kept seperate. It should be possible to bootstrap without configuring., John Darrington, 2014/01/12
- [PATCH 20/21] Remove 'exe' suffix from GS variable., John Darrington, 2014/01/12
- [PATCH 21/21] Do install contrib drivers if the --disable-contrib option was chosen., John Darrington, 2014/01/12
- [PATCH 14/21] Remove broken test for OpenJpeg library., John Darrington, 2014/01/12
- [PATCH 12/21] Minor re-ordering of configure.ac, John Darrington, 2014/01/12
- [PATCH 03/21] doc/gs-vms.htp: Gnu policy is not to acknowledge trademarks., John Darrington, 2014/01/12
- [PATCH 15/21] Correct bad directories for ROMFS_OBJS, John Darrington, 2014/01/12
- [PATCH 18/21] Remove hard coded variables for tools (eg: SHELL)., John Darrington, 2014/01/12
- [PATCH 19/21] Remove duplicate assignment to EXTRALIBS, John Darrington, 2014/01/12