develooper Front page | perl.perl5.porters | Postings from May 2009

Re: Defining stability and testing it

Thread Previous | Thread Next
From:
George Greer
Date:
May 30, 2009 00:27
Subject:
Re: Defining stability and testing it
Message ID:
alpine.LFD.2.00.0905281933570.16744@ein.m-l.org
#!/bin/sh
set -e
set -x
if [ -z "$DISPLAY" -o "$DISPLAY" = ":0.0" ]; then
  unset DISPLAY
  exec nice xvfb-run -a $0 "$@"
fi

while true; do
#  wget -m http://www.perl.org/CPAN/MIRRORED.BY
#  MIRROR=`perl -0777 -e 'my @sites = map { /dst_http\s*=\s*"(.+)"/ or die; $1; } grep /^\s*dst_http/m, grep /United States/, <> =~ /^(\S+:.*?\n\n)/gms; print $sites[rand @sites];' < www.cpan.org/MIRRORED.BY`
#  cp ~/MyConfig.pm ~/.cpan/CPAN/MyConfig.pm
#  minicpan -l ~/cpan -r $MIRROR
#  rm -f ~/.cpan/CPAN/MyConfig.pm

  for i in blead maint-5.10 maint-5.8; do
    set -e
    cd ~/git
    git fetch origin $i
    if [ ! -e ~/stamp-$i -o ~/git/.git/refs/remotes/origin/$i -nt ~/stamp-$i ]; then
      git clean -dxf
      git checkout origin/$i
      touch -r ~/git/.git/refs/remotes/origin/$i ~/stamp-$i

      ./Configure \
	-Dusedevel \
	-Dinstallbin \
	-Dprefix=$HOME/perl-$i \
	-Doptimize="-g -Duse64bitall -Dusethreads" \
	-des
      make -j2 && make test

      # Install it, and create a 'perl' link so we actually use it.
      rm -rf "$HOME/perl-$i"
      make install
      ln -sf "$HOME/perl-$i/bin/perl5"* "$HOME/perl-$i/bin/perl"

      # Whack CPAN since we're rebuilt.
      rm -rf "$HOME/cpan-build-$i"
    fi

    # CPAN
    [ -d "$HOME/perl-$i" ] || exit 1
    [ -d "$HOME/cpan-build-$i" ] || mkdir "$HOME/cpan-build-$i"
    [ -d "$HOME/perl-$i/lib/site_perl/CPAN" ] || mkdir "$HOME/perl-$i/lib/site_perl/CPAN"
    perl -pe "s{%CPANBUILD%}{/home/perl/cpan-build-$i}g;" ~/MyConfig.pm > "$HOME/perl-$i/lib/site_perl/CPAN/MyConfig.pm"
    export PATH="$HOME/perl-$i/bin:$HOME/explode:$PATH"
    export PERL_CR_SMOKER_RUNONCE=1
    /usr/bin/perl -I "$HOME/perl-$i/lib/site_perl" -MCPAN::Reporter::Smoker -e start

    cd ..
  done
  wait
  exit 1
done

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About