Changeset 1181 in ProjectBuilder for devel/pb


Ignore:
Timestamp:
Feb 12, 2011, 1:56:42 AM (13 years ago)
Author:
Bruno Cornec
Message:
  • Fix rpmbootstrap and pb newve order, which wasn't working after the latest pbos introduction
  • rpmbootstrap wasn't using the right conf file when launched with sudo is fixed by using the SUDO_USER env. var.
  • pb.conf rbsmirrorsrv now uses pbos var, and is filtered correctly.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/lib/ProjectBuilder/Env.pm

    r1176 r1181  
    5959sub pb_env_init_pbrc {
    6060
    61 $ENV{'PBETC'} = "$ENV{'HOME'}/.pbrc";
     61# if sudo, then get the real id of the user laucnhing the context
     62# to point to the right conf file
     63# Mandatory for rpmbootstrap calls
     64my $dir;
     65
     66if (defined $ENV{'SUDO_USER'}) {
     67    # Home dir is the 8th field in list context
     68    $dir = (getpwnam($ENV{'SUDO_USER'}))[7];
     69} else {
     70    $dir = $ENV{'HOME'};
     71}
     72
     73$ENV{'PBETC'} = "$dir/.pbrc";
    6274
    6375if (! -f $ENV{'PBETC'}) {
Note: See TracChangeset for help on using the changeset viewer.