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

Last change on this file since 610 was 610, checked in by pstorz, on Sep 17, 2002 at 11:50:26 AM

neu

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