source: trunk/tools/pkg2mdv @ 793

Last change on this file since 793 was 782, checked in by bruno, 13 years ago

merge -r763:781 $SVN_M/branches/stable

  • Property svn:executable set to *
File size: 2.1 KB
Line 
1#!/bin/bash
2#
3# Deliver packages and tgz files to Mandriva
4#
5# $Id$
6#
7
8(
9dname=`dirname $0`
10prem=`echo $dname |cut -c1`
11if [ ${prem} == "/" ]; then
12        export TOOLHOME=$dname
13else
14    export TOOLHOME=${PWD}/$dname
15fi
16
17. $TOOLHOME/common-env
18. $TOOLHOME/distro-env
19. $TOOLHOME/mdv-env
20
21# We need to get $VER and $TAG
22if [ "$1" = "" ]; then
23    LAST=`cat ${TOPDIR}/LAST`
24else
25    LAST=$1
26    shift
27fi
28VER=`echo $LAST | cut -d- -f1`
29TAG=`echo $LAST | cut -d- -f2`
30echo "Working on ${VER}-$TAG"
31   
32if [ "$1" = "" ]; then
33    c="mondo-doc mindi mondo"
34else
35    if [ "$1" = "all" ]; then
36        c="mindi-kernel mondo-doc mindi mondo"
37    else
38        c=$1
39    fi
40fi
41
42export pkg=""
43echo "Working under $TOPBUILDDIR"
44cd $TOPBUILDDIR
45
46ppkg=""
47spkg=""
48
49for p in $c; do
50    # s= stable; t = trunk; 1-9 = official version
51    src=${TOPDIR}/${VER}-$TAG/$p-[1-9st]*.tar.gz
52    pv=`basename $src .tar.gz`
53    spkg="$spkg ${TOPBUILDDIR}/SRPMS/$pv-${TAG}${suf}.src.rpm"
54    ppkg="$ppkg $pv-${TAG}${suf}.src.rpm"
55done
56
57echo "Packages delivery to ${ACCOUNT}"
58cat > /tmp/mkmondo << EOF
59rm -f /tmp/mondorescue.log
60for p in $ppkg ; do
61    rpm -ivh \$p
62    s=\`rpm -qlp \$p | egrep '\.spec'\`
63    # Use mkrel for mdv
64    perl -pi -e 's/define mrel[ \t]+([0-9]+)\..*/define mrel    %mkrel \$1/' rpm/SPECS/\$s
65    perl -pi -e 's/ Bruno Cornec <bruno@mondorescue.org> ([0-9]+.*)/ Bruno Cornec <bcornec@mandriva.org> %{version}-%{release}/' rpm/SPECS/\$s
66    rm -rf rpm/BUILD/*
67    rpmbuild -ba rpm/SPECS/\$s 2>&1 | tee -a /tmp/mondorescue.log
68done
69apkg=\`egrep "^Wrote:" /tmp/mondorescue.log | grep -v debug | cut -d: -f2\`
70aspkg=\`echo \$apkg | egrep "\.src.rpm"\`
71for d in 2006 200664; do
72    scp -p \$aspkg chroot\${d}:
73    ssh chroot\${d} "for p in $aspkg; do rpm -ivh \`basename \$p\` ; rpmbuild -ba rpm/SPECS/\$s | tee -a /tmp/mondorescue.log ; done ; sudo ftp\${d}contrib \`egrep '^Wrote:' /tmp/mondorescue.log | grep -v debug | cut -d: -f2\`"
74done
75for p in \$apkg; do
76    sudo ftpcontrib \$p
77done
78rm -f \$ppkg
79EOF
80chmod 755 /tmp/mkmondo
81scp -p ${spkg} /tmp/mkmondo ${ACCOUNT}:
82scp -p /tmp/mkmondo ${ACCOUNT}:
83echo "Packages rebuild on ${DSTNODE}"
84ssh ${ACCOUNT} ${DSTNODE} "./mkmondo"
85) 2>&1 | tee /tmp/pk2mdv.log
Note: See TracBrowser for help on using the repository browser.