Added script to help update all the version strings and dates.
[geda-gaf/whiteaudio.git] / update-versions.sh
blob21ffa5186a53d053a000f5ac1d454adf12f97707
1 #!/bin/sh
3 usage()
5 echo usage: $0 dotted_version date libgeda_sharedlib_version
6 echo Exmaple:
7 echo " $0 1.0.1 20070626 29:1:0"
10 new_dottedversion=$1
11 new_date=$2
12 new_sharedlibversion=$3
13 if [ "$new_dottedversion" = "" ]
14 then
15 echo Missing dotted version
16 echo ""
17 usage
18 exit 1
21 if [ "$new_date" = "" ]
22 then
23 echo Missing date
24 echo ""
25 usage
26 exit 1
29 if [ "$new_sharedlibversion" = "" ]
30 then
31 echo Missing libgeda shared library version
32 echo ""
33 usage
34 exit 1
38 old_dottedversion=`cat libgeda/include/defines.h | \
39 grep "#define PREPEND_VERSION_STRING" | awk '{print $3}'`
41 old_date=`grep ^VERSION= libgeda/configure.ac | \
42 awk -F= '{print $2}'`
44 old_sharedlibversion=`grep ^SHARED_LIBRARY_VERSION libgeda/configure.ac | \
45 awk -F= '{print $2}'`
47 # Update dotted version
48 libgeda_defines=libgeda/include/defines.h
49 echo Updating $old_dottedversion to \"$new_dottedversion-\" in $libgeda_defines
50 mv -f $libgeda_defines $libgeda_defines.orig
51 cat $libgeda_defines.orig | sed "s/#define PREPEND_VERSION_STRING $old_dottedversion/#define PREPEND_VERSION_STRING \"$new_dottedversion-\"/" > $libgeda_defines
52 rm -f $libgeda_defines.orig
54 # Update dates
55 date_files="docs/configure.ac examples/configure.ac gattrib/configure.ac gnetlist/configure.ac gsymcheck/configure.ac libgeda/configure.ac symbols/configure.ac utils/configure.ac gschem/configure.ac.in"
57 for i in $date_files
59 echo Updating $old_date to $new_date in $i
60 mv -f $i $i.orig
61 cat $i.orig | sed "s/^VERSION=$old_date/VERSION=$new_date/" > $i
62 rm -f $i.orig
63 done
65 # Update shared library version
66 libgeda_conf=libgeda/configure.ac
67 echo Updating $old_sharedlibversion to $new_sharedlibversion in $libgeda_conf
68 mv -f $libgeda_conf $libgeda_conf.orig2
69 cat $libgeda_conf.orig2 | \
70 sed "s/^SHARED_LIBRARY_VERSION=$old_sharedlibversion/SHARED_LIBRARY_VERSION=$new_sharedlibversion/" > $libgeda_conf
71 rm -f $libgeda_conf.orig2