File: version

package info (click to toggle)
lmbench 3.0-a9%2Bdebian.1-3
  • links: PTS
  • area: non-free
  • in suites: bullseye
  • size: 2,752 kB
  • sloc: ansic: 12,328; perl: 6,531; sh: 3,965; makefile: 730
file content (18 lines) | stat: -rwxr-xr-x 402 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

# %W% %@%
SRCDIR=${SRCDIR:-../src}

F="no_such_file"
VERSION="3.0-`date '+%Y%m%d'`"
for f in version.h ${SRCDIR}/version.h src/version.h
do
	if [ $F = "no_such_file" -a -f $f ]
	then
		F=$f
	fi
done
if [ -f $F ]
then	VERSION=`awk '/MAJOR/ { major = $3; } /MINOR/ { minor=$3;} END { if (minor < 0) printf("%d.0-a%d", major, -minor); else printf("%d.%d", major, minor);}' $F`
fi
echo $VERSION