source: branches/2.2.0/tools/pkg2mdv @ 921

Last change on this file since 921 was 921, checked in by Bruno Cornec, 13 years ago

Attempt to deliver Mandriva official 2.2.0 packages from build system

  • Property svn:executable set to *
File size: 1.7 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 mindi-busybox mondo"
34else
35    if [ "$1" = "all" ]; then
36        c="mindi-kernel mondo-doc mindi mindi-busybox mondo"
37    else
38        c=$1
39    fi
40fi
41
42
43for p in $c; do
44    src=${TOPDIR}/${VER}-$TAG/$p-[1-9]*.tar.bz2
45    distro=`ls -d ${TOPDIR}/${VER}-$TAG/$p-[1-9]*/distributions/mandriva-* | tail -1`
46    spec=${distro}/$p.spec
47    echo "Updating Mandriva package in $SVNMDV/$p"
48    mkdir -p $SVNMDV/$p/SOURCES $SVNMDV/$p/SPECS
49    rm -f $SVNMDV/$p/SOURCES/$p-*.tar.bz2 $SVNMDV/$p/SPECS/$p.spec
50    cp -a $src $SVNMDV/$p/SOURCES
51    cp -a $spec $SVNMDV/$p/SPECS
52    # Use mkrel for mdv
53    perl -pi -e "s/^Release:[ \t]+..*/Release:  %mkrel $TAG/" $SVNMDV/$p/SPECS/$p.spec
54    perl -pi -e 's/ Bruno Cornec <bruno@mondorescue.org>..*/ Bruno Cornec <bcornec@mandriva.org> %{version}-%{release}/' $SVNMDV/$p/SPECS/$p.spec
55    # Changelog management
56    echo "Committing from $SVNMDV/$p into Mandriva's SVN"
57    cd $SVNMDV/$p
58    bm
59    if [ $? -eq 0 ]; then
60        rm -rf BUILD RPMS SRPMS
61        #svn ci
62    fi
63done
64
65    #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\`"
66) 2>&1 | tee /tmp/pk2mdv.log
Note: See TracBrowser for help on using the repository browser.