Changeset 1357


Ignore:
Timestamp:
Apr 28, 2007, 8:32:14 PM (12 years ago)
Author:
bruno
Message:

Try to improve Fedora delivery (from 2.2.2)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/tools/pkg2fc

    r1271 r1357  
    4242fi
    4343
    44 export pkg=""
    45 echo "Working under $TOPBUILDDIR"
    4644cd $TOPBUILDDIR
    4745
    4846ppkg=""
    4947spkg=""
     48lastfc=`cat $TOOLHOME/DISTROS | grep fedora | tail -1 | cut -d_ -f2`
    5049
    5150for p in $c; do
     
    5352    src=${TOPDIR}/${VER}-$TAG/$p-[1-9st]*.tar.gz
    5453    pv=`basename $src .tar.gz`
    55     tag=`echo $pv | sed "s/-\([0-9]*.*\)/\2/"`
    56     spkg="$spkg ${TOPBUILDDIR}/SRPMS/$pv-${tag}${suf}.src.rpm"
    57     ppkg="$ppkg $pv-${tag}${suf}.src.rpm"
     54    tar -xz -C $MONDOTMP -f $src $pv/TAG
     55    tag=`cat $MONDOTMP/$pv/TAG`
     56    spkg="$spkg ${DSTDIR}/../fedora/${lastfc}/$pv-${tag}.fc${lastfc}.src.rpm"
    5857done
    5958
    6059echo "Packages delivery to ${ACCOUNT}"
    6160cat > /tmp/mkmondo << EOF
     61set -x
     62TOPBUILDDIR=\`rpmquery --eval '%{_topdir}' 2> /dev/null\`
     63echo "Working under $TOPBUILDDIR"
    6264rm -f /tmp/mondorescue.log
    63 for p in $ppkg ; do
    64     rpm -ivh \$p
    65     src=\`rpm -qlp \$p | grep -E '\.spec'\`
    66     spec=\`tar tvf rpm/SOURCES/\$src | grep -E "\$p-fc.spec"\`
    67     tar xf rpm/SOURCES/\$src \$spec
    68     s=\`rpm -qlp \$p | egrep '\.spec'\`
    69     mv \$p-fc.spec rpm/SPECS/\$s
    70     # Use dist for fc
    71     perl -pi -e "s/define Release:[ \t]+([0-9]+)..*/define Release: \$1%{?dist}/" rpm/SPECS/\$s
    72     perl -pi -e 's/ Bruno Cornec <bruno@mondorescue.org>..*/ Bruno Cornec <bruno@mondorescue.org> %{version}-%{release}/' rpm/SPECS/\$s
    73     rm -rf rpm/BUILD/*
    74     rpmbuild -ba rpm/SPECS/\$s 2>&1 | tee -a /tmp/mondorescue.log
     65for p in $spkg ; do
     66    pkg=\`basename \$p\`
     67    rpm -ivh \$pkg
     68    sp=\`rpm -qlp \$pkg | grep -E '\.spec'\`
     69    src=\`rpm -qlp \$pkg | grep -E '\.tar\.'\`
     70    fcsp=\`echo \$sp | sed 's/\.spec/-fc.spec/'\`
     71    spec=\`tar tfz \$TOPBUILDDIR/SOURCES/\$src | grep -E "\$fcsp"\`
     72    tar xzf \$TOPBUILDDIR/SOURCES/\$src \$spec
     73    for s in \$spec ; do
     74        file \$s | grep -q ISO-8859
     75        if [ \$? -eq 0 ]; then
     76            cat \$s | recode latin1..utf-8 > \$TOPBUILDDIR/SPECS/\$sp
     77        else
     78            mv \$s \$TOPBUILDDIR/SPECS/\$sp
     79        fi
     80        # Use dist for fc
     81        perl -pi -e "s/define Release:[ \t]+([0-9]+)..*/define Release: \$1%{?dist}/" \$TOPBUILDDIR/SPECS/\$sp
     82        perl -pi -e 's/ Bruno Cornec <bruno@mondorescue.org>..*/ Bruno Cornec <bruno@mondorescue.org> %{version}-%{release}/' \$TOPBUILDDIR/SPECS/\$sp
     83        rm -rf \$TOPBUILDDIR/BUILD/*
     84        rpmbuild -ba \$TOPBUILDDIR/SPECS/\$sp 2>&1 | tee -a /tmp/mondorescue.log
     85    done
    7586done
    7687apkg=\`egrep "^Wrote:" /tmp/mondorescue.log | grep -v debug | cut -d: -f2\`
    7788aspkg=\`echo \$apkg | egrep "\.src.rpm"\`
    78 mkdir -p \$DSTDIR
    79 mv \$aspkg \$DSTDIR
     89mkdir -p $DSTDIR
     90mv \$aspkg $DSTDIR
    8091rm -f \$ppkg
     92cd /tmp
    8193EOF
    8294chmod 755 /tmp/mkmondo
    83 scp -p ${spkg} /tmp/mkmondo ${ACCOUNT}:
     95echo "Packages rebuild on ${ACCOUNT}"
    8496scp -p /tmp/mkmondo ${ACCOUNT}:
    85 echo "Packages rebuild on ${DSTNODE}"
    86 ssh -q ${ACCOUNT} ${DSTNODE} "./mkmondo"
     97ssh -q ${ACCOUNT} "cp -v ${spkg} . ; ./mkmondo"
    8798) 2>&1 | tee /tmp/pk2fc.log
Note: See TracChangeset for help on using the changeset viewer.