torque_install/torque/buildutils/determine.version
ruoyunbai 2bb9621e30 1
2021-09-29 21:06:16 +08:00

25 lines
576 B
Bash

#!/bin/bash
root_path="${1}"
if [ -z "${root_path}" ]
then
base_name="`echo ${0} | sed 's|[^/]*$||'`"
# Assume the script directory is buildutils/
root_path="${base_name}/../"
fi
cat "${root_path}/configure.ac" | awk '/^ *AC_INIT/ {
ac_init_line = $0
while (!match($0,/\)/))
{
getline
ac_init_line = ac_init_line $0
}
sub(/AC_INIT *\([ \t]*\[/,"",ac_init_line)
sub(/\][ \t]*\) *$/,"",ac_init_line)
split(ac_init_line,info,/\][ \t]*,[ \t]*\[/)
name=info[1]
version=info[2]
email=info[3]
print version
}'