source: branches/stable/tools/pkg2ftp @ 765

Last change on this file since 765 was 765, checked in by bruno, 13 years ago
  • First successful gentoo build
  • Addition of a new trac- logo + conf file for trac in svn
  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 1.6 KB
Line 
1#!/bin/bash
2#
3# Deliver packages and tgz files to ftp.mondorescue.org
4#
5# $Id: pkg2ftp 765 2006-08-08 10:05:12Z bruno $
6#
7
8
9(
10dname=`dirname $0`
11prem=`echo $dname |cut -c1`
12if [ ${prem} == "/" ]; then
13        export TOOLHOME=$dname
14else
15    export TOOLHOME=${PWD}/$dname
16fi
17
18. $TOOLHOME/common-env
19. $TOOLHOME/distro-env
20. $TOOLHOME/ftp-env
21
22# We need to get $VER and $TAG
23if [ "$1" = "" ]; then
24    LAST=`cat ${TOPDIR}/LAST`
25else
26    LAST=$1
27    shift
28fi
29VER=`echo $LAST | cut -d- -f1`
30TAG=`echo $LAST | cut -d- -f2`
31echo "Working on ${VER}-$TAG"
32   
33if [ "$1" = "" ]; then
34    c="mondo-doc mindi mondo"
35else
36    if [ "$1" = "all" ]; then
37        c="mindi-kernel mondo-doc mindi mondo"
38    else
39        c=$1
40    fi
41fi
42
43export pkg=""
44echo "Working under $TOPBUILDDIR"
45cd $TOPBUILDDIR
46
47spkg=""
48pkg=""
49
50for 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    if [  _"$dtype" = _"rpm" ]; then
55        if [ _"$p" = _"mondo-doc" ]; then
56            ar="noarch"
57        else
58            ar=$ARCH
59        fi
60        pkg="$pkg ${TOPBUILDDIR}/RPMS/${ar}/$pv-${TAG}${suf}.${ar}.rpm"
61        spkg="$spkg ${TOPBUILDDIR}/SRPMS/$pv-${TAG}${suf}.src.rpm"
62    elif [  _"$dtype" = "_deb" ]; then
63        pkg="$pkg ${TOPBUILDDIR}/$p_*.deb"
64        spkg="$spkg ${TOPBUILDDIR}/$p_*.dsc ${TOPBUILDDIR}/$p_*.tar.gz"
65    elif [  _"$dtype" = "_ebuild" ]; then
66        spkg="$spkg ${TOPBUILDDIR}/portage/sys-apps/$p/$pv.ebuild"
67        pkg="$pkg /usr/portage/packages/All/$pv.tbz2"
68    fi
69done
70
71echo "Packages delivery to ${ACCOUNT}:${DSTDIR}/${ddir}/${dver}"
72ssh ${ACCOUNT} "mkdir -p ${DSTDIR}/${ddir}/${dver}"
73scp ${pkg} ${spkg} ${ACCOUNT}:${DSTDIR}/${ddir}/${dver}
74) 2>&1 | tee /tmp/pkg2ftp.log
Note: See TracBrowser for help on using the repository browser.