Changeset 932 for trunk/tools


Ignore:
Timestamp:
Nov 15, 2006, 12:40:15 PM (13 years ago)
Author:
bruno
Message:

merge -r913:931 $SVN_M/branches/stable

Location:
trunk/tools
Files:
1 deleted
15 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/tools/build2pkg

    r923 r932  
    3737        c="mindi-kernel mondo-doc mindi mindi-busybox mondo"
    3838    else
    39         c=$1
     39        c="$*"
    4040    fi
    4141fi
     
    7979        rm -rf $p-${PVER}
    8080
     81        # set LANGUAGE to check for correct log messages
    8182        export LANGUAGE=C
    8283        rpmbuild -ba $p.spec 2>&1 | tee $log
  • trunk/tools/build2qemu

    r900 r932  
    2121    export TOOLHOME=${PWD}/$dname
    2222fi
    23 
    2423
    2524. $TOOLHOME/common-env
     
    8988    ssh -p $sp root@localhost "date $rdate"
    9089    ssh -p $sp bruno@localhost "cd / ; rm -rf ~bruno/mondo ~bruno/RPMS/BUILD/* ~bruno/RPMS/tmp/* /tmp/* ; tar xfz ~bruno/mkmondo.tar.gz ; $MONDOTMP/mkmondo " | tee $MONDOTMP/mkvm.log
    91     #ssh -p $sp bruno@localhost "cd / ; tar xfz ~bruno/mkmondo.tar.gz ; $MONDOTMP/mkmondo ; rm -f $MONDOTMP" | tee $MONDOTMP/mkvm.log
    9290    if [ $vmp -eq 1 ]; then
    9391        ssh -p $sp root@localhost "halt -p"
  • trunk/tools/distro-env

    r900 r932  
    2727            export ddir="fedora"
    2828            export dver=`awk '{print $4}' /etc/redhat-release`
     29        elif grep -q CentOS /etc/redhat-release ; then
     30            export ddir="centos"
     31            export dver=`awk '{print $3}' /etc/redhat-release`
    2932        else
    3033            export ddir="redhat"
     
    8184    dtype="rpm"
    8285    suf=".${ddir}${dver}"
    83 elif [ $ddir = "fedora" -o $ddir = "redhat" -o $ddir = "rhel" ]; then
     86elif [ $ddir = "fedora" -o $ddir = "redhat" -o $ddir = "rhel" -o $ddir = "centos" ]; then
    8487    dfam="redhat"
    8588    dtype="rpm"
     
    8790    if [ $ddir = "fedora" ]; then
    8891        suf=".fc${dver1}"
     92    elif [ $ddir = "centos" ]; then
     93        dver1=`echo ${dver} | sed "s/\.[0-9]//"`
     94        suf=".centos${dver1}"
    8995    elif [ $ddir = "redhat" ]; then
    9096        suf=".rh${dver1}"
     
    118124
    119125if [ _"$dtype" = _"rpm" ]; then
     126    export TOPBUILDDIR=`rpmquery -E '%{_topdir}' 2> /dev/null`
    120127    export ARCH=`rpm --showrc | egrep "^build arch" | awk '{print $4}'`
    121     if [ -f ${HOME}/.rpmmacros ]; then
    122         export TOPBUILDDIR=`egrep '^%_topdir' ${HOME}/.rpmmacros | awk '{print $2}'`
     128    mkdir -p ${TOPBUILDDIR}/{RPMS,SRPMS,SPECS,SOURCES,BUILD}
     129    if [ $? -ne 0 ]; then
     130        echo "Please ensure that you can write into ${TOPBUILDDIR}"
     131        echo "Solution: setup _topdir in your ~/.rpmmacros or"
     132        echo "chown the ${TOPBUILDDIR} to your uid"
     133        exit -1
    123134    fi
    124     mkdir -p ${TOPBUILDDIR}/{RPMS,SRPMS,SPECS,SOURCES,BUILD}
    125135elif [ _"$dtype" = _"deb" ]; then
    126136    mkdir -p ${TOPBUILDDIR}
  • trunk/tools/file2ftp

    r839 r932  
    1111prem=`echo $dname |cut -c1`
    1212if [ ${prem} == "/" ]; then
    13         export TOOLHOME=$dname
     13    export TOOLHOME=$dname
    1414else
    1515    export TOOLHOME=${PWD}/$dname
     
    3737        c="mindi-kernel mondo-doc mindi mindi-busybox mondo"
    3838    else
    39         c=$1
     39        c="$*"
    4040    fi
    4141fi
  • trunk/tools/livwww

    r900 r932  
    4848if [ $force -eq 1 ]; then
    4949    echo "Purging $LOCALDIR"
    50     rm -rf $LOCALDIR
     50    rm -rf $LOCALDIR/* $LOCALDIR/.??*
    5151fi
    5252
     
    5555if [ $force -eq 1 ]; then
    5656    echo "Purging $LOCALDOC"
    57     rm -rf $LOCALDOC
     57    rm -rf $LOCALDOC/* $LOCALDOC/.??*
    5858fi
    5959
     
    6969    make -f Makefile.howto
    7070    make -f Makefile.man
    71     mv $LOCALDOC $LOCALDIR/docs
     71    mkdir -p $LOCALDIR/docs
     72    mv $LOCALDOC/* $LOCALDIR/docs
    7273    #
    7374    # Man pages corrections
  • trunk/tools/mdv-env

    r600 r932  
    88export ACCOUNT="bcornec@kenobi.mandriva.com"
    99export DSTNODE="-t ssh n3.mandriva.com"
     10export SVNMDV=$HOME/mandriva
  • trunk/tools/mkchangelog.pl

    r782 r932  
    2525my $ver2 = "";
    2626my $date = "";
     27my $tag = "";
    2728
    2829# For date handling
     
    5859    }
    5960}
     61$tmp="$TOOLHOME/../$pkg/TAG";
     62if (-f "$tmp") {
     63    open(TAG,"$tmp") || die "Unable to open $tmp";
     64    $tag = <TAG>;
     65    chomp($tag);
     66} else {
     67    die "Unable to find a TAG file for $pkg\n";
     68}
    6069#print "Using $chglog as input ChangeLog file for $pkg\n";
    6170
     
    9099        if ($ver !~ /-/) {
    91100            if ($first eq 1) {
    92                 $ver2 = "$ver-$ENV{TAG}"."$ENV{suf}";
     101                $ver2 = "$ver-$tag"."$ENV{suf}";
    93102                $first=0;
    94103            } else {
  • trunk/tools/mknewtag

    r839 r932  
    1616fi
    1717
    18 . $TOOLHOME/common-env
    19 . $TOOLHOME/distro-env
     18if [ "$1" = "" ]; then
     19    mods="mindi mondo mondo-doc mindi-busybox mindi-kernel"
     20else
     21    mods="$*"
     22fi
    2023
    21 # We need to get $VER and $TAG
    22 if [ "$1" = "" ]; then
    23     LAST=`cat ${TOPDIR}/LAST`
    24 else
    25     LAST=$1
    26     shift
    27 fi
    28 VER=`echo $LAST | cut -d- -f1`
    29 
    30 TAG=`echo $LAST | cut -d- -f2`
    31 echo -n "Changing TAG of version $VER value from $TAG to "
    32 ((TAG=$TAG+1))
    33 echo "$TAG"
    34 nb=`svn diff $TOOLHOME/.. | wc -l`
     24cd $TOOLHOME/..
     25nb=`svn diff | wc -l`
    3526if [ $nb -gt 0 ]; then
    3627    echo "You'll have to check in before updating the TAG"
    3728    exit -1
    3829else
    39     for p in mindi mondo mindi-busybox mindi-kernel; do
    40         v=`cat $TOOLHOME/../$p/VERSION`
    41         grep -q "${v}" $TOOLHOME/../$p/ChangeLog
     30    for p in $mods; do
     31        grep -q "${v}" $p/ChangeLog
    4232        if [ $? -ne 0 ]; then
    4333            echo "You'll have to document in ${p}'s ChangeLog for ${v} related modifications"
     
    4535        fi
    4636    done
    47     echo "$TAG" > $TOOLHOME/TAG
    48     (cd $TOOLHOME/.. ; svn ci -m "Automatic update of TAG to $TAG" ; svn up)
     37    for p in $mods; do
     38        TAG=`cat $p/TAG`
     39        v=`cat $p/VERSION`
     40        echo -n "Changing TAG of $p-$v value from $TAG to "
     41        ((TAG=$TAG+1))
     42        echo "$TAG"
     43        echo "$TAG" > $p/TAG
     44    done
     45    svn ci -m "Automatic update of TAGs" ; svn up
    4946fi
  • trunk/tools/mknewversion

    r839 r932  
    1616fi
    1717
    18 . $TOOLHOME/common-env
    19 . $TOOLHOME/distro-env
    20 
    2118# We need to get $VER
    2219if [ "$1" = "" ]; then
    23     LAST=`cat ${TOPDIR}/LAST`
     20    echo "Syntax: mknewversion version"
     21    exit -1
    2422else
    25     LAST=$1
     23    VER=$1
    2624    shift
    2725fi
    28 VER=`echo $LAST | cut -d- -f1`
    29 MAJVER=`echo $VER | cut -d. -f1-2`
    30 MINDIMAJVER=`echo $VER | cut -d. -f1`
    31 MINDIMINVER=`echo $VER | cut -d. -f2`
    32 ((MINDIMAJVER=$MINDIMAJVER-1))
    33 MINVER=`echo $VER | cut -d. -f3`
    34 TAG=1
    35 ((MINVER=$MINVER+1))
    36 VER=${MAJVER}.${MINVER}
    37 echo "Changing Version $LAST to ${VER}-${TAG}"
     26
    3827grep -q stable $TOOLHOME/../mondo/VERSION
    3928if [ $? -ne 0 ]; then
     
    4130    exit -1
    4231fi
     32
    4333nb=`svn diff $TOOLHOME/.. | wc -l`
    4434if [ $nb -gt 0 ]; then
    4535    echo "You'll have to check in before changing version"
    46 else
    47     svn copy $SVN_M/branches/stable $SVN_M/branches/${VER}
    48     cd $TOOLHOME/../..
    49     svn co $SVN_M/branches/${VER} ${VER}
    50     cd ${VER}
    51     echo "$TAG" > tools/TAG
    52     for p in mindi mondo mondo-doc mindi-kernel mindi-busybox; do
    53         v=${VER}
    54         if [ $p == "mindi" ]; then
    55             v=${MINDIMAJVER}.${MINDIMINVER}.${MINVER}
    56         fi
    57         echo "$v" > $p/VERSION
    58         if [ -f $p/ChangeLog ]; then
    59             grep -q "${v}-${TAG}" $p/ChangeLog
    60             if [ $? -ne 0 ]; then
    61                 echo "You'll have to document in ${p}'s ChangeLog for ${v}-${TAG} related modifications"
    62                 exit -1
    63             fi
    64         fi
    65     done
    66     svn ci -m "Creation of ${VER}-$TAG"
    67     svn up
     36    exit -1
    6837fi
     38
     39svn copy $SVN_M/branches/stable $SVN_M/branches/${VER}
     40cd $TOOLHOME/../..
     41svn co $SVN_M/branches/${VER} ${VER}
     42cd ${VER}
     43
     44for p in mindi mondo mondo-doc mindi-kernel mindi-busybox; do
     45    # Reset TAG - This maybe an issue for mindi-busybox only
     46    echo "1" > $p/TAG
     47    v=$VER
     48    echo $p | grep -q mindi
     49    if [ $? -eq 0 ]; then
     50        echo "Please give new $p version for this $VER mondo version ? "
     51        read v
     52    fi
     53    echo "$v" > $p/VERSION
     54done
     55svn ci -m "Creation of mondo ${VER}-$TAG"
     56svn up
  • trunk/tools/pkg2fc

    r903 r932  
    3636        c="mindi-kernel mondo-doc mindi mindi-busybox mondo"
    3737    else
    38         c=$1
     38        c="$*"
    3939    fi
    4040fi
     
    5151    src=${TOPDIR}/${VER}-$TAG/$p-[1-9st]*.tar.gz
    5252    pv=`basename $src .tar.gz`
    53     spkg="$spkg ${TOPBUILDDIR}/SRPMS/$pv-${TAG}${suf}.src.rpm"
    54     ppkg="$ppkg $pv-${TAG}${suf}.src.rpm"
     53    tag=`echo $pv | sed "s/-\([0-9]*.*\)/\2/"`
     54    spkg="$spkg ${TOPBUILDDIR}/SRPMS/$pv-${tag}${suf}.src.rpm"
     55    ppkg="$ppkg $pv-${tag}${suf}.src.rpm"
    5556done
    5657
     
    6263    s=\`rpm -qlp \$p | egrep '\.spec'\`
    6364    # Use dist for fc
    64     perl -pi -e "s/define Release:[ \t]+[0-9]+..*/define Release:   $TAG%{?dist}/" rpm/SPECS/\$s
     65    perl -pi -e "s/define Release:[ \t]+([0-9]+)..*/define Release: $1%{?dist}/" rpm/SPECS/\$s
    6566    perl -pi -e 's/ Bruno Cornec <bruno@mondorescue.org>..*/ Bruno Cornec <bruno@mondorescue.org> %{version}-%{release}/' rpm/SPECS/\$s
    6667    rm -rf rpm/BUILD/*
  • trunk/tools/pkg2ftp

    r839 r932  
    3737        c="mindi-kernel mondo-doc mindi mindi-busybox mondo"
    3838    else
    39         c=$1
     39        c="$*"
    4040    fi
    4141fi
     
    5252    src=${TOPDIR}/${VER}-$TAG/$p-[1-9st]*.tar.gz
    5353    pv=`basename $src .tar.gz`
     54    tag=`echo $pv | sed "s/-\([0-9]*.*\)/\2/"`
    5455    if [  _"$dtype" = _"rpm" ]; then
    5556        if [ _"$p" = _"mondo-doc" ]; then
     
    5859            ar=$ARCH
    5960        fi
    60         pkg="$pkg ${TOPBUILDDIR}/RPMS/${ar}/$pv-${TAG}${suf}.${ar}.rpm"
    61         spkg="$spkg ${TOPBUILDDIR}/SRPMS/$pv-${TAG}${suf}.src.rpm"
     61        pkg="$pkg ${TOPBUILDDIR}/RPMS/${ar}/$pv-${tag}${suf}.${ar}.rpm"
     62        spkg="$spkg ${TOPBUILDDIR}/SRPMS/$pv-${tag}${suf}.src.rpm"
    6263    elif [  _"$dtype" = "_deb" ]; then
    6364        pkg="$pkg ${TOPBUILDDIR}/$p_*.deb"
  • trunk/tools/pkg2mdv

    r839 r932  
    3636        c="mindi-kernel mondo-doc mindi mindi-busybox mondo"
    3737    else
    38         c=$1
     38        c="$*"
    3939    fi
    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
  • trunk/tools/qemu-vm.txt

    r900 r932  
    44
    55# RPM based : urpmi, yum install, yast2
     6# Mandriva
    67urpmi neon newt-devel slang-devel glibc-static-devel autoconf automake libtool gcc rpm-build wget gvim/vim-X11 gcc-c++ docbook-utils-pdf ImageMagick man patch mindi mondo
     8
     9#Fedora
     10yum install neon newt-devel slang-devel autoconf automake libtool gcc rpm-build wget gvim/vim-X11 gcc-c++ docbook-utils-pdf ImageMagick man patch
     11
    712
    813# gentoo
  • trunk/tools/svn-env

    r900 r932  
    66#
    77
    8 export VER=`cat ${TOOLHOME}/../mondo/VERSION`
    9 
    108# To be safe for SVN commands
    119export REVISION=`(cd $TOOLHOME/.. ; svnversion .)`
    12 export TAG=`cat ${TOOLHOME}/TAG`
  • trunk/tools/svn2build

    r900 r932  
    1919. ./svn-env
    2020
     21VER=`cat ${TOOLHOME}/../mondo/VERSION`
     22TAG=`cat ${TOOLHOME}/../mondo/TAG`
    2123DEST=${TOPDIR}/${VER}-$TAG
    2224mkdir -p $DEST
     
    2830            c="mindi-kernel mondo-doc mindi mindi-busybox mondo"
    2931    else
    30         c=$1
     32        c="$*"
    3133    fi
    3234fi
     
    3739for p in $c; do
    3840    v=`cat ${TOOLHOME}/../$p/VERSION`
    39     echo "Management of $p $v-$TAG (rev $REVISION)"
     41    tag=`cat ${TOOLHOME}/../$p/TAG`
     42    echo "Management of $p $v-$tag (rev $REVISION)"
    4043    dest="$DEST/$p-$v"
    4144    rm -fr $dest
     
    5356        ddd=`LANG=C ; date '+%Y-%m-%d'`
    5457        cat > $MONDOTMP/mondorescue.mc << EOF
    55 define(\`TTT', ${TAG})dnl
    56 define(\`RRR', ${TAG}${suf})dnl
     58define(\`TTT', ${tag})dnl
     59define(\`RRR', ${tag}${suf})dnl
    5760define(\`VVV', ${v})dnl
    5861define(\`DDD', ${ddd})dnl
Note: See TracChangeset for help on using the changeset viewer.