Ignore:
Timestamp:
Oct 17, 2002, 3:12:57 PM (22 years ago)
Author:
joergs
Message:

jetzt richtige Zusammenfassung.
Cleanup.
use strict

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/technical/common/build/buildall.pl

    r623 r626  
    22# automatisches buildskript fuer smartclient
    33# liest die konfiguration aus der mit -b übergebenen Datei
    4 # $Id: buildall.pl,v 1.15 2002/10/16 18:08:34 joergs Exp $
     4# $Id: buildall.pl,v 1.16 2002/10/17 13:12:57 joergs Exp $
    55# Philipp Storz, SuSE Linux AG
    66# pstorz@suse.de
    77
     8use strict;
    89use Getopt::Std;
    910use File::stat;
    1011use File::Basename;
    1112
     13my $wert1;
     14my $wert2;
     15my $wert3;
    1216
    1317format TABELLE =
     
    1721
    1822
    19 # Programmoptionen: -b (buildlist)
     23# Programmoptionen:
     24#       -b (buildlist)
     25#       -x (buildlog im seperaten xtern
     26
     27my $workdir=`pwd`;
     28chomp $workdir;
    2029
    2130my $smartclient_root="../../";   # Pfad, zu dem die Pfade in buildlist stehen
    2231my $build = "build.sh";
    23 our ($opt_b);
     32our ($opt_b, $opt_x);
    2433my @ArrayofBuilds;
    25 getopts('b:');
     34getopts('b:x');
    2635
    2736
     
    3847while (<BUILDLIST>) #Buildlist parsen
    3948  {
     49        my $dir;
     50        my $arch;
     51        my $opt;
    4052    next if (/^\#.*$/);
    41 #    if (/([\w\/]+)\s*:([\/\w\-\+\.]+)\s+:((\s*\-\-\w*)*)$/)
     53        # if (/([\w\/]+)\s*:([\/\w\-\+\.]+)\s+:((\s*\-\-\w*)*)$/)
    4254    if (/(\S+)\s*:(\S+)\s*:(\S+)\s*$/)
    4355      {
    4456        ($dir, $arch, $opt) = ($1, $2, $3);
    4557        chomp ($arch);
    46         @build=($dir, $arch, $opt);
     58        my @build=($dir, $arch, $opt);
    4759        push @ArrayofBuilds, [@build];
    4860      }
     
    5668write;
    5769print "\n";
    58 for $i (0 .. $#ArrayofBuilds)
     70for my $i (0 .. $#ArrayofBuilds)
    5971  {
    6072    ($wert1,$wert2,$wert3)= ($ArrayofBuilds[$i][0],$ArrayofBuilds[$i][1],$ArrayofBuilds[$i][2]);
     
    6577print 'Are all the srpms extracted and all options OK? (y/n)';
    6678
    67 $answer =<STDIN>;
     79my $answer=<STDIN>;
    6880chomp ($answer);
    6981if ($answer ne "y") {die("canceled")};
    7082
    71 for $i (0 .. $#ArrayofBuilds)
     83my $mypath;
     84for my $i (0 .. $#ArrayofBuilds)
    7285  {
    7386  print("$ArrayofBuilds[$i][0]\t\t$ArrayofBuilds[$i][1]\t\t$ArrayofBuilds[$i][2]\n");
     
    88101  print "$_ \n";
    89102  tr/\//\_/;
    90   $logfilename = $_.".$ArrayofBuilds[$i][1].log";
     103  my $logfilename = "$workdir/$mypath/$_.$ArrayofBuilds[$i][1].log";
    91104
    92 
    93   my $build_log="| tee $logfilename";
    94105  my $build_cmd="cd $mypath && $build";
    95106
     
    97108  if ($opt_x)
    98109  {
    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";
    102112  }
    103113
     
    106116    my $base    = basename($mypath);
    107117    my $dir     = dirname($mypath);
    108         $build_cmd      = "cd $dir && $build $base-*rpm";
     118        $build_cmd      = "cd $dir && $build $base-[0-9]*rpm";
    109119  }
    110120
     
    113123  print "BUILD_MODE ist $ENV{'BUILD_MODE'}\n";
    114124  print "executing build command:\n";
    115   print "$build_cmd $build_log\n";
     125  print "$build_cmd\n";
    116126  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";
    120128
    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 
    123140  if ( $retval == 0 )
    124141   {
     
    146163print "\n";
    147164
    148 for $i (0 .. $#ArrayofBuilds)
     165for my $i (0 .. $#ArrayofBuilds)
    149166  {
    150167    ($wert1,$wert2,$wert3)= ($ArrayofBuilds[$i][0],$ArrayofBuilds[$i][1],$ArrayofBuilds[$i][3]);
Note: See TracChangeset for help on using the changeset viewer.