1 |
#!/bin/bash |
2 |
# Copyright (C) 1999 Bob Tanner |
3 |
# |
4 |
# This program is free software; you can redistribute it and/or modify |
5 |
# it under the terms of the GNU General Public License as published by |
6 |
# the Free Software Foundation; either version 2 of the License, or |
7 |
# (at your option) any later version. |
8 |
# |
9 |
# This program is distributed in the hope that it will be useful, |
10 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 |
# GNU General Public License for more details. |
13 |
# |
14 |
# You should have received a copy of the GNU General Public License |
15 |
# along with this program; if not, write to the Free Software |
16 |
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
17 |
# |
18 |
|
19 |
version="0.96.0" |
20 |
server="true" |
21 |
maps="true" |
22 |
arch="true" |
23 |
|
24 |
export CVS_RSH="@SSH@" |
25 |
|
26 |
usage() { |
27 |
echo "" |
28 |
echo "Usage get_release -v version [-s] [-m] [-a] [-h]" |
29 |
echo " -v version of release" |
30 |
echo " -s turn OFF getting server source code" |
31 |
echo " -m turn OFF getting maps" |
32 |
echo " -a turn OFF getting arch files" |
33 |
echo " -h help" |
34 |
echo "" |
35 |
echo "By default script will get all files." |
36 |
exit 1 |
37 |
} |
38 |
|
39 |
while getopts v:hsma option |
40 |
do |
41 |
case "$option" |
42 |
in |
43 |
v) version=$OPTARG;; |
44 |
s) server="false";; |
45 |
m) maps="false";; |
46 |
a) arch="false";; |
47 |
h) usage;; |
48 |
esac |
49 |
done |
50 |
|
51 |
# Get source code |
52 |
if [ "$server" == "true" ]; then |
53 |
@CVS@ -z3 export -d crossfire-$version -D now crossfire |
54 |
if [ $? -ne 0 ]; then |
55 |
echo "Could not get crossfire source code." |
56 |
fi |
57 |
(@TAR@ -cf crossfire-$version.tar crossfire-$version; @GZIP@ -9 crossfire-$version.tar) & |
58 |
fi |
59 |
|
60 |
if [ "$maps" == "true" ]; then |
61 |
@CVS@ -z3 export -d crossfire-$version.maps -D now maps |
62 |
if [ $? -ne 0 ]; then |
63 |
echo "Could not get crossfire maps." |
64 |
fi |
65 |
(@TAR@ -cf crossfire-$version.maps.tar crossfire-$version.maps; @GZIP@ -9 crossfire-$version.maps.tar) & |
66 |
fi |
67 |
|
68 |
|
69 |
|
70 |
if [ "$arch" == "true" ]; then |
71 |
@CVS@ -z3 export -d crossfire-$version.arch -D now arch |
72 |
if [ $? -ne 0 ]; then |
73 |
echo "Could not get crossfire arch." |
74 |
fi |
75 |
(@TAR@ -cf crossfire-$version.arch.tar crossfire-$version.arch; @GZIP@ -9 crossfire-$version.arch.tar) & |
76 |
fi |