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

Last change on this file since 600 was 599, checked in by pstorz, on Sep 5, 2002 at 11:21:58 AM

Ausgaben werden nun formatiert ausgegeben.

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