mc/maint/mcsnap

72 lines
1.9 KiB
Plaintext
Raw Normal View History

2002-09-07 05:00:52 +04:00
#! /bin/sh
# This script takes the compiled tarball, makes an RPM package and
# a patch against the latest released version, then uploads
# everything over ssh and removes old snapshots.
# Run this script in the directory where mc was built.
# TODO:
# build tarball, select level of testing
# (dist, distcheck, warning checks)
2002-10-02 03:00:43 +04:00
# $1 - file to upload, $2 - shell mask to erase
function upload() {
echo "Uploading $1 to $SITE"
name="`basename $1`"
scp "$1" "$SITE:$DIR/.in.$name"
ssh $SITE "rm -f $DIR/$2; mv $DIR/.in.$name $DIR/$name"
}
2002-09-07 05:00:52 +04:00
set -e
# Version to make patches against.
# Make sure to have it unpacked in /usr/src
BASE_VERSION="4.6.0-pre1"
2002-09-22 05:41:18 +04:00
# Local directories
MC_BASE_DIR="/usr/src/mc-$BASE_VERSION"
RPM_SRC_DIR="/usr/src/redhat"
2002-09-07 05:00:52 +04:00
# Location of the snapshot directory
SITE="login.ibiblio.org"
DIR="/public/ftp/pub/Linux/utils/file/managers/mc/snapshots"
MCVERSION=`ls mc*.tar.gz | sort | sed -n '$s/\.tar\.gz//p'`
MCNAME=mc-`date "+%Y-%m-%d-%H" --utc`.tar.gz
MCTARBALL="$MCVERSION.tar.gz"
if test -z "$MCVERSION" || test ! -f "$MCTARBALL"; then
echo "No tarball found!!!"
exit 1
fi
2002-09-22 05:41:18 +04:00
rm -f $RPM_SRC_DIR/RPMS/i386/mc-*.i386.rpm
2002-09-07 05:00:52 +04:00
rpm -tb "$MCTARBALL"
2002-09-22 05:41:18 +04:00
MC_RPM=`echo $RPM_SRC_DIR/RPMS/i386/mc-*.i386.rpm`
2002-09-07 05:00:52 +04:00
if test ! -f $MC_RPM; then
echo "Failed to compile package!!!"
exit 1
fi
# Make a patch against the latest released version
MC_PATCH="mc-$BASE_VERSION-current.diff.bz2"
2002-09-22 05:41:18 +04:00
if test ! -d $MC_BASE_DIR; then
2002-09-07 05:00:52 +04:00
echo "Cannot find unpacked base version!!!"
exit 1
fi
rm -f mc-$BASE_VERSION-current.diff mc-$BASE_VERSION-current.diff.bz2
2002-10-02 03:00:43 +04:00
# Don't merge PO-files, we are skipping them in the patch
2002-09-07 05:00:52 +04:00
make distdir MSGMERGE=
# Sometimes GNU diff returns 1 for unclear reasons
2002-09-22 05:41:18 +04:00
diff -urN -x po $MC_BASE_DIR mc-*/ >mc-$BASE_VERSION-current.diff || :
2002-09-07 05:00:52 +04:00
bzip2 mc-$BASE_VERSION-current.diff
2002-10-02 03:00:43 +04:00
upload "$MCTARBALL" "mc*.tar.gz"
upload "$MC_RPM" "mc*.i386.rpm"
upload "$MC_PATCH" "mc*.diff.bz2"
2002-09-07 05:00:52 +04:00
echo "Done"