version.sh: more elegant extraction of old version

sed is rather powerful ;)

Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
This commit is contained in:
Oswald Buddenhagen 2009-06-13 10:14:06 +02:00 committed by Sergei Trofimovich
parent c7ba6209df
commit d327943f4d
1 changed files with 1 additions and 1 deletions

View File

@ -30,7 +30,7 @@ new_version="$(git --git-dir "${src_top_dir}" describe 2>/dev/null)"
saved_version=
[ -r ${VERSION_FILE} ] && {
saved_version=$(grep '^#define MC_CURRENT_VERSION' ${VERSION_FILE}| sed -r 's/.*"(.*)"$/\1/')
saved_version=$(sed -rn 's/^#define MC_CURRENT_VERSION "(.*)"$/\1/p' ${VERSION_FILE})
}
[ -z "${saved_version}" -o "${saved_version}" != "${new_version}" ] && {