3
# This script updates Deadwood 2.9
5
# To run this script, make sure that this script is in the directory
6
# containing the tarball for the version of Deadwood you wish to update, and
7
# all of the patches are in a directory entitled 'patches'.
10
CURRENT=${CURRENT##*/}
13
# The revision number; in the case of having multiple snapshots a day,
14
# the revision number can be incremented so as to minimize confusion
15
# This is only done when more than one snapshop is uploaded to the
16
# maradns.org server in a given day.
19
# Make a clean CURRENT install, which we rename NEXT
20
rm -fr deadwood-$CURRENT 2> /dev/null
21
rm -fr deadwood-$NEXT 2> /dev/null
22
echo extracting tarball
23
tar xjf deadwood-$CURRENT.tar.bz2
25
echo run this from the correct directory
28
rm -fr deadwood-$NEXT*
29
mv deadwood-$CURRENT deadwood-$NEXT
35
if [ "$1" != "new" ] ; then
36
cp ../patches/deadwood-$CURRENT* update/$NEXT
37
#cp ../patches/maradns* update/$NEXT
41
# This is one of the few places where we will need to change anything
42
# in this script from version to version
46
# Regenerate Deadwood's random prime number
47
echo Making new random prime
49
rm -f *orig # While we're here, remove any pesky .orig files
50
cc -o foo RandomPrime.c
55
# Release-specific fixes and changes go here
57
# Patch #1: Unless STRICT_RFC2671_COMPLIANCE is defined, we handle a
58
# DNS packet with EDNS information as if the EDNS part of the packet
60
patch -p1 < update/2.9.04/deadwood-2.9.03-handle_edns.patch
62
# Patch #2: Convert DNS queries in to lower case before sending them
64
#cp src/DwUdpSocket.c src/DwUdpSocket.c.orig
65
patch -p1 < update/2.9.04/deadwood-2.9.03-lower_case.patch
67
# Patch #3: Tune the default timeout_seconds down to 2 seconds and
68
# increase the cap on the maximum number of DNS queries we can process at
69
# the same time up to 16,384
70
patch -p1 < update/2.9.04/deadwood-2.9.03-tune_params.patch
72
# Patch #4: Update CHANGELOG
73
patch -p1 < update/2.9.04/deadwood-2.9.03-changelog.patch
75
# Convert tabs in code to spaces, since this is inconsistant in different
76
# programs; disable when in "work" mode since it messes up patches
77
if [ "$1" != "work" ] ; then
78
echo removing tabs from source files
79
for a in $( find . -type f -name \*.[ch] ) ; do
84
chmod 755 src/make.version.h
86
echo updating documentation
87
# Update the documentation
90
# Go back to the deadwood dir
93
# Go one level higher than the toplevel directory to copy this script
97
# Put this script in the "build" directory
98
cp $0 deadwood-$NEXT/update/$NEXT
100
# Version number always current
101
cd deadwood-$NEXT/src
102
./make.version.h > version.h
105
if [ "$1" = "new" ] ; then
106
tar xjf deadwood-$CURRENT.tar.bz2
107
echo OK, both deadwood-$CURRENT and deadwood-$NEXT made\; you
108
echo now can start making patches.
112
if [ "$1" != "go" ] && [ "$1" != "snap" ] && [ "$1" != "work" ] ; then
113
echo OK, deadwood-$NEXT built. Confirm this compiles and
114
echo perform basic regression before re-running this to make
115
echo the tarballs. Once you have tested this, rerun this
116
echo script as: \"$0 go\" or as \"$0 snap\"
117
echo to make a daily snapshot
121
if [ "$1" = "work" ] ; then
122
tar xjf deadwood-$CURRENT.tar.bz2
123
echo OK, both deadwood-$CURRENT and deadwood-$NEXT made\; you
124
echo now can make more patches as needed.
125
cd deadwood-$NEXT/src
126
echo '#define VERSION "'$NEXT'-pre"' > version.h
132
echo making new tarballs
134
if [ "$1" = "snap" ] ; then
135
SNAP=H-$( date +%Y%m%d )-$REVISION
136
rm -fr deadwood-$SNAP
137
mv deadwood-$NEXT deadwood-$SNAP
138
cd deadwood-$SNAP/src
139
./make.version.h > version.h
141
tar cjf deadwood-$SNAP.tar.bz2 deadwood-$SNAP
145
cd deadwood-$SNAP/src
146
./make.version.h > version.h
148
tar cjf deadwood-$SNAP.tar.bz2 deadwood-$SNAP