-
Notifications
You must be signed in to change notification settings - Fork 1
/
bootstrap.pl
executable file
·58 lines (48 loc) · 1.29 KB
/
bootstrap.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/perl
#use strict;
use File::Spec::Functions qw(rel2abs);
use File::Basename;
require "regression.conf";
# check args
if ($#ARGV+1 != 1 && $#ARGV+1 != 2)
{
print "Usage: bootstrap.pl <abiword svn url> [<abiword plugins svn url>]\n";
die;
}
# setup variables
$abiword_url = $ARGV[0];
$abiword_url =~ m/.*\/(.*)/;
$sn = $1;
$source_dir = $root . "/.src/" . $sn;
# remap stdout
open(STDOUT, ">$root/logs/bootstrap_$sn.log");
open(STDERR, ">>$root/logs/bootstrap_$sn.log");
# setup directories
# TODO: this is ugly
`mkdir -p $source_dir`;
`mkdir -p $prefix`;
#
# per-branch build instructions
#
$abi_log = "$root/logs/abiword_compilation_report_$sn.txt";
$abi_plugin_log = "$root/logs/abiword_plugins_compilation_report_$sn.txt";
if ($sn eq "trunk")
{
# cvs update abiword
`cd $source_dir && svn co $abiword_url abiword`;
# apply the testsuite specific patches to the tree
foreach $patch ( @patches )
{
`cd $source_dir && patch -p0 < $root/patches/$patch-$sn.diff`;
}
# build abiword
my $abiword_cmd = "cd $source_dir/abiword && CXXFLAGS=\"-pg -g\" ./autogen.sh --prefix=$root/$prefix --enable-plugins && make $make_flags 2>$abi_log && make install";
open(ABIWORD_CMD, "$abiword_cmd |");
while (<ABIWORD_CMD>)
{
print $_;
}
close(ABIWORD_CMD);
}
# flush/close the logfile
close(STDOUT);