Changeset 1358


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

Try to improve Fedora delivery (from 2.2.2)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.3/tools/pkg2fc

    r1273 r1358  
    4040fi
    4141
    42 export pkg=""
    43 echo "Working under $TOPBUILDDIR"
    4442cd $TOPBUILDDIR
    4543
    4644ppkg=""
    4745spkg=""
     46lastfc=`cat $TOOLHOME/DISTROS | grep fedora | tail -1 | cut -d_ -f2`
    4847
    4948for p in $c; do
     
    5150    src=${TOPDIR}/${VER}-$TAG/$p-[1-9st]*.tar.gz
    5251    pv=`basename $src .tar.gz`
    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"
     52    tar -xz -C $MONDOTMP -f $src $pv/TAG
     53    tag=`cat $MONDOTMP/$pv/TAG`
     54    spkg="$spkg ${DSTDIR}/../fedora/${lastfc}/$pv-${tag}.fc${lastfc}.src.rpm"
    5655done
    5756
    5857echo "Packages delivery to ${ACCOUNT}"
    5958cat > /tmp/mkmondo << EOF
     59set -x
     60TOPBUILDDIR=\`rpmquery --eval '%{_topdir}' 2> /dev/null\`
     61echo "Working under $TOPBUILDDIR"
    6062rm -f /tmp/mondorescue.log
    61 for p in $ppkg ; do
    62     rpm -ivh \$p
    63     src=\`rpm -qlp \$p | grep -E '\.spec'\`
    64     spec=\`tar tvf rpm/SOURCES/\$src | grep -E "\$p-fc.spec"\`
    65     tar xf rpm/SOURCES/\$src \$spec
    66     s=\`rpm -qlp \$p | egrep '\.spec'\`
    67     mv \$p-fc.spec rpm/SPECS/\$s
    68     # Use dist for fc
    69     perl -pi -e "s/define Release:[ \t]+([0-9]+)..*/define Release: \$1%{?dist}/" rpm/SPECS/\$s
    70     perl -pi -e 's/ Bruno Cornec <bruno@mondorescue.org>..*/ Bruno Cornec <bruno@mondorescue.org> %{version}-%{release}/' rpm/SPECS/\$s
    71     rm -rf rpm/BUILD/*
    72     rpmbuild -ba rpm/SPECS/\$s 2>&1 | tee -a /tmp/mondorescue.log
     63for p in $spkg ; do
     64    pkg=\`basename \$p\`
     65    rpm -ivh \$pkg
     66    sp=\`rpm -qlp \$pkg | grep -E '\.spec'\`
     67    src=\`rpm -qlp \$pkg | grep -E '\.tar\.'\`
     68    fcsp=\`echo \$sp | sed 's/\.spec/-fc.spec/'\`
     69    spec=\`tar tfz \$TOPBUILDDIR/SOURCES/\$src | grep -E "\$fcsp"\`
     70    tar xzf \$TOPBUILDDIR/SOURCES/\$src \$spec
     71    for s in \$spec ; do
     72        file \$s | grep -q ISO-8859
     73        if [ \$? -eq 0 ]; then
     74            cat \$s | recode latin1..utf-8 > \$TOPBUILDDIR/SPECS/\$sp
     75        else
     76            mv \$s \$TOPBUILDDIR/SPECS/\$sp
     77        fi
     78        # Use dist for fc
     79        perl -pi -e "s/define Release:[ \t]+([0-9]+)..*/define Release: \$1%{?dist}/" \$TOPBUILDDIR/SPECS/\$sp
     80        perl -pi -e 's/ Bruno Cornec <bruno@mondorescue.org>..*/ Bruno Cornec <bruno@mondorescue.org> %{version}-%{release}/' \$TOPBUILDDIR/SPECS/\$sp
     81        rm -rf \$TOPBUILDDIR/BUILD/*
     82        rpmbuild -ba \$TOPBUILDDIR/SPECS/\$sp 2>&1 | tee -a /tmp/mondorescue.log
     83    done
    7384done
    7485apkg=\`egrep "^Wrote:" /tmp/mondorescue.log | grep -v debug | cut -d: -f2\`
    7586aspkg=\`echo \$apkg | egrep "\.src.rpm"\`
    76 mkdir -p \$DSTDIR
    77 mv \$aspkg \$DSTDIR
     87mkdir -p $DSTDIR
     88mv \$aspkg $DSTDIR
    7889rm -f \$ppkg
     90cd /tmp
    7991EOF
    8092chmod 755 /tmp/mkmondo
    81 scp -p ${spkg} /tmp/mkmondo ${ACCOUNT}:
     93echo "Packages rebuild on ${ACCOUNT}"
    8294scp -p /tmp/mkmondo ${ACCOUNT}:
    83 echo "Packages rebuild on ${DSTNODE}"
    84 ssh -q ${ACCOUNT} ${DSTNODE} "./mkmondo"
     95ssh -q ${ACCOUNT} "cp -v ${spkg} . ; ./mkmondo"
    8596) 2>&1 | tee /tmp/pk2fc.log
Note: See TracChangeset for help on using the changeset viewer.