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

Last change on this file since 620 was 619, checked in by joergs, on Oct 10, 2002 at 5:01:08 PM

Bugfixing: Pfade, return code, Anpassungen an 8.1

File size: 4.0 KB
RevLine 
[589]1#!/usr/bin/perl -w
2# automatisches buildskript fuer smartclient
3# liest die konfiguration aus der mit -b übergebenen Datei
[619]4# $Id: buildall.pl,v 1.14 2002/10/10 15:01:08 joergs Exp $
[601]5# Philipp Storz, SuSE Linux AG
6# pstorz@suse.de
[589]7use Getopt::Std;
8
[599]9
10format TABELLE =
11@<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
12$wert1, $wert2, $wert3
13.
14
15
[589]16# Programmoptionen: -b (buildlist)
17
18my $smartclient_root="../../"; # Pfad, zu dem die Pfade in buildlist stehen
[594]19my $build = "build.sh";
[589]20our ($opt_b);
21my @ArrayofBuilds;
22getopts('b:');
23
[610]24
[593]25if (!$opt_b)
[610]26{
27$opt_b = "buildlist";
28print "using default buildlist: buildlist\n\n";
29print "other buildlist can be specified with -b buildlist\n\n";
[593]30};
31
[589]32(open(BUILDLIST,$opt_b)) || die "Die Buildlist $opt_b konnte nicht gefunden werden";
33
34
35while (<BUILDLIST>) #Buildlist parsen
36 {
37 next if (/^\#.*$/);
[593]38# if (/([\w\/]+)\s*:([\/\w\-\+\.]+)\s+:((\s*\-\-\w*)*)$/)
39 if (/(\S+)\s*:(\S+)\s*:(\S+)\s*$/)
[589]40 {
41 ($dir, $arch, $opt) = ($1, $2, $3);
42 chomp ($arch);
43 @build=($dir, $arch, $opt);
44 push @ArrayofBuilds, [@build];
45 }
46 }
47
[593]48
49
[599]50print "What will be done:\n\n";
51($wert1,$wert2,$wert3)= ("Path","Distribuition","Buildoptions");
52$~="TABELLE";
53write;
54print "\n";
[589]55for $i (0 .. $#ArrayofBuilds)
56 {
[599]57 ($wert1,$wert2,$wert3)= ($ArrayofBuilds[$i][0],$ArrayofBuilds[$i][1],$ArrayofBuilds[$i][2]);
58 $~="TABELLE";
59 write;
[593]60 }
[616]61print "\n\n\nATTENTION: the srpms from the directory external/SuSE and external/cpan must have been extracted before!\n";
62print "To build srpms execute the extract_srpm.sh script in either directory!\n\n\n";
[612]63print 'Are all the srpms extracted and all options OK? (y/n)';
[593]64
65$answer =<STDIN>;
66chomp ($answer);
67if ($answer ne "y") {die("canceled")};
68
69for $i (0 .. $#ArrayofBuilds)
70 {
71 print("$ArrayofBuilds[$i][0]\t\t$ArrayofBuilds[$i][1]\t\t$ArrayofBuilds[$i][2]\n");
[589]72 $mypath = $smartclient_root.$ArrayofBuilds[$i][0];
73
74 if ($ArrayofBuilds[$i][2])
75 {
76 $ENV{'BUILD_MODE'}=$ArrayofBuilds[$i][2];
77 }
78 else
79 {
80 $ENV{'BUILD_MODE'}="--clean";
81 }
82 $ENV{'BUILD_DIST'}=$ArrayofBuilds[$i][1];
[596]83
[593]84
[589]85 $_=$ArrayofBuilds[$i][0];
86 print "$_ \n";
87 tr/\//\_/;
[593]88 $logfilename = $_.".$ArrayofBuilds[$i][1].log";
[589]89 print "++++++++++++++++++++++++++++++++++++++++++\n";
[596]90 print "executing command: cd $mypath; $build 2>&1 > $logfilename\n";
[589]91 print "BUILD_DIST ist $ENV{'BUILD_DIST'}\n";
92 print "BUILD_MODE ist $ENV{'BUILD_MODE'}\n";
[593]93
[596]94 print "writing logfile to $logfilename \n\n\n";
95 print "you can watch building with following command: \n";
96 $workdir=`pwd`;
97 chomp $workdir;
98 print "less +F $workdir/$mypath/$logfilename\n";
[611]99
100
101if ($opt_x)
102 {
[596]103 system "xterm -T \"build log for PACKET: $mypath ARCH:$ArrayofBuilds[$i][1] \" -e less +F $workdir/$mypath/$logfilename &";
[589]104 print "++++++++++++++++++++++++++++++++++++++++++\n";
[619]105 $retval = system "cd $mypath && $build >$logfilename 2>&1";
[611]106 }
107 else
108 {
[619]109 $retval = system "cd $mypath && $build | tee $logfilename";
[611]110 }
111
112
[596]113 if ($retval == 0)
114 {
[619]115 $ArrayofBuilds[$i][3]= "SUCCESS $ArrayofBuilds[$i][0]: OK";
[596]116 print"****** ******\n";
[612]117 print"****** building of $ArrayofBuilds[$i][0]: OK \n" ;
[596]118 print"****** ******\n";
119 }
120 else
121 {
[612]122 $ArrayofBuilds[$i][3]="ERROR $ArrayofBuilds[$i][0]: *FAILED*\n";
[596]123 print"****** ******\n";
[612]124 print"\n\n\nERROR: building of $ArrayofBuilds[$i][0]: *FAILED*\n";
[596]125 print"****** ******\n";
126 }
127
[589]128}
129
[596]130print "Building results:\n";
131
[599]132
133
134($wert1,$wert2,$wert3)= ("Path","Distribuition","Result");
135$~="TABELLE";
136write;
137print "\n";
138
[596]139for $i (0 .. $#ArrayofBuilds)
140 {
[599]141 ($wert1,$wert2,$wert3)= ($ArrayofBuilds[$i][0],$ArrayofBuilds[$i][1],$ArrayofBuilds[$i][3]);
142 $~="TABELLE";
143 write;
[619]144 # print("$ArrayofBuilds[$i][0]:Result: $ArrayofBuilds[$i][3]");
[596]145 }
146
147
148
149
[589]150print "buildall.pl terminated\n";
Note: See TracBrowser for help on using the repository browser.