forked from extern/shorewall_code
Add a 4.4 stage script that stages to a private part of the FTP site
This commit is contained in:
parent
374aceb06c
commit
c34e09cd67
201
tools/build/stage44
Executable file
201
tools/build/stage44
Executable file
@ -0,0 +1,201 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Stage 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:
|
||||
#
|
||||
# stage [-pclL6sxh] <version>
|
||||
#
|
||||
|
||||
usage() {
|
||||
echo "Usage: stage [-pclL6sxh] <version>"
|
||||
}
|
||||
|
||||
rpm=
|
||||
rpm6=
|
||||
literpm=
|
||||
lite6rpm=
|
||||
perlrpm=
|
||||
shellrpm=
|
||||
|
||||
DEST=
|
||||
USER="webadmin@mail.shorewall.net"
|
||||
SHOREWALL=shorewall
|
||||
COMMAND=scp
|
||||
|
||||
STAGECOMMON=
|
||||
STAGELITE=
|
||||
STAGEXML=
|
||||
STAGEHTML=
|
||||
STAGE6=
|
||||
STAGE6LITE=
|
||||
PARTIAL=Yes
|
||||
BASE=
|
||||
|
||||
done=
|
||||
|
||||
case $1 in
|
||||
-*)
|
||||
;;
|
||||
*)
|
||||
STAGECOMMON=Yes
|
||||
STAGEPERL=Yes
|
||||
STAGESHELL=Yes
|
||||
STAGELITE=Yes
|
||||
STAGEXML=Yes
|
||||
STAGEHTML=Yes
|
||||
STAGE6=Yes
|
||||
STAGE6LITE=Yes
|
||||
PARTIAL=
|
||||
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
|
||||
c*)
|
||||
STAGECOMMON=Yes
|
||||
option=${option#c}
|
||||
;;
|
||||
l*)
|
||||
STAGELITE=Yes
|
||||
option=${option#l}
|
||||
;;
|
||||
x*)
|
||||
STAGEXML=Yes
|
||||
option=${option#x}
|
||||
;;
|
||||
h*)
|
||||
STAGEHTML=Yes
|
||||
option=${option#h}
|
||||
;;
|
||||
6*)
|
||||
STAGE6=Yes
|
||||
option=${option#6}
|
||||
;;
|
||||
L*)
|
||||
STAGE6LITE=Yes
|
||||
option=${option#L}
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
done=Yes
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
case $1 in
|
||||
4.*Beta*|4.*RC*)
|
||||
DEST="/srv/ftp/pub/private/development/${1%.*}/shorewall-$1"
|
||||
SHOREWALL=shorewall
|
||||
rpm=shorewall-${1%-*}-0${1#*-}.noarch.rpm
|
||||
rpm6=shorewall6-${1%-*}-0${1#*-}.noarch.rpm
|
||||
literpm=shorewall-lite-${1%-*}-0${1#*-}.noarch.rpm
|
||||
lite6rpm=shorewall6-lite-${1%-*}-0${1#*-}.noarch.rpm
|
||||
BASE=Yes
|
||||
;;
|
||||
4.4.*)
|
||||
DEST="/srv/ftp/pub/private/${1%.*}/shorewall-$1"
|
||||
SHOREWALL=shorewall
|
||||
rpm=shorewall-${1}-0base.noarch.rpm
|
||||
literpm=shorewall-lite-${1}-0base.noarch.rpm
|
||||
rpm6=shorewall6-${1}-0base.noarch.rpm
|
||||
lite6rpm=shorewall6-lite-${1}-0base.noarch.rpm
|
||||
BASE=Yes
|
||||
;;
|
||||
*)
|
||||
echo "Unknown Version $1" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
[ $# -eq 1 ] || { echo "Usage: $(basename $0) <version>"; exit 2; }
|
||||
|
||||
if [ -z "$PATCHNUM" -a -d shorewall-common ]; then
|
||||
echo " ERROR: Paranoid to stage a base release when a patch release has been built in the current directory" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
[ -d errata ] || mkdir errata
|
||||
|
||||
[ -f known_problems.txt ] || echo "There are no known problems in Shorewall version $1" > known_problems.txt
|
||||
|
||||
[ -n "$PARTIAL" -a -z "$STAGECOMMON" ] && SHOREWALLDIR=shorewall || SHOREWALLDIR=$SHOREWALL-${1}
|
||||
|
||||
cp $SHOREWALLDIR/releasenotes.txt releasenotes.txt
|
||||
|
||||
if [ "$HOSTNAME" = lists ]; then
|
||||
mkdir -p $DEST
|
||||
[ -n "$BASE" ] && mkdir $DEST/base
|
||||
COMMAND=cp
|
||||
else
|
||||
ssh $USER mkdir -p $DEST
|
||||
[ -n "$BASE" ] && ssh $USER mkdir -p $DEST/base
|
||||
DEST=${USER}:${DEST}
|
||||
fi
|
||||
|
||||
files="errata known_problems.txt releasenotes.txt patch-*-$1 ${1}.*"
|
||||
base=
|
||||
|
||||
rm -f *-${1}*.asc
|
||||
|
||||
for f in *-${1}.tar.bz2 *-${1}.tgz; do
|
||||
/usr/bin/gpg -ab --batch --comment 'To verify this, you can download our public key at https://lists.shorewall.net/shorewall.gpg.key' $f
|
||||
done
|
||||
|
||||
[ -n "$STAGE6" ] && base="shorewall6-${1}.tar.*" && files="$files shorewall6-${1}.* $rpm6"
|
||||
[ -n "$STAGECOMMON" ] && base="$base shorewall-${1}.tar.*" && files="$files shorewall-${1}.* $rpm"
|
||||
[ -n "$STAGELITE" ] && base="$base shorewall-lite-${1}.tar.*" && files="$files shorewall-lite-${1}.* $literpm"
|
||||
[ -n "$STAGE6LITE" ] && base="$base shorewall6-lite-${1}.tar.*" && files="$files shorewall6-lite-${1}.* $lite6rpm"
|
||||
[ -n "$STAGEXML" ] && base="$base shorewall-docs-xml-${1}.tar.*" && files="$files shorewall-docs-xml-${1}.*"
|
||||
[ -n "$STAGEHTML" ] && base="$base shorewall-docs-html-${1}.tar.*" && files="$files shorewall-docs-html-${1}.*"
|
||||
|
||||
rpms=$(
|
||||
for f in $files; do
|
||||
case $f in
|
||||
*.rpm)
|
||||
echo $f
|
||||
;;
|
||||
esac
|
||||
done)
|
||||
|
||||
[ -n "$rpms" ] && echo "RPMS=\"$rpms\"" && rpm --resign $rpms
|
||||
|
||||
[ -n "$BASE" ] && $COMMAND $base $DEST/base
|
||||
|
||||
$COMMAND -r $files $DEST
|
Loading…
Reference in New Issue
Block a user