Changeset 1649 in ProjectBuilder for devel/pb


Ignore:
Timestamp:
Sep 27, 2012, 2:29:27 PM (12 years ago)
Author:
Bruno Cornec
Message:
  • Add support for redhat 6.2 for pb with setupve
File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r1632 r1649  
    2424use File::Copy;
    2525use File::stat;
    26 use File::Temp qw(tempdir);
    2726use File::Find;
    2827use Time::localtime qw(localtime);
     
    22702269    # should use a hash instead...
    22712270    my ($shcmd,$shcmdroot,$cpcmd,$cptarget,$cp2target);
     2271    my $tpdir;
    22722272    if ($cmt =~ /^VE/) {
    22732273        my $tp = pb_path_expand($vepath->{$ENV{'PBPROJ'}});
    2274         my $tpdir = pb_path_expand("$tp/$pbos->{'name'}/$pbos->{'version'}/$pbos->{'arch'}");
     2274        $tpdir = pb_path_expand("$tp/$pbos->{'name'}/$pbos->{'version'}/$pbos->{'arch'}");
    22752275        my ($ptr) = pb_conf_get("vetype");
    22762276        my $vetype = $ptr->{$ENV{'PBPROJ'}};
     
    23422342    # For VE we need to change the owner manually
    23432343    if ($cmt =~ /^VE/) {
    2344         pb_system("$shcmdroot sed -i '/requiretty/d' /etc/sudoers","Removing potential requiretty in sudoers");
     2344        my $res = pb_system("$shcmdroot sed -i '/requiretty/d' /etc/sudoers","Removing potential requiretty in sudoers");
     2345        pb_system("$shcmdroot sed '/requiretty/d' /etc/sudoers > /tmp/sudoers.new ; mv /tmp/sudoers.new $tpdir/tmp/sudoers.new ; $shcmdroot mv /tmp/sudoers.new /etc/sudoers","Removing again potential requiretty in sudoers as sed -i failed") if (($res ne 0) && (-f "$tpdir/etc/sudoers"));
    23452346        pb_system("$shcmd \"sudo $chowncommand -R $mac $tdir\"","Adapt owner in $tdir to $mac");
    23462347    }
     
    25212522    # Keep only the first VM in case many were given
    25222523    if ($v =~ /,/) {
    2523         pb_log(0,"WARNING: pruning to just the first of several vms listed ($v)\n");
     2524        pb_log(0,"WARNING: pruning to just the first of several VM/VE/RMs listed ($v)\n");
    25242525        $v =~ s/,.*//;
    25252526    }
     
    30813082
    30823083# Define mandatory global vars
    3083 our $pbdebug;
    3084 our $pbLOG;
    3085 our $pbsynmsg = "pbscript";
    3086 our $pbdisplaytype = "text";
    3087 our $pblocale = "";
     3084EOF
     3085    my $ppref = "our";
     3086    $ppref = "my" if (($pbos->{'name'} =~ /redhat/) && ($pbos->{'version'} =~ /^6/));
     3087    print SCRIPT << "EOF";
     3088$ppref \$pbdebug;
     3089$ppref \$pbLOG;
     3090$ppref \$pbsynmsg = "pbscript";
     3091$ppref \$pbdisplaytype = "text";
     3092$ppref \$pblocale = "";
     3093EOF
     3094    print SCRIPT << 'EOF';
    30883095pb_log_init($pbdebug, $pbLOG);
    30893096EOF
Note: See TracChangeset for help on using the changeset viewer.