release 4.83 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
revision=""
David Byers's avatar
David Byers committed
137
138
139
140
141
142
if [ -z `echo $version | sed "s/.*BETA.*//"` ] ; then
    $ans=nej
else
    $ans=ja
fi
ask "Vill du gra en numerisk revision fr alla filer" $ans
143
if [ "$yes" ] ; then
144
    xecho "Revision: \c"
145
146
147
    read revision
fi
        
David Byers's avatar
David Byers committed
148
149
tag=`echo v$version | tr "." "-"`

150

David Byers's avatar
David Byers committed
151
if [ "$revision" ] ; then
152
153
154
155
156
    echo "cvs revision blir $revision"
else
    echo "cvs revision blir ofrndrad"
fi

David Byers's avatar
David Byers committed
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
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
178
    echo "Incheckning klar"
David Byers's avatar
David Byers committed
179
else
David Byers's avatar
David Byers committed
180
    ask "Fortstt trots att incheckningen inte gick bra" nej
David Byers's avatar
David Byers committed
181
182
183
184
185
    if [ "$no" ] ; then
        exit 1
    fi
fi

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

198
xecho "Revisionens symboliska tag: [$tag] "
David Byers's avatar
David Byers committed
199
read ans
David Byers's avatar
David Byers committed
200
201
202
203
204
205
case $ans in
    "") ;;
    *) tag="$ans" ;;
esac

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

echo "Bygger release i src/"
216
217
218
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
219
220
    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
221
222
223
224
225
226
227
228
229
230
231
232
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