1 | #!/bin/bash
|
---|
2 | #
|
---|
3 | # Deliver RPMs packages and tgz files to ftp.mondorescue.org
|
---|
4 | #
|
---|
5 | # $Id: mkdeliv 549 2006-05-13 23:42:49Z bcornec $
|
---|
6 | #
|
---|
7 |
|
---|
8 | # BerliOS FTP/SSH setup
|
---|
9 | ACCOUNT=bruno@ftp.mondorescue.org
|
---|
10 | DSTDIR=/mondo/ftp
|
---|
11 | FTPSERV="ftp.berlios.de"
|
---|
12 | FTPDIR="/incoming"
|
---|
13 |
|
---|
14 | dname=`dirname $0`
|
---|
15 | prem=`echo $dname |cut -c1`
|
---|
16 | if [ ${prem} == "/" ]; then
|
---|
17 | export TOOLHOME=$dname
|
---|
18 | else
|
---|
19 | export TOOLHOME=${PWD}/$dname
|
---|
20 | fi
|
---|
21 |
|
---|
22 | . $TOOLHOME/common-env
|
---|
23 | . $TOOLHOME/svn-env
|
---|
24 | . $TOOLHOME/rpm-env
|
---|
25 |
|
---|
26 | tgz=""
|
---|
27 | srpms=""
|
---|
28 | rpms=""
|
---|
29 | rev=`$TOOLHOME/mksvnversion`
|
---|
30 |
|
---|
31 | if [ "$1" = "" ]; then
|
---|
32 | c="mondo-doc mindi mondo"
|
---|
33 | else
|
---|
34 | c=$1
|
---|
35 | fi
|
---|
36 | if [ "`echo $c | grep mindi`" != "" ]; then
|
---|
37 | cp -a ${TOPDIR}/SOURCES/mindi-${MINDI_VER}.tgz ${TOPDIR}/SOURCES/mindi-${MINDI_VER}-r${rev}.tgz
|
---|
38 | cp -a ${TOPDIR}/SOURCES/mindi-${MINDI_VER}.tar.bz2 ${TOPDIR}/SOURCES/mindi-${MINDI_VER}-r${rev}.tar.bz2
|
---|
39 | tgz="$tgz ${TOPDIR}/SOURCES/mindi-${MINDI_VER}-r${rev}.tgz ${TOPDIR}/SOURCES/mindi-${MINDI_VER}-r${rev}.tar.bz2"
|
---|
40 | rpms="$rpms ${TOPDIR}/RPMS/${ARCH}/mindi-${MINDI_VER}-${rev}${suf}.${ARCH}.rpm"
|
---|
41 | srpms="$srpms ${TOPDIR}/SRPMS/mindi-${MINDI_VER}-${rev}${suf}.src.rpm"
|
---|
42 | fi
|
---|
43 | if [ "`echo $c | grep mondo-doc`" != "" ]; then
|
---|
44 | cp -a ${TOPDIR}/SOURCES/mondo-doc-${MONDO_VER}.tgz ${TOPDIR}/SOURCES/mondo-doc-${MONDO_VER}-r${rev}.tgz
|
---|
45 | cp -a ${TOPDIR}/SOURCES/mondo-doc-${MONDO_VER}.tar.bz2 ${TOPDIR}/SOURCES/mondo-doc-${MONDO_VER}-r${rev}.tar.bz2
|
---|
46 | tgz="$tgz ${TOPDIR}/SOURCES/mondo-doc-${MONDO_VER}-r${rev}.tgz ${TOPDIR}/SOURCES/mondo-doc-${MONDO_VER}-r${rev}.tar.bz2"
|
---|
47 | rpms="$rpms ${TOPDIR}/RPMS/${ARCH}/mondo-doc-${MONDO_VER}-${rev}${suf}.${ARCH}.rpm"
|
---|
48 | srpms="$srpms ${TOPDIR}/SRPMS/mondo-${MONDO_VER}-${rev}${suf}.src.rpm"
|
---|
49 | fi
|
---|
50 | if [ "`echo $c | grep -v doc | grep mondo`" != "" ]; then
|
---|
51 | cp -a ${TOPDIR}/SOURCES/mondo-${MONDO_VER}.tgz ${TOPDIR}/SOURCES/mondo-${MONDO_VER}-r${rev}.tgz
|
---|
52 | cp -a ${TOPDIR}/SOURCES/mondo-${MONDO_VER}.tar.bz2 ${TOPDIR}/SOURCES/mondo-${MONDO_VER}-r${rev}.tar.bz2
|
---|
53 | tgz="$tgz ${TOPDIR}/SOURCES/mondo-${MONDO_VER}-r${rev}.tgz ${TOPDIR}/SOURCES/mondo-${MONDO_VER}-r${rev}.tar.bz2"
|
---|
54 | rpms="$rpms ${TOPDIR}/RPMS/${ARCH}/mondo-${MONDO_VER}-${rev}${suf}.${ARCH}.rpm"
|
---|
55 | srpms="$srpms ${TOPDIR}/SRPMS/mondo-${MONDO_VER}-${rev}${suf}.src.rpm"
|
---|
56 | fi
|
---|
57 | echo "Sources delivery to ${ACCOUNT}:${DSTDIR}/src"
|
---|
58 | scp ${tgz} ${ACCOUNT}:${DSTDIR}/src
|
---|
59 |
|
---|
60 | echo "Packages delivery to ${ACCOUNT}:${DSTDIR}/${ddir}/${dver}"
|
---|
61 | ssh ${ACCOUNT} "mkdir -p ${DSTDIR}/${ddir}/${dver}"
|
---|
62 | scp ${rpms} ${srpms} ${ACCOUNT}:${DSTDIR}/${ddir}/${dver}
|
---|
63 |
|
---|
64 | echo "Sources delivery to ${FTPSERV} ${FTPDIR}"
|
---|
65 | if [ "`which ncftpput`" != "" ]; then
|
---|
66 | ncftpput ${FTPSERV} ${FTPDIR} ${tgz}
|
---|
67 | elif [ "`which lftp`" != "" ]; then
|
---|
68 | lftp -e "cd ${FTPDIR} ; put ${tgz} ; quit" ${FTPSERV}
|
---|
69 | fi
|
---|