source: trunk/technical/common/build/buildall.pl@ 593

Last change on this file since 593 was 593, checked in by pstorz, on Sep 4, 2002 at 1:36:19 PM

Abfrage geändert

File size: 2.3 KB
RevLine 
[589]1#!/usr/bin/perl -w
2# automatisches buildskript fuer smartclient
3# liest die konfiguration aus der mit -b übergebenen Datei
[593]4# $Id: buildall.pl,v 1.2 2002/09/04 11:36:19 pstorz Exp $
[589]5use Getopt::Std;
6
7# Programmoptionen: -b (buildlist)
8
9my $smartclient_root="../../"; # Pfad, zu dem die Pfade in buildlist stehen
10my $build = "/home/pstorz/bin/build.sh";
11our ($opt_b);
12my @ArrayofBuilds;
13getopts('b:');
14
[593]15if (!$opt_b)
16{die "usage: buildall.pl -b buildlist\n";
17};
18
[589]19(open(BUILDLIST,$opt_b)) || die "Die Buildlist $opt_b konnte nicht gefunden werden";
20
21
22while (<BUILDLIST>) #Buildlist parsen
23 {
24 next if (/^\#.*$/);
[593]25# if (/([\w\/]+)\s*:([\/\w\-\+\.]+)\s+:((\s*\-\-\w*)*)$/)
26 if (/(\S+)\s*:(\S+)\s*:(\S+)\s*$/)
[589]27 {
28 ($dir, $arch, $opt) = ($1, $2, $3);
29 chomp ($arch);
30 @build=($dir, $arch, $opt);
31 push @ArrayofBuilds, [@build];
32 }
33 }
34
[593]35
36
37print "What will be done:\n";
38print "Path\tDistribution\tBuildoptions\n";
[589]39for $i (0 .. $#ArrayofBuilds)
40 {
[593]41 print("$ArrayofBuilds[$i][0]\t\t$ArrayofBuilds[$i][1]\t\t$ArrayofBuilds[$i][2]\n");
42 }
43print "\n\n\n ATTENTION: the srpms from the directory external/SuSE must be built before!\n";
44print "to build srpms, goto dir external/SuSE, execute build_srpms.sh script!\n\n\n";
45print 'Are the srpms built and all options OK? (y/n)';
46
47$answer =<STDIN>;
48chomp ($answer);
49if ($answer ne "y") {die("canceled")};
50
51for $i (0 .. $#ArrayofBuilds)
52 {
53 print("$ArrayofBuilds[$i][0]\t\t$ArrayofBuilds[$i][1]\t\t$ArrayofBuilds[$i][2]\n");
[589]54 $mypath = $smartclient_root.$ArrayofBuilds[$i][0];
55
56 if ($ArrayofBuilds[$i][2])
57 {
58 $ENV{'BUILD_MODE'}=$ArrayofBuilds[$i][2];
59 }
60 else
61 {
62 $ENV{'BUILD_MODE'}="--clean";
63 }
64 $ENV{'BUILD_DIST'}=$ArrayofBuilds[$i][1];
[593]65 $ENV{'BUILD_DIST'}=$ArrayofBuilds[$i][1];
66
[589]67# system "./test.sh";
68 $_=$ArrayofBuilds[$i][0];
69 print "$_ \n";
70 tr/\//\_/;
[593]71 $logfilename = $_.".$ArrayofBuilds[$i][1].log";
[589]72 print "++++++++++++++++++++++++++++++++++++++++++\n";
73 print "executing command: cd $mypath; $build 2>&1 |tee $logfilename\n";
74 print "BUILD_DIST ist $ENV{'BUILD_DIST'}\n";
75 print "BUILD_MODE ist $ENV{'BUILD_MODE'}\n";
[593]76
[589]77 print "writing logfile to $logfilename \n";
78 print "++++++++++++++++++++++++++++++++++++++++++\n";
79# system "cd $mypath; $build 2>&1 > $logfilename;"
80 system "cd $mypath; $build 2>&1 |tee $logfilename;"
81}
82
83print "buildall.pl terminated\n";
84
85
86
Note: See TracBrowser for help on using the repository browser.