summaryrefslogtreecommitdiff
path: root/expat/conftools/get-version.sh
diff options
context:
space:
mode:
authorChris Liddell <chris.liddell@artifex.com>2021-12-07 11:46:44 +0000
committerChris Liddell <chris.liddell@artifex.com>2021-12-07 12:13:37 +0000
commit488d8088e7e331076e7b5d0312d491f792d43f3b (patch)
tree50147fe958d578148706d56b8378d21579c1c527 /expat/conftools/get-version.sh
parentb20b66200381b4e348931b97187ef7b93ab4e655 (diff)
downloadghostpdl-488d8088e7e331076e7b5d0312d491f792d43f3b.tar.gz
Update expat to 2.4.1
Diffstat (limited to 'expat/conftools/get-version.sh')
-rwxr-xr-xexpat/conftools/get-version.sh19
1 files changed, 15 insertions, 4 deletions
diff --git a/expat/conftools/get-version.sh b/expat/conftools/get-version.sh
index 2592f1032..a70e0fb47 100755
--- a/expat/conftools/get-version.sh
+++ b/expat/conftools/get-version.sh
@@ -28,8 +28,19 @@ if test ! -r "$hdr"; then
exit 1
fi
-MAJOR_VERSION=$(sed -n -e '/MAJOR_VERSION/s/[^0-9]*//gp' "$hdr")
-MINOR_VERSION=$(sed -n -e '/MINOR_VERSION/s/[^0-9]*//gp' "$hdr")
-MICRO_VERSION=$(sed -n -e '/MICRO_VERSION/s/[^0-9]*//gp' "$hdr")
+MAJOR_VERSION="`sed -n -e '/MAJOR_VERSION/s/[^0-9]*//gp' $hdr`"
+MINOR_VERSION="`sed -n -e '/MINOR_VERSION/s/[^0-9]*//gp' $hdr`"
+MICRO_VERSION="`sed -n -e '/MICRO_VERSION/s/[^0-9]*//gp' $hdr`"
-printf '%s.%s.%s' "$MAJOR_VERSION" "$MINOR_VERSION" "$MICRO_VERSION"
+# Determine how to tell echo not to print the trailing \n. This is
+# similar to Autoconf's @ECHO_C@ and @ECHO_N@; however, we don't
+# generate this file via autoconf (in fact, get-version.sh is used
+# to *create* ./configure), so we just do something similar inline.
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ;;
+ *) ECHO_N= ECHO_C='\c' ;;
+esac
+
+echo $ECHO_N "$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$ECHO_C"