File: buildnb

package info (click to toggle)
imview 1.1.9h-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 5,528 kB
  • sloc: cpp: 32,590; sh: 2,664; ansic: 1,900; makefile: 811; exp: 112; python: 88
file content (19 lines) | stat: -rwxr-xr-x 703 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
# increments build number
buildno=`egrep '^int buildnb' patchlevel.h | awk '{print $4}'`
totalbno=`egrep '^int totalbnb' patchlevel.h | awk '{print $4}'`
buildno=`expr ${buildno} + 1`
totalbno=`expr ${totalbno} + 1`
sed -e '/^const char \*patchlevel/q' patchlevel.h > tmppatch
if cp tmppatch patchlevel.h ; then
  rm tmppatch
  echo "int buildnb = $buildno ;" >> patchlevel.h 
  echo "int totalbnb = $totalbno ;" >> patchlevel.h 
  # use the Real user name if available, else the logname
  if [ "${NAME}" != "" ] ; then
     echo "const char *builder = \"$NAME\" ;" >> patchlevel.h 
  else
     echo "const char *builder = \"$USER\" ;" >> patchlevel.h 
  fi
fi
echo "Incrementing build level"