Changeset 1352 in ProjectBuilder for devel/pb-modules/lib/ProjectBuilder/VE.pm


Ignore:
Timestamp:
Oct 30, 2011, 10:36:43 AM (13 years ago)
Author:
Bruno Cornec
Message:

r4384@localhost: bruno | 2011-10-30 01:28:14 +0200

  • Change pb_ve_launch interface (remove useless second parameter)
  • Force call to pb_ve_launch with pbforce to always create the chroot in pbmkbm
File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb-modules/lib/ProjectBuilder/VE.pm

    r1350 r1352  
    6262
    6363my $v = shift || undef;
    64 my $create = shift || 0;        # By default do not create a VM/VE/RM
    6564my $pbforce = shift || 0;       # By default do not rebuild VE
    6665my $pbsnap = shift || 0;        # By default do not snap VE
     
    7372my $vetype = $ptr->{$ENV{'PBPROJ'}};
    7473
    75 # We can probably only get those params now we have the distro context
    76 my ($rbsb4pi,$rbspi,$vesnap,$oscodename,$osmindep,$verebuild,$rbsmirrorsrv) = pb_conf_get_if("rbsb4pi","rbspi","vesnap","oscodename","osmindep","verebuild","rbsmirrorsrv");
    77 
    78 # We need to avoid umask propagation to the VE
    79 umask 0022;
    80 
    81 # If we are already root (from pbmkbm e.g.) don't use sudo, just call the command
    82 my $sudocmd="";
    83 $sudocmd ="sudo " if ($EFFECTIVE_USER_ID != 0);
    84 
    85 my $arch = pb_get_arch();
    86 
    8774if (($vetype eq "chroot") || ($vetype eq "schroot")) {
     75
     76    # We need to avoid umask propagation to the VE
     77    umask 0022;
     78
     79    # We can probably only get those params now we have the distro context
     80    my ($rbsb4pi,$rbspi,$vesnap,$oscodename,$osmindep,$verebuild,$rbsmirrorsrv) = pb_conf_get_if("rbsb4pi","rbspi","vesnap","oscodename","osmindep","verebuild","rbsmirrorsrv");
     81
    8882    # Architecture consistency
     83    my $arch = pb_get_arch();
    8984    if ($arch ne $pbos->{'arch'}) {
    9085        die "Unable to launch a VE of architecture $pbos->{'arch'} on a $arch platform" if (($pbos->{'arch'} eq "x86_64") && ($arch =~ /i?86/));
    9186    }
    9287
    93     my ($verpmtype,$vedebtype) = pb_conf_get("verpmtype","vedebtype");
    94     if (($create != 0) || ((defined $verebuild) && ($verebuild->{$ENV{'PBPROJ'}} =~ /true/i)) || ($pbforce == 1)) {
    95     my ($rbsopt1) = pb_conf_get_if("rbsopt");
     88    # If we are already root (from pbmkbm e.g.) don't use sudo, just call the command
     89    my $sudocmd="";
     90    $sudocmd ="sudo " if ($EFFECTIVE_USER_ID != 0);
     91
     92    if (((defined $verebuild) && ($verebuild->{$ENV{'PBPROJ'}} =~ /true/i)) || ($pbforce == 1)) {
     93        my ($verpmtype,$vedebtype) = pb_conf_get("verpmtype","vedebtype");
     94        my ($rbsopt1) = pb_conf_get_if("rbsopt");
    9695
    9796        # We have to rebuild the chroot
Note: See TracChangeset for help on using the changeset viewer.