1 | #!/bin/bash
|
---|
2 | #
|
---|
3 | # Deliver packages and tgz files to ftp.mondorescue.org
|
---|
4 | #
|
---|
5 | # $Id: pkg2ftp 721 2006-07-28 23:22:31Z bruno $
|
---|
6 | #
|
---|
7 |
|
---|
8 | dname=`dirname $0`
|
---|
9 | prem=`echo $dname |cut -c1`
|
---|
10 | if [ ${prem} == "/" ]; then
|
---|
11 | export TOOLHOME=$dname
|
---|
12 | else
|
---|
13 | export TOOLHOME=${PWD}/$dname
|
---|
14 | fi
|
---|
15 |
|
---|
16 | . $TOOLHOME/common-env
|
---|
17 | . $TOOLHOME/distro-env
|
---|
18 | . $TOOLHOME/ftp-env
|
---|
19 |
|
---|
20 | # We need to get $VER and $TAG
|
---|
21 | if [ "$1" = "" ]; then
|
---|
22 | LAST=`cat ${TOPDIR}/LAST`
|
---|
23 | else
|
---|
24 | LAST=$1
|
---|
25 | shift
|
---|
26 | fi
|
---|
27 | VER=`echo $LAST | cut -d- -f1`
|
---|
28 | TAG=`echo $LAST | cut -d- -f2`
|
---|
29 | echo "Working on ${VER}-$TAG"
|
---|
30 |
|
---|
31 | if [ "$1" = "" ]; then
|
---|
32 | c="mondo-doc mindi mondo"
|
---|
33 | else
|
---|
34 | if [ "$1" = "all" ]; then
|
---|
35 | c="mindi-kernel mondo-doc mindi mondo"
|
---|
36 | else
|
---|
37 | c=$1
|
---|
38 | fi
|
---|
39 | fi
|
---|
40 |
|
---|
41 | export pkg=""
|
---|
42 | echo "Working under $TOPBUILDDIR"
|
---|
43 | cd $TOPBUILDDIR
|
---|
44 |
|
---|
45 | spkg=""
|
---|
46 | pkg=""
|
---|
47 |
|
---|
48 | for p in $c; do
|
---|
49 | # s= stable; t = trunk; 1-9 = official version
|
---|
50 | src=${TOPDIR}/${VER}-$TAG/$p-[1-9st]*.tar.gz
|
---|
51 | pv=`basename $src .tar.gz`
|
---|
52 | if [ _"$dtype" = _"rpm" ]; then
|
---|
53 | if [ _"$p" = _"mondo-doc" ]; then
|
---|
54 | ar="noarch"
|
---|
55 | else
|
---|
56 | ar=$ARCH
|
---|
57 | fi
|
---|
58 | pkg="$pkg ${TOPBUILDDIR}/RPMS/${ar}/$pv${suf}.${ar}.rpm"
|
---|
59 | spkg="$spkg ${TOPBUILDDIR}/SRPMS/$pv${suf}.src.rpm"
|
---|
60 | elif [ _"$dtype" = "_deb" ]; then
|
---|
61 | pkg="$pkg ${TOPBUILDDIR}/$p_*.rpm"
|
---|
62 | spkg="$spkg ${TOPBUILDDIR}/$p_*.dsc ${TOPBUILDDIR}/$p_*.tar.gz"
|
---|
63 | fi
|
---|
64 | done
|
---|
65 |
|
---|
66 | echo "Packages delivery to ${ACCOUNT}:${DSTDIR}/${ddir}/${dver}"
|
---|
67 | ssh ${ACCOUNT} "mkdir -p ${DSTDIR}/${ddir}/${dver}"
|
---|
68 | scp ${pkg} ${spkg} ${ACCOUNT}:${DSTDIR}/${ddir}/${dver}
|
---|