Changeset 922


Ignore:
Timestamp:
Nov 4, 2006, 11:52:59 PM (13 years ago)
Author:
bruno
Message:

Delivery to MDV is now OK

Location:
branches/stable/tools
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/tools/mdv-env

    r594 r922  
    88export ACCOUNT="bcornec@kenobi.mandriva.com"
    99export DSTNODE="-t ssh n3.mandriva.com"
     10export SVNMDV=$HOME/mandriva
  • branches/stable/tools/pkg2mdv

    r825 r922  
    4040fi
    4141
    42 export pkg=""
    43 echo "Working under $TOPBUILDDIR"
    44 cd $TOPBUILDDIR
    45 
    46 ppkg=""
    47 spkg=""
    4842
    4943for 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"
     44    src=${TOPDIR}/${VER}-$TAG/$p-[1-9]*.tar.bz2
     45    s=`basename $src`
     46    oldver=`echo $s | sed "s/$p-\([1-9][0-9.]*\).tar.bz2/\1/"`
     47    newver=`echo $oldver | sed 's/\([0-9]\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\)/\1.\2\3/'`
     48    distro=`ls -d ${TOPDIR}/${VER}-$TAG/$p-[1-9]*/distributions/mandriva-* | tail -1`
     49    spec=${distro}/$p.spec
     50    echo "Updating Mandriva package in $SVNMDV/$p"
     51    cd $SVNMDV/$p
     52    mkdir -p SOURCES SPECS
     53    echo "Modifying $oldver => $newver"
     54    svn del --force SOURCES/$p-*.tar.bz2
     55    cp -a $src SOURCES/$p-$newver.tar.bz2
     56    tar xfj SOURCES/$p-$newver.tar.bz2
     57    mv $p-$oldver $p-$newver
     58    perl -pi -e "s/$oldver/$newver/" $p-$newver/VERSION
     59    tar cfj SOURCES/$p-$newver.tar.bz2 $p-$newver
     60    rm -rf $p-$newver
     61    svn add SOURCES/$p-$newver.tar.bz2
     62    cp -a $spec SPECS
     63    # Use mkrel for mdv
     64    perl -pi -e "s/^Release:[ \t]+..*/Release:  %mkrel $TAG/" SPECS/$p.spec
     65    perl -pi -e 's/^Version:[ \t]+([0-9])\.([0-9]+)\.([0-9]+)/Version:  $1.$2$3/' SPECS/$p.spec
     66    perl -pi -e 's/mindi >= ..*,/mindi/' SPECS/$p.spec
     67    $TOOLHOME/mdv-changelog.pl SPECS/$p.spec
     68    # Changelog management
     69    echo "Building packages"
     70    bm
     71    if [ $? -eq 0 ]; then
     72        rm -rf BUILD RPMS SRPMS BUILDROOT
     73        echo "Committing from $SVNMDV/$p into Mandriva's SVN"
     74        svn ci -F $MONDOTMP/cmt.spec
     75        if [ $? -eq 0 ]; then
     76            svn up
     77            rm -f $MONDOTMP/cmt.spec
     78            echo "Building on Mandriva's cluster"
     79            ssh $ACCOUNT $DSTNODE "yr $p"
     80        fi
     81    fi
    5582done
    5683
    57 echo "Packages delivery to ${ACCOUNT}"
    58 cat > /tmp/mkmondo << EOF
    59 rm -f /tmp/mondorescue.log
    60 for 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 Release:[ \t]+..*/define Release: %mkrel $TAG/" rpm/SPECS/\$s
    65     perl -pi -e 's/ Bruno Cornec <bruno@mondorescue.org>..*/ 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
    68 done
    69 apkg=\`egrep "^Wrote:" /tmp/mondorescue.log | grep -v debug | cut -d: -f2\`
    70 aspkg=\`echo \$apkg | egrep "\.src.rpm"\`
    71 for 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\`"
    74 done
    75 for p in \$apkg; do
    76     sudo ftpcontrib \$p
    77 done
    78 rm -f \$ppkg
    79 EOF
    80 chmod 755 /tmp/mkmondo
    81 scp -p ${spkg} /tmp/mkmondo ${ACCOUNT}:
    82 scp -p /tmp/mkmondo ${ACCOUNT}:
    83 echo "Packages rebuild on ${DSTNODE}"
    84 ssh ${ACCOUNT} ${DSTNODE} "./mkmondo"
     84rm -rf $MONDOTMP
     85
    8586) 2>&1 | tee /tmp/pk2mdv.log
Note: See TracChangeset for help on using the changeset viewer.