#! /usr/bin/perl -w
# Copyright 2004 Sven Dowideit. All Rights Reserved.
# License: GPL
use strict;
use File::Path qw( rmtree mkpath );
my $outputDir;
#please do all your work in /tmp, and then move the resultant files (and error logs) into the directory specified on the command line
if ( $#ARGV == 0 ) {
$outputDir = $ARGV[0];
} else {
print "please provide an outputDir\n";
exit(1);
}
print "
Building Kernels\n";
print "building kernels
\n";
print "results will be in $outputDir\n";
print "\n";
mkpath( $outputDir, 1 );
################################################################################
# build the twiki-kernel
chomp( my @svnInfo = `svn info .` );
my ( $svnRev ) = ( ( grep { /^Revision:\s+(\d+)$/ } @svnInfo )[0] ) =~ /(\d+)$/;
my ( $branch ) = ( ( grep { /^URL:/ } @svnInfo )[0] ) =~ m/^.+?\/branches\/([^\/]+)\/.+?$/;
execute ( "cd distro/ ; ./build-twiki-kernel.pl --nogendocs --nozip --tempdir=/tmp --outputdir=$outputDir --outfile=TWikiKernel-$branch-$svnRev" ) or die $!;
execute ( "perl build.pl release; mv ../TWiki.tgz $outputDir/TWikiKernel-$branch-$svnRev.tgz" );
print "\n";
print "
\n";
################################################################################
# kernels filenames download/discussion list
my @dirReleases = ();
if ( opendir( RELEASES, $outputDir ) )
{
@dirReleases = grep { /^TWiki.+\.tar\.gz/ } readdir( RELEASES ); #or warn $!;
closedir( RELEASES ) or warn $!;
}
print qq{