1 | #!/bin/bash
|
---|
2 | #
|
---|
3 | # Deliver packages and tgz files to ftp.mondorescue.org
|
---|
4 | #
|
---|
5 | # $Id: pkg2ftp 1043 2007-01-08 22:31:22Z bruno $
|
---|
6 | #
|
---|
7 |
|
---|
8 |
|
---|
9 | (
|
---|
10 | dname=`dirname $0`
|
---|
11 | prem=`echo $dname |cut -c1`
|
---|
12 | if [ _${prem} = _"/" ]; then
|
---|
13 | export TOOLHOME=$dname
|
---|
14 | else
|
---|
15 | export TOOLHOME=${PWD}/$dname
|
---|
16 | fi
|
---|
17 |
|
---|
18 | . $TOOLHOME/common-env
|
---|
19 | . $TOOLHOME/distro-env
|
---|
20 | . $TOOLHOME/ftp-env
|
---|
21 |
|
---|
22 | # We need to get $VER and $TAG
|
---|
23 | if [ "$1" = "" ]; then
|
---|
24 | LAST=`cat ${TOPDIR}/LAST`
|
---|
25 | else
|
---|
26 | LAST=$1
|
---|
27 | shift
|
---|
28 | fi
|
---|
29 | VER=`echo $LAST | cut -d- -f1`
|
---|
30 | TAG=`echo $LAST | cut -d- -f2`
|
---|
31 | echo "Working on ${VER}-$TAG"
|
---|
32 |
|
---|
33 | if [ "$1" = "" ]; then
|
---|
34 | c="mondo-doc mindi mindi-busybox mondo"
|
---|
35 | else
|
---|
36 | if [ "$1" = "all" ]; then
|
---|
37 | c="mindi-kernel mondo-doc mindi mindi-busybox mondo"
|
---|
38 | else
|
---|
39 | c="$*"
|
---|
40 | fi
|
---|
41 | fi
|
---|
42 |
|
---|
43 | export pkg=""
|
---|
44 | echo "Working under $TOPBUILDDIR"
|
---|
45 | cd $TOPBUILDDIR
|
---|
46 |
|
---|
47 | spkg=""
|
---|
48 | pkg=""
|
---|
49 |
|
---|
50 | for p in $c; do
|
---|
51 | # s= stable; t = trunk; 1-9 = official version
|
---|
52 | src=${TOPDIR}/${VER}-$TAG/$p-[1-9st]*.tar.gz
|
---|
53 | pv=`basename $src .tar.gz`
|
---|
54 | tar -xz -C $MONDOTMP -f $src $pv/TAG
|
---|
55 | tag=`cat $MONDOTMP/$pv/TAG`
|
---|
56 | if [ _"$dtype" = _"rpm" ]; then
|
---|
57 | if [ _"$p" = _"mondo-doc" ]; then
|
---|
58 | ar="noarch"
|
---|
59 | else
|
---|
60 | ar=$ARCH
|
---|
61 | fi
|
---|
62 | pkg="$pkg ${TOPBUILDDIR}/RPMS/${ar}/$pv-${tag}${suf}.${ar}.rpm"
|
---|
63 | spkg="$spkg ${TOPBUILDDIR}/SRPMS/$pv-${tag}${suf}.src.rpm"
|
---|
64 | elif [ _"$dtype" = "_deb" ]; then
|
---|
65 | pkg="$pkg ${TOPBUILDDIR}/$p_*.deb"
|
---|
66 | spkg="$spkg ${TOPBUILDDIR}/$p_*.dsc ${TOPBUILDDIR}/$p_*.tar.gz"
|
---|
67 | elif [ _"$dtype" = "_ebuild" ]; then
|
---|
68 | spkg="$spkg ${TOPBUILDDIR}/portage/sys-apps/$p/$pv.ebuild"
|
---|
69 | pkg="$pkg /usr/portage/packages/All/$pv.tbz2"
|
---|
70 | elif [ _"$dfam" = _"slackware" ]; then
|
---|
71 | pkg="$pkg ${TOPBUILDDIR}/build-$p/$pv-*-${tag}mr.tgz"
|
---|
72 | fi
|
---|
73 | done
|
---|
74 |
|
---|
75 | rm -rf $MONDOTMP
|
---|
76 | echo "Packages delivery to ${ACCOUNT}:${DSTDIR}/${ddir}/${dver}"
|
---|
77 | ssh -q ${ACCOUNT} "mkdir -p ${DSTDIR}/${ddir}/${dver} ; cd ${DSTDIR}/${ddir}/${dver} ; rm -f ${pkg} ${spkg}"
|
---|
78 | scp ${pkg} ${spkg} ${ACCOUNT}:${DSTDIR}/${ddir}/${dver}
|
---|
79 | ) 2>&1 | tee /tmp/pkg2ftp.log
|
---|