source: branches/stable/tools/mkdeliv @ 589

Last change on this file since 589 was 589, checked in by bcornec, 14 years ago

Delivery process to ftp reviewed for 2.0.8

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 3.0 KB
Line 
1#!/bin/bash
2#
3# Deliver packages and tgz files to ftp.mondorescue.org
4#
5# $Id: mkdeliv 589 2006-05-29 10:24:29Z bcornec $
6#
7
8# BerliOS FTP/SSH setup
9ACCOUNT=bruno@ftp.mondorescue.org
10DSTDIR=/mondo/ftp
11FTPSERV="ftp.berlios.de"
12FTPDIR="/incoming"
13
14dname=`dirname $0`
15prem=`echo $dname |cut -c1`
16if [ ${prem} == "/" ]; then
17        export TOOLHOME=$dname
18else
19    export TOOLHOME=${PWD}/$dname
20fi
21
22. $TOOLHOME/common-env
23. $TOOLHOME/distro-env
24
25# We need to get $VER and $TAG
26if [ "$1" = "" ]; then
27    LAST=`cat ${TOPDIR}/LAST`
28else
29    LAST=$1
30    shift
31fi
32VER=`echo $LAST | cut -d- -f1`
33TAG=`echo $LAST | cut -d- -f2`
34echo "Working on ${VER}-$TAG"
35   
36if [ "$1" = "" ]; then
37    c="mondo-doc mindi mondo"
38else
39    if [ "$1" = "all" ]; then
40        c="mindi-kernel mondo-doc mindi mondo"
41    else
42        c=$1
43    fi
44fi
45
46export pkg=""
47echo "Working under $TOPBUILDDIR"
48cd $TOPBUILDDIR
49
50for p in $c; do
51
52tgz=""
53srpms=""
54rpms=""
55
56if [ "`echo $c | grep mindi`" != "" ]; then
57    cp -a ${TOPBUILDDIR}/SOURCES/mindi-${MINDI_VER}.tgz ${TOPBUILDDIR}/SOURCES/mindi-${MINDI_VER}-r${rev}.tgz
58    cp -a ${TOPBUILDDIR}/SOURCES/mindi-${MINDI_VER}.tar.bz2 ${TOPBUILDDIR}/SOURCES/mindi-${MINDI_VER}-r${rev}.tar.bz2
59    tgz="$tgz ${TOPBUILDDIR}/SOURCES/mindi-${MINDI_VER}-r${rev}.tgz ${TOPBUILDDIR}/SOURCES/mindi-${MINDI_VER}-r${rev}.tar.bz2"
60    rpms="$rpms ${TOPBUILDDIR}/RPMS/${ARCH}/mindi-${MINDI_VER}-${rev}${suf}.${ARCH}.rpm"
61    srpms="$srpms ${TOPBUILDDIR}/SRPMS/mindi-${MINDI_VER}-${rev}${suf}.src.rpm"
62fi
63if [ "`echo $c | grep mondo-doc`" != "" ]; then
64    cp -a ${TOPBUILDDIR}/SOURCES/mondo-doc-${MONDO_VER}.tgz ${TOPBUILDDIR}/SOURCES/mondo-doc-${MONDO_VER}-r${rev}.tgz
65    cp -a ${TOPBUILDDIR}/SOURCES/mondo-doc-${MONDO_VER}.tar.bz2 ${TOPBUILDDIR}/SOURCES/mondo-doc-${MONDO_VER}-r${rev}.tar.bz2
66    tgz="$tgz ${TOPBUILDDIR}/SOURCES/mondo-doc-${MONDO_VER}-r${rev}.tgz ${TOPBUILDDIR}/SOURCES/mondo-doc-${MONDO_VER}-r${rev}.tar.bz2"
67    rpms="$rpms ${TOPBUILDDIR}/RPMS/${ARCH}/mondo-doc-${MONDO_VER}-${rev}${suf}.${ARCH}.rpm"
68    srpms="$srpms ${TOPBUILDDIR}/SRPMS/mondo-${MONDO_VER}-${rev}${suf}.src.rpm"
69fi
70if [ "`echo $c | grep -v doc | grep mondo`" != "" ]; then
71    cp -a ${TOPBUILDDIR}/SOURCES/mondo-${MONDO_VER}.tgz ${TOPBUILDDIR}/SOURCES/mondo-${MONDO_VER}-r${rev}.tgz
72    cp -a ${TOPBUILDDIR}/SOURCES/mondo-${MONDO_VER}.tar.bz2 ${TOPBUILDDIR}/SOURCES/mondo-${MONDO_VER}-r${rev}.tar.bz2
73    tgz="$tgz ${TOPBUILDDIR}/SOURCES/mondo-${MONDO_VER}-r${rev}.tgz ${TOPBUILDDIR}/SOURCES/mondo-${MONDO_VER}-r${rev}.tar.bz2"
74    rpms="$rpms ${TOPBUILDDIR}/RPMS/${ARCH}/mondo-${MONDO_VER}-${rev}${suf}.${ARCH}.rpm"
75    srpms="$srpms ${TOPBUILDDIR}/SRPMS/mondo-${MONDO_VER}-${rev}${suf}.src.rpm"
76fi
77echo "Sources delivery to ${ACCOUNT}:${DSTDIR}/src"
78scp ${tgz} ${ACCOUNT}:${DSTDIR}/src
79
80echo "Packages delivery to ${ACCOUNT}:${DSTDIR}/${ddir}/${dver}"
81ssh ${ACCOUNT} "mkdir -p ${DSTDIR}/${ddir}/${dver}"
82scp ${rpms} ${srpms} ${ACCOUNT}:${DSTDIR}/${ddir}/${dver}
83
84echo "Sources delivery to ${FTPSERV} ${FTPDIR}"
85if [ "`which ncftpput`" != "" ]; then
86    ncftpput ${FTPSERV} ${FTPDIR} ${tgz}
87elif [ "`which lftp`" != "" ]; then
88    lftp -e "cd ${FTPDIR} ; put ${tgz} ; quit" ${FTPSERV}
89fi
Note: See TracBrowser for help on using the repository browser.