Debian Codegraph @

dist/bumprel

raw
1 #!/bin/sh
2 #
3 # $Id: $
4 #
5 # Bump the Berkeley DB version
6
7 P=`pwd`
8 R=`dirname $P`
9 progname="$0"
10 VERSION="$1"
11 assembly="../lang/csharp/src/Properties/AssemblyInfo.cs"
12 t=/tmp/__assembly
13
14 # Sanity check
15 if [ ! -f $R/dist/RELEASE ] ; then
16 echo "$progname must be run in the dist directory of a Berkeley DB tree"
17 exit 1
18 fi
19
20 OIFS="$IFS"
21 IFS=.
22 set -- $VERSION
23
24 if [ $# != 5 ] ; then
25 echo "Usage: $progname X.X.X.X.X -- sets the Berkeley DB version to X.X.X.X.X"
26 exit 1
27 fi
28 FAMILY="$1" RELEASE="$2" MAJOR="$3" MINOR="$4" PATCH="$5"
29 DATE=`date "+%B %e, %Y"`
30
31 IFS="$OFS"
32
33 # Update the change log patch number -- there's 1 location to update in
34 # the change log "table of contents", and 2 in the Change Log itself.
35 #cd $R/docs_src/ref/changelog && vi toc.so ${MAJOR}.${MINOR}.html
36
37 # Update the release number.
38 cd $R/dist &&\
39 (echo "/^DB_VERSION_FAMILY/s/=.*/=$FAMILY/" &&\
40 echo "/^DB_VERSION_RELEASE/s/=.*/=$RELEASE/" &&\
41 echo "/^DB_VERSION_MAJOR/s/=.*/=$MAJOR/" &&\
42 echo "/^DB_VERSION_MINOR/s/=.*/=$MINOR/" &&\
43 echo "/^DB_VERSION_PATCH/s/=.*/=$PATCH/" &&\
44 echo "/^DB_RELEASE_DATE/s/=.*/=\"$DATE\"/" &&\
45 echo w &&\
46 echo q) | ed RELEASE > /dev/null
47 VERSION=`sh -c '. ./RELEASE; echo $DB_VERSION'`
48 echo "Berkeley DB release $VERSION."
49
50 # Build auto-generated files.
51 cd $R/dist && sh s_all
52
53 # Update the CSharp assembly information
54 sed -e "s:AssemblyVersion(\"[0-9]*\.[0-9]*\.[0-9]*\"):AssemblyVersion(\"$MAJOR\.$MINOR\.$PATCH\"):" < $assembly > $t
55 cmp $t $assembly > /dev/null 2>&1 ||
56 (rm -f $assembly && cp $t $assembly && rm -f $t && chmod 444 $assembly)
57
58 # Commit all of the changes.
59 echo "Now run 'hg commit && hg tag db-$MAJOR.$MINOR.$PATCH && hg push'"