Changeset 626 for trunk/technical/common/build
- Timestamp:
- Oct 17, 2002, 3:12:57 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/technical/common/build/buildall.pl
r623 r626 2 2 # automatisches buildskript fuer smartclient 3 3 # liest die konfiguration aus der mit -b übergebenen Datei 4 # $Id: buildall.pl,v 1.1 5 2002/10/16 18:08:34joergs Exp $4 # $Id: buildall.pl,v 1.16 2002/10/17 13:12:57 joergs Exp $ 5 5 # Philipp Storz, SuSE Linux AG 6 6 # pstorz@suse.de 7 7 8 use strict; 8 9 use Getopt::Std; 9 10 use File::stat; 10 11 use File::Basename; 11 12 13 my $wert1; 14 my $wert2; 15 my $wert3; 12 16 13 17 format TABELLE = … … 17 21 18 22 19 # Programmoptionen: -b (buildlist) 23 # Programmoptionen: 24 # -b (buildlist) 25 # -x (buildlog im seperaten xtern 26 27 my $workdir=`pwd`; 28 chomp $workdir; 20 29 21 30 my $smartclient_root="../../"; # Pfad, zu dem die Pfade in buildlist stehen 22 31 my $build = "build.sh"; 23 our ($opt_b );32 our ($opt_b, $opt_x); 24 33 my @ArrayofBuilds; 25 getopts('b: ');34 getopts('b:x'); 26 35 27 36 … … 38 47 while (<BUILDLIST>) #Buildlist parsen 39 48 { 49 my $dir; 50 my $arch; 51 my $opt; 40 52 next if (/^\#.*$/); 41 #if (/([\w\/]+)\s*:([\/\w\-\+\.]+)\s+:((\s*\-\-\w*)*)$/)53 # if (/([\w\/]+)\s*:([\/\w\-\+\.]+)\s+:((\s*\-\-\w*)*)$/) 42 54 if (/(\S+)\s*:(\S+)\s*:(\S+)\s*$/) 43 55 { 44 56 ($dir, $arch, $opt) = ($1, $2, $3); 45 57 chomp ($arch); 46 @build=($dir, $arch, $opt);58 my @build=($dir, $arch, $opt); 47 59 push @ArrayofBuilds, [@build]; 48 60 } … … 56 68 write; 57 69 print "\n"; 58 for $i (0 .. $#ArrayofBuilds)70 for my $i (0 .. $#ArrayofBuilds) 59 71 { 60 72 ($wert1,$wert2,$wert3)= ($ArrayofBuilds[$i][0],$ArrayofBuilds[$i][1],$ArrayofBuilds[$i][2]); … … 65 77 print 'Are all the srpms extracted and all options OK? (y/n)'; 66 78 67 $answer=<STDIN>;79 my $answer=<STDIN>; 68 80 chomp ($answer); 69 81 if ($answer ne "y") {die("canceled")}; 70 82 71 for $i (0 .. $#ArrayofBuilds) 83 my $mypath; 84 for my $i (0 .. $#ArrayofBuilds) 72 85 { 73 86 print("$ArrayofBuilds[$i][0]\t\t$ArrayofBuilds[$i][1]\t\t$ArrayofBuilds[$i][2]\n"); … … 88 101 print "$_ \n"; 89 102 tr/\//\_/; 90 $logfilename = $_.".$ArrayofBuilds[$i][1].log";103 my $logfilename = "$workdir/$mypath/$_.$ArrayofBuilds[$i][1].log"; 91 104 92 93 my $build_log="| tee $logfilename";94 105 my $build_cmd="cd $mypath && $build"; 95 106 … … 97 108 if ($opt_x) 98 109 { 99 system "xterm -T \"build log for PACKET: $mypath ARCH:$ArrayofBuilds[$i][1] \" -e less +F $workdir/$mypath/$logfilename &"; 100 print "++++++++++++++++++++++++++++++++++++++++++\n"; 101 $build_log=">$logfilename 2>&1"; 110 system "xterm -T \"build log for PACKET: $mypath ARCH:$ArrayofBuilds[$i][1] \" -e less +F $logfilename &"; 111 print "++++++++++++++++++++++++++++++++++++++++++\n"; 102 112 } 103 113 … … 106 116 my $base = basename($mypath); 107 117 my $dir = dirname($mypath); 108 $build_cmd = "cd $dir && $build $base- *rpm";118 $build_cmd = "cd $dir && $build $base-[0-9]*rpm"; 109 119 } 110 120 … … 113 123 print "BUILD_MODE ist $ENV{'BUILD_MODE'}\n"; 114 124 print "executing build command:\n"; 115 print "$build_cmd $build_log\n";125 print "$build_cmd\n"; 116 126 print "you can watch building with following command: \n"; 117 $workdir=`pwd`; 118 chomp $workdir; 119 print "less +F $workdir/$mypath/$logfilename\n\n"; 127 print "less +F $logfilename\n\n"; 120 128 121 $retval = system "$build_cmd $build_log"; 122 129 open( LOG_FD, ">$logfilename" ); 130 open( PIPE, "$build_cmd 2>&1 |" ); 131 while( <PIPE> ) { 132 if( ! $opt_x ) { 133 print; 134 } 135 print LOG_FD; 136 } 137 close PIPE; my $retval=$?; 138 close LOG_FD; 139 123 140 if ( $retval == 0 ) 124 141 { … … 146 163 print "\n"; 147 164 148 for $i (0 .. $#ArrayofBuilds)165 for my $i (0 .. $#ArrayofBuilds) 149 166 { 150 167 ($wert1,$wert2,$wert3)= ($ArrayofBuilds[$i][0],$ArrayofBuilds[$i][1],$ArrayofBuilds[$i][3]);
Note:
See TracChangeset
for help on using the changeset viewer.