Changeset 623


Ignore:
Timestamp:
Oct 16, 2002, 8:08:34 PM (22 years ago)
Author:
joergs
Message:

build of src.rpm (without extracting into directory)

File:
1 edited

Legend:

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

    r619 r623  
    22# automatisches buildskript fuer smartclient
    33# liest die konfiguration aus der mit -b übergebenen Datei
    4 # $Id: buildall.pl,v 1.14 2002/10/10 15:01:08 joergs Exp $
     4# $Id: buildall.pl,v 1.15 2002/10/16 18:08:34 joergs Exp $
    55# Philipp Storz, SuSE Linux AG
    66# pstorz@suse.de
     7
    78use Getopt::Std;
     9use File::stat;
     10use File::Basename;
    811
    912
     
    5962    write;
    6063  }
    61 print "\n\n\nATTENTION: the srpms from the directory external/SuSE and external/cpan must have been extracted before!\n";
    62 print "To build srpms execute the extract_srpm.sh script in either directory!\n\n\n";
     64
    6365print 'Are all the srpms extracted and all options OK? (y/n)';
    6466
     
    8789  tr/\//\_/;
    8890  $logfilename = $_.".$ArrayofBuilds[$i][1].log";
     91
     92
     93  my $build_log="| tee $logfilename";
     94  my $build_cmd="cd $mypath && $build";
     95
     96  # open a xterm to display build output
     97  if ($opt_x)
     98  {
     99  system "xterm -T \"build log for PACKET: $mypath    ARCH:$ArrayofBuilds[$i][1] \" -e less +F $workdir/$mypath/$logfilename &";
    89100  print "++++++++++++++++++++++++++++++++++++++++++\n";
    90   print "executing command: cd $mypath; $build 2>&1 > $logfilename\n";
     101  $build_log=">$logfilename 2>&1";
     102  }
     103
     104  # if mypath is not a directory, so it is a src.rpm (hopefully)
     105  if( ! -d $mypath ) {
     106    my $base    = basename($mypath);
     107    my $dir     = dirname($mypath);
     108        $build_cmd      = "cd $dir && $build $base-*rpm";
     109  }
     110
     111  print "++++++++++++++++++++++++++++++++++++++++++\n";
    91112  print "BUILD_DIST ist $ENV{'BUILD_DIST'}\n";
    92113  print "BUILD_MODE ist $ENV{'BUILD_MODE'}\n";
    93  
    94   print "writing logfile to $logfilename \n\n\n";
     114  print "executing build command:\n";
     115  print "$build_cmd $build_log\n";
    95116  print "you can watch building with following command: \n";
    96117  $workdir=`pwd`;
    97118  chomp $workdir;
    98   print "less +F $workdir/$mypath/$logfilename\n";
     119  print "less +F $workdir/$mypath/$logfilename\n\n";
    99120
     121  $retval = system "$build_cmd $build_log";
    100122
    101 if ($opt_x)
    102   {
    103   system "xterm -T \"build log for PACKET: $mypath    ARCH:$ArrayofBuilds[$i][1] \" -e less +F $workdir/$mypath/$logfilename &";
    104   print "++++++++++++++++++++++++++++++++++++++++++\n";
    105   $retval = system "cd $mypath && $build >$logfilename 2>&1";
    106   }
    107   else
    108   {
    109     $retval = system "cd $mypath && $build | tee $logfilename";
    110   }
    111 
    112 
    113  if ($retval == 0)
     123  if ( $retval == 0 )
    114124   {
    115125     $ArrayofBuilds[$i][3]= "SUCCESS $ArrayofBuilds[$i][0]: OK";
     
    118128     print"******                                                      ******\n";
    119129   }
    120  else
     130  else
    121131   {
    122132     $ArrayofBuilds[$i][3]="ERROR  $ArrayofBuilds[$i][0]: *FAILED*\n";
     
    125135     print"******                                                      ******\n";
    126136   }
    127 
    128137}
    129138
     
    145154  }
    146155
    147 
    148 
    149 
    150156print "buildall.pl terminated\n";
Note: See TracChangeset for help on using the changeset viewer.