release 4.74 KB
Newer Older
David Byers's avatar
David Byers committed
1
2
#!/bin/sh

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
E1=`echo -e "FOO\c"`
E2=`echo -n "FOO"`
E3=`echo "FOO\c"`

if [ $E3 = "FOO" ] ; then
    epre=""
    epost="\c"
elif [ $E2 = "FOO" ] ; then
    epre="-n"
    epost=""
elif   [ $E1 = "FOO" ] ; then
    epre="-e"
    epost="\c"
else
    epre=""
    epost=">>>"
fi

xecho ()
{
    echo $epre "$*$epost"
}

David Byers's avatar
David Byers committed
26
27
28
29
30
31
32
33
34
35
36
37
ask ()
{
    if [ "$2" = "yes" -o "$2" = "ja" ] ; then
        yes="X"
        no=""
    else
        yes=""
        no="X"
    fi
    
    ask1=""
    while [ ! "$ask1" ] ; do
38
        xecho $1 "(y/n)? [$2] "
David Byers's avatar
David Byers committed
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
        read ans
        case "$ans" in
            [yYjJ]*) yes="X"; no=""; ask1="X" ;;
            [nN]*)   yes=""; no="X"; ask1="X" ;;
            "")      ask1="X";;
            *)       echo "Please enter yes, no or return" ;;
        esac
    done
}

askedit ()
{
    ask "Vill du editera $1" ja
    if [ "$yes" ] ; then
        emacs -nw -q $1
    fi
}


58
xecho "Versionsnummer: "
David Byers's avatar
David Byers committed
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
read version
echo "Frbereder release av elispklient version $version"

q1=""
while [ ! "$q1" ] ; do
    ask "r doc/NEWS-$version uppdaterad" nej
    if [ "$no" ] ; then
        askedit doc/NEWS-$version
    else
        q1="X"
    fi
done


q2=""
while [ ! "$q2" ] ; do
    v1=`grep "^CLIENTVERSION" doc/Makefile | \
             sed "s/.*CLIENTVERSION.*=[ \t]*\(.*\)$/\1/"`
    if [ "$v1" = "$version" ] ; then
        echo "Versionsnummer i doc/Makefile r OK ($v1)."
        q2="X"
    else
        echo "Versionsnumret i doc/Makefile r $v1 (borde vara $version)"
        askedit doc/Makefile
    fi
done

q2=""
while [ ! "$q2" ] ; do
    v2=`grep "^CLIENTVERSION" src/Makefile | \
             sed "s/.*CLIENTVERSION.*=[ \t]*\(.*\)$/\1/"`
    if [ "$v2" = "$version" ] ; then
        echo "Versionsnummer i src/Makefile r OK ($v2)."
        q2="X"
    else
        echo "Versionsnumret i src/Makefile r $v2 (borde vara $version)"
        askedit src/Makefile
    fi
done


echo "Kontrollerar strngar  snt..."
if ( cd src; set -x; make check ) ; then
    ask "Gick det bra" ja
else
    ask "Gick det bra" nej
fi
if [ "$no" ] ; then
    echo "D avbryter vi releasen"
    exit 1
fi


echo "Vi frsker kompilera..."
if ( cd src; set -x; make ) ; then
    ask "Gick kompileringen bra" ja
else
    ask "Gick kompileringen bra" nej
fi
if [ "$no" ] ; then
    echo "D avbryter vi releasen"
    exit 1
fi

q1=""
while [ ! "$q1" ] ; do
    ask "Har du skrivit ett ChangeLog-entry fr releasen" nej
    if [ "$no" ] ; then
127
128
129
130
      ask "Vill du editera $1" ja
      if [ "$yes" ] ; then
        (cd src; emacs -nw -q -f add-change-log-entry)
      fi
David Byers's avatar
David Byers committed
131
132
133
134
135
    else
        q1="X"
    fi
done

136
137
138
revision=""
ask "Vill du gra en numerisk revision fr alla filer" ja
if [ "$yes" ] ; then
139
    xecho "Revision: \c"
140
141
142
    read revision
fi
        
David Byers's avatar
David Byers committed
143
144
tag=`echo v$version | tr "." "-"`

145

David Byers's avatar
David Byers committed
146
if [ "$revision" ] ; then
147
148
149
150
151
    echo "cvs revision blir $revision"
else
    echo "cvs revision blir ofrndrad"
fi

David Byers's avatar
David Byers committed
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
cat <<EOF
cvs symboliska tag blir $tag

Du str i begrepp att brja checka in, ndra revisioner och tagga 
filer. Nr det vl har kommit igng finns det ingen tervndo. Nr
du gr en release kommer det att bli massor av jobb och gnll och
tjafs, fr att inte tala om buggrapporter som har med allt annat n 
LysKOM att gra (till exempel att externa program inte fungerar som
de ska i Windows NT, eller att Netscape fr fel bakgrundsfrg.)

EOF

ask "Vill du trots det fortfarande gra en release" nej
if [ "$no" ] ; then
    echo "Det var nog lika bra att lta bli..."
    exit 1
fi


echo "Checkar in fr skerhets skull..."
if ( set -x; cvs commit -m "Synkning infr release av $version" ) ; then
173
    echo "Incheckning klar"
David Byers's avatar
David Byers committed
174
else
David Byers's avatar
David Byers committed
175
    ask "Fortstt trots att incheckningen inte gick bra" nej
David Byers's avatar
David Byers committed
176
177
178
179
180
    if [ "$no" ] ; then
        exit 1
    fi
fi

181
182
183
if [ "$revision" ] ; then
    echo "Uppdaterar revisionsnumret..."
    if ( set -x; cvs commit -r $version ) ; then
184
        echo "Revisionsnumret r uppdaterat"
185
    else
David Byers's avatar
David Byers committed
186
        ask "Fortstt trots att revisionsndringen inte gick bra" nej
187
188
189
        if [ "$no" ] ; then
            exit 1
        fi
David Byers's avatar
David Byers committed
190
191
192
    fi
fi

193
xecho "Revisionens symboliska tag: [$tag] "
David Byers's avatar
David Byers committed
194
read ans
David Byers's avatar
David Byers committed
195
196
197
198
199
200
201
case $ans in
    "") ;;
    *) tag="$ans" ;;
esac

echo "Stter symbolisk tag..."
if ( set -x ; cvs tag "$tag" ) ; then
David Byers's avatar
David Byers committed
202
    echo "Releasen r symboliskt taggad"
David Byers's avatar
David Byers committed
203
else
David Byers's avatar
David Byers committed
204
    ask "Forststt trots att taggningen inte gick bra" nej
David Byers's avatar
David Byers committed
205
206
207
208
209
210
    if [ "$no" ] ; then
        exit 1
    fi
fi

echo "Bygger release i src/"
211
212
213
if ( cd src; set -x; make release ) ; then
    echo "Det verkar som om det gick att gra release. Beklagar."
else
David Byers's avatar
David Byers committed
214
215
    echo "Det gick kanske inte att gra release. Ngonting kan vara galet."
    echo "Eventuellt mste du gra det manuellt istllet."
David Byers's avatar
David Byers committed
216
217
218
219
220
221
222
223
224
225
226
227
fi

cat <<EOF

Fljande saker mste fortfarande gras:

* Installera klienten p Lysator
* Kopiera releasen till ftp.lysator.liu.se (om inte make release gr det.)
* Annonsera i LysKOM
EOF

exit 0