3 # This script takes the compiled tarball, makes an RPM package and
4 # a patch against the latest released version, then uploads
5 # everything over ssh and removes old snapshots.
6 # Run this script in the directory where mc was built.
9 # upload to .in* files, then rename.
10 # build tarball, select level of testing
11 # (dist, distcheck, warning checks)
16 # Version to make patches against.
17 # Make sure to have it unpacked in /usr/src
18 BASE_VERSION
="4.6.0-pre1"
21 MC_BASE_DIR
="/usr/src/mc-$BASE_VERSION"
22 RPM_SRC_DIR
="/usr/src/redhat"
24 # Location of the snapshot directory
25 SITE
="login.ibiblio.org"
26 DIR
="/public/ftp/pub/Linux/utils/file/managers/mc/snapshots"
28 MCVERSION
=`ls mc*.tar.gz | sort | sed -n '$s/\.tar\.gz//p'`
29 MCNAME
=mc-
`date "+%Y-%m-%d-%H" --utc`.
tar.gz
30 MCTARBALL
="$MCVERSION.tar.gz"
32 if test -z "$MCVERSION" ||
test ! -f "$MCTARBALL"; then
33 echo "No tarball found!!!"
37 rm -f $RPM_SRC_DIR/RPMS
/i386
/mc-
*.i386.rpm
39 MC_RPM
=`echo $RPM_SRC_DIR/RPMS/i386/mc-*.i386.rpm`
40 if test ! -f $MC_RPM; then
41 echo "Failed to compile package!!!"
45 # Make a patch against the latest released version
46 MC_PATCH
="mc-$BASE_VERSION-current.diff.bz2"
47 if test ! -d $MC_BASE_DIR; then
48 echo "Cannot find unpacked base version!!!"
51 rm -f mc-
$BASE_VERSION-current.
diff mc-
$BASE_VERSION-current.
diff.bz2
53 # Don't bother to merge PO-files, we are skipping them in the patch
54 make distdir MSGMERGE
=
56 # Sometimes GNU diff returns 1 for unclear reasons
57 diff -urN -x po
$MC_BASE_DIR mc-
*/ >mc-
$BASE_VERSION-current.
diff ||
:
58 bzip2 mc-
$BASE_VERSION-current.
diff
60 echo "Copying $MCTARBALL to $SITE"
61 scp
"$MCTARBALL" "$SITE:$DIR/$MCNAME"
64 MCFILES
=`ssh $SITE ls $DIR | egrep '^mc.*\.tar\.gz' | sort | sed '$d'`
67 ssh $SITE rm -f "$DIR/$i"
70 echo "Copying $MC_RPM to $SITE"
71 scp
"$MC_RPM" "$SITE:$DIR/"
73 # Remove old RPM packages
74 MCFILES
=`ssh $SITE ls $DIR | egrep '^mc.*\.rpm' | sort | sed '$d'`
77 ssh $SITE rm -f "$DIR/$i"
80 echo "Copying $MC_PATCH to $SITE"
81 scp
"$MC_PATCH" "$SITE:$DIR/"
84 MCFILES
=`ssh $SITE ls $DIR | egrep '^mc.*\.diff\.bz2' | sort | sed '$d'`
87 ssh $SITE rm -f "$DIR/$i"