Changeset 5 in ProjectBuilder for devel/pb/bin/cms2build.pl


Ignore:
Timestamp:
Jul 29, 2007, 12:50:34 AM (17 years ago)
Author:
Bruno Cornec
Message:

Lots of modifs to find the right way. Probably still not good

File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/cms2build.pl

    r4 r5  
    88use strict;
    99use common.pm;
    10 use proj.pm;
     10use pb.pm;
    1111use cms.pm;
    1212
    13 set_env();
    14 
    15 VER=`cat ${TOOLHOME}/VERSION`
    16 TAG=`cat ${TOOLHOME}/TAG`
    17 my $DEST=$ENV{'TOPDIR'}."/".$VER."-".$TAG
    1813TEST="false"
    1914OPT=""
     
    3732
    3833# Make it safe for CMS commands
    39 cd ${TOOLHOME}/..
     34cd ${PBROOT}/..
    4035
    4136for pkg in $c; do
    4237    p=$PKGDIR[
    43     v=`cat ${TOOLHOME}/../$p/VERSION`
    44     tag=`cat ${TOOLHOME}/../$p/TAG`
     38    v=`cat ${PBROOT}/../$p/VERSION`
     39    tag=`cat ${PBROOT}/../$p/TAG`
    4540    echo "Management of $p $v-$tag (rev $REVISION)"
    4641    dest="$DEST/$p-$v"
    4742    rm -fr $dest
    48     $CMSEXP $OPT ${TOOLHOME}/../$p $dest
     43    $CMSEXP $OPT ${PBROOT}/../$p $dest
    4944    echo "$REVISION" > $dest/REVISION
    5045    echo "Generating SVN log file ..."
    51     $SVNLOG $OPT -v ${TOOLHOME}/../$p > $dest/history.log
     46    $SVNLOG $OPT -v ${PBROOT}/../$p > $dest/history.log
    5247
    53     for d in `cat ${TOOLHOME}/DISTROS`; do
     48    for d in `cat ${PBROOT}/DISTROS`; do
    5449        export ddir=`echo $d | cut -d_ -f1`
    5550        export dver=`echo $d | cut -d_ -f2`
    5651        echo "Generating build files for $ddir ($dver)"
    57         . $TOOLHOME/distro-env
     52        . $PBROOT/distro-env
    5853
    5954        ddd=`LANG=C ; date '+%Y-%m-%d'`
    60         cat > $PROJTMP/mondorescue.mc << EOF
     55        cat > $PBTMP/mondorescue.mc << EOF
    6156define(\`TTT', ${tag})dnl
    6257define(\`RRR', ${tag}${suf})dnl
     
    7772
    7873            if [ $ddir = "fedora" ]; then
    79                 $TOOLHOME/mkchangelog.pl fc $p $PROJTMP/$p-fc.spec
    80                 m4 $PROJTMP/mondorescue.mc $inc $dest/distributions/rpm/$p.spec $MONDOTMP/$p-fc.spec > $dest/distributions/${ddir}-$dver/$p-fc.spec
     74                $PBROOT/mkchangelog.pl fc $p $PBTMP/$p-fc.spec
     75                m4 $PBTMP/mondorescue.mc $inc $dest/distributions/rpm/$p.spec $MONDOTMP/$p-fc.spec > $dest/distributions/${ddir}-$dver/$p-fc.spec
    8176            fi
    82             $TOOLHOME/mkchangelog.pl $dtype $p $PROJTMP/$p.spec
     77            $PBROOT/mkchangelog.pl $dtype $p $PBTMP/$p.spec
    8378            if [ $? -ne 0 ]; then
    8479                echo "Unable to create changelog for ${ddir}-$dver/$p.spec"
    8580                exit -1
    8681            fi
    87             m4 $PROJTMP/mondorescue.mc $inc $dest/distributions/rpm/$p.spec $MONDOTMP/$p.spec > $dest/distributions/${ddir}-$dver/$p.spec
     82            m4 $PBTMP/mondorescue.mc $inc $dest/distributions/rpm/$p.spec $MONDOTMP/$p.spec > $dest/distributions/${ddir}-$dver/$p.spec
    8883            if [ _"`/bin/arch`" = _"x86_64" ] && [ $ddir = "rhel" ]; then
    8984                # Bug on x86_64 on _sysconfdir on rhel4 at least
     
    9186            fi
    9287
    93             rm -f $PROJTMP/$p.spec
     88            rm -f $PBTMP/$p.spec
    9489        elif [ "$dtype" = "ebuild" ]; then
    95             m4 $PROJTMP/mondorescue.mc $dest/distributions/$dfam/$p.ebuild > $dest/distributions/${ddir}-$dver/$p-$v.ebuild
     90            m4 $PBTMP/mondorescue.mc $dest/distributions/$dfam/$p.ebuild > $dest/distributions/${ddir}-$dver/$p-$v.ebuild
    9691        elif [ "$dtype" = "tgz" ]; then
    97             m4 $PROJTMP/mondorescue.mc $dest/distributions/$dfam/slack-desc > $dest/distributions/${ddir}-$dver/slack-desc
     92            m4 $PBTMP/mondorescue.mc $dest/distributions/$dfam/slack-desc > $dest/distributions/${ddir}-$dver/slack-desc
    9893        elif [ "$dtype" = "port" ]; then
    99             m4 $PROJTMP/mondorescue.mc $dest/distributions/$dfam/Makefile > $dest/distributions/${ddir}-$dver/Makefile
     94            m4 $PBTMP/mondorescue.mc $dest/distributions/$dfam/Makefile > $dest/distributions/${ddir}-$dver/Makefile
    10095        elif [ "$dtype" = "deb" ]; then
    10196            if [ -f $dest/distributions/$ddir/rules ]; then
     
    109104                exit -1
    110105            fi
    111             m4 $PROJTMP/mondorescue.mc $inc > $dest/distributions/${ddir}-$dver/rules
    112             $TOOLHOME/mkchangelog.pl $dtype $p $dest/distributions/${ddir}-$dver/changelog
     106            m4 $PBTMP/mondorescue.mc $inc > $dest/distributions/${ddir}-$dver/rules
     107            $PBROOT/mkchangelog.pl $dtype $p $dest/distributions/${ddir}-$dver/changelog
    113108            if [ $? -ne 0 ]; then
    114109                echo "Unable to create changelog for ${ddir}-$dver/changelog"
     
    125120        cd $dest
    126121        for f in mondorescue-howto.sgml *8; do
    127             m4 $PROJTMP/mondorescue.mc $f > ${f}.new
     122            m4 $PBTMP/mondorescue.mc $f > ${f}.new
    128123            mv ${f}.new $f
    129124        done
     
    146141
    147142    if [ _"`echo $p | grep -vE 'kernel|busybox' | grep mindi`" != _"" ]; then
    148         v1=`cat ${TOOLHOME}/../mondo-doc/VERSION`
     143        v1=`cat ${PBROOT}/../mondo-doc/VERSION`
    149144        if [ ! -d mondo-doc-$v1 ]; then
    150145            echo "mondo-doc should be created before $p"
     
    155150    fi
    156151    if [ "`echo $p | grep -v doc | grep  mondo`" != "" ]; then
    157         v1=`cat ${TOOLHOME}/../mondo-doc/VERSION`
     152        v1=`cat ${PBROOT}/../mondo-doc/VERSION`
    158153        if [ ! -d mondo-doc-$v1 ]; then
    159154            echo "mondo-doc should be created before $p"
     
    177172done
    178173
    179 rm -rf $PROJTMP
     174rm -rf $PBTMP
    180175
    181176echo "Version delivered :"
Note: See TracChangeset for help on using the changeset viewer.