2007-12-12 17:04:52 +01:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Upload a release to the master server
|
|
|
|
#
|
|
|
|
# (C) 2007 -- Tom Eastep (teastep@shorewall.net)
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of Version 2 of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
#
|
|
|
|
# Usage:
|
|
|
|
#
|
|
|
|
# upload [-pclsxh] <version>
|
|
|
|
#
|
2005-11-17 20:05:16 +01:00
|
|
|
|
2007-11-24 21:21:25 +01:00
|
|
|
usage() {
|
|
|
|
echo "Usage: upload [-pclsxh] <version>"
|
2007-11-24 21:41:01 +01:00
|
|
|
}
|
2007-11-24 21:21:25 +01:00
|
|
|
|
2006-03-11 17:21:15 +01:00
|
|
|
rpm=
|
2006-06-03 19:16:27 +02:00
|
|
|
literpm=
|
2007-04-07 21:20:14 +02:00
|
|
|
perlrpm=
|
|
|
|
shellrpm=
|
2006-03-11 17:21:15 +01:00
|
|
|
|
2007-07-14 16:52:31 +02:00
|
|
|
DEST=
|
2007-07-14 17:00:58 +02:00
|
|
|
USER="webadmin@mail.shorewall.net"
|
2007-07-14 16:52:31 +02:00
|
|
|
SHOREWALL=shorewall
|
|
|
|
COMMAND=scp
|
|
|
|
|
2007-11-24 21:21:25 +01:00
|
|
|
UPLOADCOMMON=
|
|
|
|
UPLOADPERL=
|
|
|
|
UPLOADSHELL=
|
|
|
|
UPLOADLITE=
|
|
|
|
UPLOADXML=
|
|
|
|
UPLOADHTML=
|
2007-11-29 22:41:17 +01:00
|
|
|
PARTIAL=Yes
|
2007-12-08 22:04:21 +01:00
|
|
|
BASE=
|
2007-11-24 21:21:25 +01:00
|
|
|
|
|
|
|
done=
|
|
|
|
|
|
|
|
case $1 in
|
|
|
|
-*)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
UPLOADCOMMON=Yes
|
|
|
|
UPLOADPERL=Yes
|
|
|
|
UPLOADSHELL=Yes
|
|
|
|
UPLOADLITE=Yes
|
|
|
|
UPLOADXML=Yes
|
|
|
|
UPLOADHTML=Yes
|
2007-11-29 22:41:17 +01:00
|
|
|
PARTIAL=
|
2007-11-24 21:21:25 +01:00
|
|
|
done=Yes
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
while [ -z "$done" ]; do
|
|
|
|
[ $# -eq 0 ] && break
|
|
|
|
|
|
|
|
option=$1
|
|
|
|
case $option in
|
|
|
|
-*)
|
|
|
|
option=${option#-}
|
|
|
|
|
|
|
|
[ -z "$option" ] && break
|
|
|
|
|
|
|
|
while [ -n "$option" ]; do
|
|
|
|
case $option in
|
|
|
|
p*)
|
|
|
|
UPLOADPERL=Yes
|
|
|
|
option=${option#p}
|
|
|
|
;;
|
|
|
|
c*)
|
|
|
|
UPLOADCOMMON=Yes
|
|
|
|
option=${option#c}
|
|
|
|
;;
|
|
|
|
s*)
|
|
|
|
UPLOADSHELL=Yes
|
|
|
|
option=${option#s}
|
|
|
|
;;
|
|
|
|
l*)
|
|
|
|
UPLOADLITE=Yes
|
|
|
|
option=${option#l}
|
|
|
|
;;
|
|
|
|
x*)
|
|
|
|
UPLOADXML=Yes
|
|
|
|
option=${option#x}
|
|
|
|
;;
|
|
|
|
h*)
|
|
|
|
UPLOADHTML=Yes
|
|
|
|
option=${option#h}
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
usage
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
done=Yes
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
|
2006-02-24 20:53:09 +01:00
|
|
|
case $1 in
|
2007-05-16 01:01:25 +02:00
|
|
|
4.*Beta*|4.*RC*)
|
2007-07-14 16:52:31 +02:00
|
|
|
DEST="/srv/ftp/pub/shorewall/development/${1%.*}/shorewall-$1"
|
|
|
|
SHOREWALL=shorewall-common
|
2007-06-29 18:01:10 +02:00
|
|
|
rpm=shorewall-common-${1%-*}-0${1#*-}.noarch.rpm
|
2007-05-16 01:01:25 +02:00
|
|
|
literpm=shorewall-lite-${1%-*}-0${1#*-}.noarch.rpm
|
|
|
|
perlrpm=shorewall-perl-${1%-*}-0${1#*-}.noarch.rpm
|
|
|
|
shellrpm=shorewall-shell-${1%-*}-0${1#*-}.noarch.rpm
|
2007-12-08 22:04:21 +01:00
|
|
|
BASE=Yes
|
2007-05-16 01:01:25 +02:00
|
|
|
;;
|
2007-12-10 22:18:54 +01:00
|
|
|
4.0.*.*)
|
|
|
|
BASEVERSION=${1%.*}
|
|
|
|
PATCHNUM=${1##*.}
|
|
|
|
DEST="/srv/ftp/pub/shorewall/${BASEVERSION%.*}/shorewall-${BASEVERSION}"
|
2007-11-24 21:21:25 +01:00
|
|
|
SHOREWALL=shorewall-common
|
2007-12-10 22:18:54 +01:00
|
|
|
rpm=shorewall-common-${BASEVERSION}-${PATCHNUM}.noarch.rpm
|
|
|
|
literpm=shorewall-lite-${BASEVERSION}-${PATCHNUM}.noarch.rpm
|
|
|
|
perlrpm=shorewall-perl-${BASEVERSION}-${PATCHNUM}.noarch.rpm
|
|
|
|
shellrpm=shorewall-shell-${BASEVERSION}-${PATCHNUM}.noarch.rpm
|
2007-11-24 21:21:25 +01:00
|
|
|
;;
|
2007-07-11 20:01:36 +02:00
|
|
|
4.0.*)
|
2007-07-20 19:50:44 +02:00
|
|
|
DEST="/srv/ftp/pub/shorewall/${1%.*}/shorewall-$1"
|
2007-07-14 16:52:31 +02:00
|
|
|
SHOREWALL=shorewall-common
|
2007-12-12 20:39:40 +01:00
|
|
|
rpm=shorewall-common-${1}-0base.noarch.rpm
|
|
|
|
literpm=shorewall-lite-${1}-0base.noarch.rpm
|
|
|
|
perlrpm=shorewall-perl-${1}-0base.noarch.rpm
|
|
|
|
shellrpm=shorewall-shell-${1}-0base.noarch.rpm
|
2007-12-08 22:04:21 +01:00
|
|
|
BASE=Yes
|
2007-07-11 20:01:36 +02:00
|
|
|
;;
|
2007-12-12 20:39:40 +01:00
|
|
|
4.[12].*.*)
|
2007-12-10 22:18:54 +01:00
|
|
|
BASEVERSION=${1%.*}
|
|
|
|
PATCHNUM=${1##*.}
|
|
|
|
DEST="/srv/ftp/pub/shorewall/development/${BASEVERSION%.*}/shorewall-${BASEVERSION}"
|
2007-12-07 07:14:14 +01:00
|
|
|
SHOREWALL=shorewall-common
|
2007-12-10 22:18:54 +01:00
|
|
|
rpm=shorewall-common-${BASEVERSION}-${PATCHNUM}.noarch.rpm
|
|
|
|
literpm=shorewall-lite-${BASEVERSION}-${PATCHNUM}.noarch.rpm
|
|
|
|
perlrpm=shorewall-perl-${BASEVERSION}-${PATCHNUM}.noarch.rpm
|
|
|
|
shellrpm=shorewall-shell-${BASEVERSION}-${PATCHNUM}.noarch.rpm
|
2007-12-07 07:14:14 +01:00
|
|
|
;;
|
2007-12-12 20:39:40 +01:00
|
|
|
4.[12].*)
|
2007-07-14 16:52:31 +02:00
|
|
|
DEST="/srv/ftp/pub/shorewall/development/${1%.*}/shorewall-$1"
|
2007-11-19 22:29:07 +01:00
|
|
|
SHOREWALL=shorewall-common
|
2007-12-12 20:39:40 +01:00
|
|
|
rpm=shorewall-common-${1}-0base.noarch.rpm
|
|
|
|
literpm=shorewall-lite-${1}-0base.noarch.rpm
|
|
|
|
perlrpm=shorewall-perl-${1}-0base.noarch.rpm
|
|
|
|
shellrpm=shorewall-shell-${1}-0base.noarch.rpm
|
2007-12-08 22:04:21 +01:00
|
|
|
BASE=Yes
|
2006-10-19 23:14:48 +02:00
|
|
|
;;
|
2007-04-07 21:20:14 +02:00
|
|
|
3.*[13579].*)
|
2007-07-14 16:52:31 +02:00
|
|
|
DEST="/srv/ftp/pub/shorewall/development/${1%.*}/shorewall-$1"
|
2006-06-22 05:34:29 +02:00
|
|
|
rpm=shorewall-${1}-1.noarch.rpm
|
2007-04-07 21:20:14 +02:00
|
|
|
literpm=shorewall-lite-${1}-1.noarch.rpm
|
2006-02-24 20:53:09 +01:00
|
|
|
;;
|
2007-04-07 21:20:14 +02:00
|
|
|
*.*[13579].*)
|
2007-07-14 16:52:31 +02:00
|
|
|
DEST="/srv/ftp/pub/shorewall/development/${1%.*}/shorewall-$1"
|
2007-04-07 21:20:14 +02:00
|
|
|
rpm=shorewall-${1}-1.noarch.rpm
|
|
|
|
;;
|
|
|
|
3.*Beta*|*RC*)
|
2007-07-14 16:52:31 +02:00
|
|
|
DEST="/srv/ftp/pub/shorewall/development/${1%.*}/shorewall-$1"
|
2007-04-07 21:20:14 +02:00
|
|
|
rpm=shorewall-${1%-*}-0${1#*-}.noarch.rpm
|
|
|
|
literpm=shorewall-lite-${1%-*}-0${1#*-}.noarch.rpm
|
2007-04-17 16:53:32 +02:00
|
|
|
;;
|
2007-04-07 21:20:14 +02:00
|
|
|
*.*Beta*|*RC*)
|
2007-07-14 16:52:31 +02:00
|
|
|
DEST="/srv/ftp/pub/shorewall/development/${1%.*}/shorewall-$1"
|
2006-03-11 17:30:11 +01:00
|
|
|
rpm=shorewall-${1%-*}-0${1#*-}.noarch.rpm
|
2006-06-03 19:16:27 +02:00
|
|
|
literpm=shorewall-lite-${1%-*}-0${1#*-}.noarch.rpm
|
2007-04-07 21:20:14 +02:00
|
|
|
perlrpm=shorewall-perl-${1%-*}-0${1#*-}.noarch.rpm
|
|
|
|
shellrpm=shorewall-shell-${1%-*}-0${1#*-}.noarch.rpm
|
2006-03-11 04:50:41 +01:00
|
|
|
;;
|
2006-07-11 18:00:34 +02:00
|
|
|
3.[2468].*)
|
2007-07-14 16:52:31 +02:00
|
|
|
DEST="/srv/ftp/pub/shorewall/${1%.*}/shorewall-$1"
|
2006-07-11 17:52:08 +02:00
|
|
|
rpm=shorewall-${1}-1.noarch.rpm
|
|
|
|
literpm=shorewall-lite-${1}-1.noarch.rpm
|
2007-04-17 16:53:32 +02:00
|
|
|
;;
|
2007-04-07 21:20:14 +02:00
|
|
|
*.[2468].*)
|
2007-07-14 16:52:31 +02:00
|
|
|
DEST="/srv/ftp/pub/shorewall/${1%.*}/shorewall-$1"
|
2007-04-07 21:20:14 +02:00
|
|
|
rpm=shorewall-${1}-1.noarch.rpm
|
|
|
|
literpm=shorewall-lite-${1}-1.noarch.rpm
|
|
|
|
perlrpm=shorewall-perl-${1}-1.noarch.rpm
|
|
|
|
shellrpm=shorewall-shell-${1}-1.noarch.rpm
|
2006-07-11 17:52:08 +02:00
|
|
|
;;
|
2006-02-24 20:53:09 +01:00
|
|
|
*)
|
2007-07-14 16:52:31 +02:00
|
|
|
DEST="/srv/ftp/pub/shorewall/${1%.*}/shorewall-$1"
|
2006-06-22 05:34:29 +02:00
|
|
|
rpm=shorewall-${1}-1.noarch.rpm
|
2006-02-24 20:53:09 +01:00
|
|
|
;;
|
|
|
|
esac
|
2005-11-17 20:05:16 +01:00
|
|
|
|
2006-03-11 17:30:11 +01:00
|
|
|
[ $# -eq 1 ] || { echo "Usage: $(basename $0) <version>"; exit 2; }
|
2005-11-17 20:05:16 +01:00
|
|
|
|
|
|
|
[ -d errata ] || mkdir errata
|
2006-03-11 17:30:11 +01:00
|
|
|
|
2007-11-24 21:21:25 +01:00
|
|
|
[ -f known_problems.txt ] || echo "There are no known problems in Shorewall version $1" > known_problems.txt
|
2005-11-17 20:05:16 +01:00
|
|
|
|
2007-11-29 22:41:17 +01:00
|
|
|
[ -n "$PARTIAL" ] && SHOREWALLDIR=shorewall-common || SHOREWALLDIR=$SHOREWALL-${1}
|
|
|
|
|
2007-07-16 22:19:30 +02:00
|
|
|
if [ -f shorewall-lite-${1}/releasenotes.txt ]; then
|
2007-11-29 22:41:17 +01:00
|
|
|
cat $SHOREWALLDIR/releasenotes.txt shorewall-lite-${1}/releasenotes.txt > releasenotes.txt
|
2007-07-16 22:19:30 +02:00
|
|
|
else
|
2007-11-29 22:41:17 +01:00
|
|
|
cat $SHOREWALLDIR/releasenotes.txt > releasenotes.txt
|
2007-07-16 22:19:30 +02:00
|
|
|
fi
|
|
|
|
|
2007-07-14 16:52:31 +02:00
|
|
|
if [ "$HOSTNAME" = lists ]; then
|
|
|
|
mkdir -p $DEST
|
2007-12-08 22:04:21 +01:00
|
|
|
[ -n "$BASE" ] && mkdir $DEST/base
|
2007-07-14 16:52:31 +02:00
|
|
|
COMMAND=cp
|
2006-06-19 17:00:29 +02:00
|
|
|
else
|
2007-07-14 16:52:31 +02:00
|
|
|
ssh $USER mkdir -p $DEST
|
2007-12-08 23:00:06 +01:00
|
|
|
[ -n "$BASE" ] && ssh $USER mkdir -p $DEST/base
|
2007-07-14 17:02:44 +02:00
|
|
|
DEST=${USER}:${DEST}
|
2006-06-19 17:00:29 +02:00
|
|
|
fi
|
|
|
|
|
2007-12-11 01:03:02 +01:00
|
|
|
files="errata known_problems.txt releasenotes.txt patch-*-$1 ${1}.*"
|
2007-12-08 23:31:06 +01:00
|
|
|
base=
|
2007-11-24 21:21:25 +01:00
|
|
|
|
2007-12-10 06:00:57 +01:00
|
|
|
[ -n "$UPLOADPERL" ] && base="shorewall-perl-${1}.tar.*" && files="$files shorewall-perl-${1}.* $perlrpm"
|
2007-12-09 01:12:19 +01:00
|
|
|
[ -n "$UPLOADCOMMON" ] && base="$base shorewall-common-${1}.tar.*" && files="$files shorewall-common-${1}.* $rpm"
|
|
|
|
[ -n "$UPLOADSHELL" ] && base="$base shorewall-shell-${1}.tar.*" && files="$files shorewall-shell-${1}.* $shellrpm"
|
|
|
|
[ -n "$UPLOADLITE" ] && base="$base shorewall-lite-${1}.tar.*" && files="$files shorewall-lite-${1}.* $literpm"
|
|
|
|
[ -n "$UPLOADXML" ] && base="$base shorewall-docs-xml-${1}.tar.*" && files="$files shorewall-docs-xml-${1}.* $literpm"
|
2007-12-08 23:31:06 +01:00
|
|
|
[ -n "$UPLOADHTML" ] && base="$base shorewall-docs-html-${1}.tar.*" && files="$files shorewall-docs-html-${1}.* $literpm"
|
2007-12-08 22:04:21 +01:00
|
|
|
|
2007-12-08 23:31:06 +01:00
|
|
|
[ -n "$BASE" ] && $COMMAND $base $DEST/base
|
2007-12-08 22:04:21 +01:00
|
|
|
|
2007-11-24 21:21:25 +01:00
|
|
|
$COMMAND -r $files $DEST
|