2005-11-17 20:05:16 +01:00
|
|
|
#/bin/sh
|
|
|
|
|
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-11-24 21:21:25 +01:00
|
|
|
4.0.*-*)
|
|
|
|
DEST="/srv/ftp/pub/shorewall/${1%.*}/shorewall-${1%-*}"
|
|
|
|
SHOREWALL=shorewall-common
|
|
|
|
;;
|
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-07-11 20:01:36 +02:00
|
|
|
rpm=shorewall-common-${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
|
2007-12-08 22:04:21 +01:00
|
|
|
BASE=Yes
|
2007-07-11 20:01:36 +02:00
|
|
|
;;
|
2007-12-07 07:14:14 +01:00
|
|
|
4.1.*-*)
|
2007-12-07 07:16:17 +01:00
|
|
|
DEST="/srv/ftp/pub/shorewall/development/${1%.*}/shorewall-${1%-*}"
|
2007-12-07 07:14:14 +01:00
|
|
|
SHOREWALL=shorewall-common
|
|
|
|
;;
|
2007-11-19 22:17:41 +01:00
|
|
|
4.1.*)
|
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
|
|
|
|
rpm=shorewall-common-${1}-1.noarch.rpm
|
2006-10-19 23:14:48 +02:00
|
|
|
literpm=shorewall-lite-${1}-1.noarch.rpm
|
2007-04-07 21:20:14 +02:00
|
|
|
perlrpm=shorewall-perl-${1}-1.noarch.rpm
|
|
|
|
shellrpm=shorewall-shell-${1}-1.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-11-24 21:21:25 +01:00
|
|
|
[ -n "$UPLOADPERL" ] && files="$files shorewall-perl-${1}.* $perlrpm"
|
|
|
|
[ -n "$UPLOADCOMMON" ] && files="$files shorewall-common-${1}.* $rpm"
|
|
|
|
[ -n "$UPLOADSHELL" ] && files="$files shorewall-shell-${1}.* $shellrpm"
|
|
|
|
[ -n "$UPLOADLITE" ] && files="$files shorewall-lite-${1}.* $literpm"
|
|
|
|
[ -n "$UPLOADXML" ] && files="$files shorewall-docs-xml-${1}.* $literpm"
|
|
|
|
[ -n "$UPLOADHTML" ] && files="$files shorewall-docs-html-${1}.* $literpm"
|
|
|
|
|
2007-12-08 22:04:21 +01:00
|
|
|
[ -n "$BASE" ] && $COMMAND $files $DEST/base
|
|
|
|
|
2007-12-08 22:05:58 +01:00
|
|
|
files="errata known_problems.txt releasenotes.txt patch-$1 ${1}.* $files"
|
2007-12-08 22:04:21 +01:00
|
|
|
|
2007-11-24 21:21:25 +01:00
|
|
|
$COMMAND -r $files $DEST
|