Files
harbour-core/harbour/package/mpkg_ver.sh
Viktor Szakats 92d24a5828 2012-12-03 13:03 UTC+0100 Viktor Szakats (harbour syenar.net)
* (whole trunk repo)
    * COPYING -> COPYING.txt
2012-12-03 13:52:22 +00:00

31 lines
894 B
Bash
Executable File

#!/bin/sh
#
# $Id$
#
# ---------------------------------------------------------------
# Copyright 2003 Przemyslaw Czerpak <druzus@priv.onet.pl>
# small set of functions used by Harbour scripts
# warning: some bash extensions are used
#
# See COPYING.txt for licensing terms.
# ---------------------------------------------------------------
get_hbver()
{
hb_rootdir="${1-..}"
FVER="${hb_rootdir}/include/hbver.h"
MAJOR=`sed -e '/HB_VER_MAJOR/ !d' -e 's/[^0-9]*\([^ ]*\).*/\1/g' "${FVER}"`
MINOR=`sed -e '/HB_VER_MINOR/ !d' -e 's/[^0-9]*\([^ ]*\).*/\1/g' "${FVER}"`
RELEA=`sed -e '/HB_VER_RELEASE/ !d' -e 's/[^0-9]*\([^ ]*\).*/\1/g' "${FVER}"`
echo "${MAJOR}.${MINOR}.${RELEA}"
}
get_hbverstat()
{
hb_rootdir="${1-..}"
FVER="${hb_rootdir}/include/hbver.h"
VERSTAT=`sed -e '/HB_VER_STATUS/ !d' -e 's/[^\"]*\"\([^\"]*\).*/\1/g' "${FVER}"`
echo "${VERSTAT}"
}