3 # This file is part of Shapes.
5 # Shapes is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
10 # Shapes is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with Shapes. If not, see <http://www.gnu.org/licenses/>.
18 # Copyright 2008 Gustaf Hendeby
29 SVF
=SHAPES-VERSION-FILE
32 VN
=$
(sed -e '2,$ d' < $SVF_DEF)
33 VD
=$
(date +"%Y-%m-%d %T %z")
37 VN
=$
(sed -e '/NUMBER/! d' -e 's/VERSION_NUMBER := //' < $SVF_DIST)
38 VD
=$
(sed -e '/DATE/! d' -e 's/VERSION_DATE := //' < $SVF_DIST)
39 elif test -d $DIR/.git
&&
40 VN
=$
(cd ${DIR} && git describe
--abbrev=4 HEAD
2>/dev
/null
) &&
46 if test -z "$(cd ${DIR} && git diff-index --name-only HEAD)"
48 VD
=$
(cd ${DIR} && git show
--quiet --pretty="format:%ci" HEAD
)
56 FVN
=$
(sed -e '/NUMBER/! d' -e 's/VERSION_NUMBER := //' < $SVF)
57 FVD
=$
(sed -e '/DATE/! d' -e 's/VERSION_DATE := //' < $SVF)
63 VDcmp
=$
(echo "$VD" |
sed -e 's/\([0-9]\{2\}:[0-9]\{2\}\):[0-9.]*/\1/g')
64 FVDcmp
=$
(echo "$FVD" |
sed -e 's/\([0-9]\{2\}:[0-9]\{2\}\):[0-9.]*/\1/g')
65 test "$VDcmp" = "$FVDcmp" -a "$VN" = "$FVN" ||
{
67 VERSION_NUMBER := ${VN}
68 VERSION_DATE := ${VD}"
70 VERSION_NUMBER := ${VN}
71 VERSION_DATE := ${VD}" > $SVF