Changeset 2287


Ignore:
Timestamp:
Sep 4, 2017, 1:21:18 PM (3 months ago)
Author:
bruno
Message:

Fix usage of labels in env var (normalize with 'LABEL'

Location:
devel
Files:
10 edited

Legend:

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

    r2270 r2287  
    578578=item B<pb_path_expand>
    579579
    580 Expand out a path by environment variables as ($ENV{XXX}) and ~
     580Expand out a path by environment variables as ($ENV{'ENVVAR'}) and ~
    581581
    582582=cut
     
    587587
    588588eval { $path =~ s/(\$ENV.+\})/$1/eeg; };
    589 $path =~ s/^\~/$ENV{HOME}/;
     589$path =~ s/^\~/$ENV{'HOME'}/;
    590590
    591591return($path);
  • devel/pb-modules/lib/ProjectBuilder/Distribution.pm

    r2279 r2287  
    333333
    334334# We do not overwrite shell settings
    335 $ENV{ftp_proxy} ||= $ftp_proxy if ((defined $ftp_proxy) && ($ftp_proxy ne ""));
    336 $ENV{http_proxy} ||= $http_proxy if ((defined $http_proxy) && ($http_proxy ne ""));
    337 $ENV{https_proxy} ||= $https_proxy if ((defined $https_proxy) && ($https_proxy ne ""));
     335$ENV{'ftp_proxy'} ||= $ftp_proxy if ((defined $ftp_proxy) && ($ftp_proxy ne ""));
     336$ENV{'http_proxy'} ||= $http_proxy if ((defined $http_proxy) && ($http_proxy ne ""));
     337$ENV{'https_proxy'} ||= $https_proxy if ((defined $https_proxy) && ($https_proxy ne ""));
    338338}
    339339
     
    358358confess "Missing install command for $pbos->{name}-$pbos->{version}-$pbos->{arch}" unless (defined $pbos->{install} && $pbos->{install} =~ /\w/);
    359359pb_apply_conf_proxy($pbos);
    360 pb_log(1, "ftp_proxy=$ENV{ftp_proxy}\n") if (defined $ENV{ftp_proxy});
    361 pb_log(1, "http_proxy=$ENV{http_proxy}\n")  if (defined $ENV{http_proxy});
    362 pb_log(1, "https_proxy=$ENV{https_proxy}\n")  if (defined $ENV{https_proxy});
     360pb_log(1, "ftp_proxy=$ENV{'ftp_proxy'}\n") if (defined $ENV{'ftp_proxy'});
     361pb_log(1, "http_proxy=$ENV{'http_proxy'}\n")  if (defined $ENV{'http_proxy'});
     362pb_log(1, "https_proxy=$ENV{'https_proxy'}\n")  if (defined $ENV{'https_proxy'});
    363363
    364364# Get dependencies in the build file if not forced
     
    497497my $deps2 = "";
    498498# Avoid to install what is already there
    499 delete $ENV{COLUMNS};
     499delete $ENV{'COLUMNS'};
    500500foreach my $p (split(/\s+/,$deps)) {
    501501    next if $p =~ /^\s*$/o;
  • devel/pb-modules/lib/ProjectBuilder/Env.pm

    r2284 r2287  
    274274}
    275275# Expand potential env variable in it
    276 $ENV{PBDEFDIR} = pb_path_expand($ENV{PBDEFDIR});
     276$ENV{'PBDEFDIR'} = pb_path_expand($ENV{'PBDEFDIR'});
    277277pb_log(1,"PBDEFDIR: $ENV{'PBDEFDIR'}\n");
    278278
     
    293293    }
    294294}
    295 $ENV{PBPROJDIR} = pb_path_expand($ENV{PBPROJDIR});
     295$ENV{'PBPROJDIR'} = pb_path_expand($ENV{'PBPROJDIR'});
    296296
    297297my $pbconfpath = "$ENV{'PBDEFDIR'}/$ENV{'PBPROJ'}";
  • devel/pb-modules/lib/ProjectBuilder/VE.pm

    r2234 r2287  
    110110$sudocmd = "setarch i386 $sudocmd" if (($pbos->{'arch'} =~ /i[3456]86/) && ($arch eq 'x86_64'));
    111111
    112 my $root = pb_path_expand($vepath->{$ENV{PBPROJ}});
     112my $root = pb_path_expand($vepath->{$ENV{'PBPROJ'}});
    113113   
    114114if (($vetype eq "chroot") || ($vetype eq "schroot") || ($vetype eq "docker")) {
     
    132132            # Which tool is used
    133133            my $verpmstyle = $verpmtype->{$ENV{'PBPROJ'}};
    134             die "No verpmtype defined for $ENV{PBPROJ}" unless (defined $verpmstyle);
     134            die "No verpmtype defined for $ENV{'PBPROJ'}" unless (defined $verpmstyle);
    135135   
    136136            # Get potential rbs option
     
    306306            print DOCKER "FROM $pbimage\n";
    307307            print DOCKER "MAINTAINER project-builder.org aka pb\n";
    308             print DOCKER "ENV ftp_proxy $ENV{ftp_proxy}\n" if (defined $ENV{ftp_proxy});
    309             print DOCKER "ENV http_proxy $ENV{http_proxy}\n" if (defined $ENV{http_proxy});
    310             print DOCKER "ENV https_proxy $ENV{https_proxy}\n" if (defined $ENV{https_proxy});
     308            print DOCKER "ENV ftp_proxy $ENV{'ftp_proxy'}\n" if (defined $ENV{'ftp_proxy'});
     309            print DOCKER "ENV http_proxy $ENV{'http_proxy'}\n" if (defined $ENV{'http_proxy'});
     310            print DOCKER "ENV https_proxy $ENV{'https_proxy'}\n" if (defined $ENV{'https_proxy'});
    311311            # We are root in that container so no need to sudo, which is present potentially
    312312            my $cmd2 = $pbos->{'install'};
     
    410410    $vetype = $ptr->{$ENV{'PBPROJ'}};
    411411}
    412 confess "No vetype defined for $ENV{PBPROJ}" unless (defined $vetype);
    413 pb_log(1, "Using vetype $vetype for $ENV{PBPROJ}\n");
     412confess "No vetype defined for $ENV{'PBPROJ'}" unless (defined $vetype);
     413pb_log(1, "Using vetype $vetype for $ENV{'PBPROJ'}\n");
    414414return($vetype);
    415415}
  • devel/pb-server/lib/ProjectBuilder.pm

    r2077 r2287  
    88
    99  # Configuration
    10   #$self->secrets([split /:/, $ENV{BLOG_SECRETS} || 'super:s3cret']);
     10  #$self->secrets([split /:/, $ENV{'BLOG_SECRETS'} || 'super:s3cret']);
    1111
    1212  # Model
    13   #$self->helper(pg => sub { state $pg = Mojo::Pg->new($ENV{BLOG_PG_URL}) });
     13  #$self->helper(pg => sub { state $pg = Mojo::Pg->new($ENV{'BLOG_PG_URL'}) });
    1414  $self->helper(confs => sub { state $confs = ProjectBuilder::Model::Confs->new() });
    1515
  • devel/pb/bin/pb

    r2286 r2287  
    549549
    550550 pbconfurl I<project> = file:///home/anderse/.git/project-builder-config/I<project>
    551  pbdefdir default = $ENV{HOME}/cache-project-builder
     551 pbdefdir default = $ENV{'HOME'}/cache-project-builder
    552552
    553553The first line defines the version controlled configuration information and the second defines the root directory for project-builder to use.
     
    622622
    623623  vepath:
    624     default: $ENV{HOME}/cache-project-builder/chroot
     624    default: $ENV{'HOME'}/cache-project-builder/chroot
    625625  velist:
    626626    default: debian-6.0-i386
     
    22682268        my ($gpgaddkey) = pb_conf_get_if("pbadditionalgpg");
    22692269        my $pbadditionalgpg;
    2270         $pbadditionalgpg = $gpgaddkey->{$ENV{PBPROJ}} if (defined $gpgaddkey);
     2270        $pbadditionalgpg = $gpgaddkey->{$ENV{'PBPROJ'}} if (defined $gpgaddkey);
    22712271        if (defined $pbadditionalgpg) {
    22722272            foreach my $k (split(/,/,$pbadditionalgpg)) {
     
    22892289    $delivery->{$ENV{'PBPROJ'}} = "" if (not defined $delivery->{$ENV{'PBPROJ'}});
    22902290    my ($sshlogin,$sshport) = pb_conf_get_if($login,$port);
    2291     $sshport->{$ENV{PBPROJ}} = 22 if (not defined $sshport->{$ENV{PBPROJ}});
    2292     $sshlogin->{$ENV{PBPROJ}} = getpwuid($UID) if (not defined $sshlogin->{$ENV{PBPROJ}});
     2291    $sshport->{$ENV{'PBPROJ'}} = 22 if (not defined $sshport->{$ENV{'PBPROJ'}});
     2292    $sshlogin->{$ENV{'PBPROJ'}} = getpwuid($UID) if (not defined $sshlogin->{$ENV{'PBPROJ'}});
    22932293    my ($vtmout,$vepath);
    22942294    # ...Except those in virtual context
     
    23652365            my ($gpgcheck) = pb_conf_get_if("pbgpgcheck");
    23662366            my $pbgpgcheck;
    2367             $pbgpgcheck = $gpgcheck->{$ENV{PBPROJ}} if (defined $gpgcheck);
     2367            $pbgpgcheck = $gpgcheck->{$ENV{'PBPROJ'}} if (defined $gpgcheck);
    23682368            my $pbgpgkey = "$pbrepo->{$ENV{'PBPROJ'}}/$repodir/$ENV{'PBPROJ'}.pubkey";
    23692369            my ($gpgaddpkey) = pb_conf_get_if("pbadditionalgpg");
    23702370            my $pbadditionalgpg;
    2371             $pbadditionalgpg = $gpgaddpkey->{$ENV{PBPROJ}} if (defined $gpgaddpkey);
     2371            $pbadditionalgpg = $gpgaddpkey->{$ENV{'PBPROJ'}} if (defined $gpgaddpkey);
    23722372            if (defined $pbadditionalgpg) {
    23732373                foreach my $k (split(/,/,$pbadditionalgpg)) {
     
    46234623    my $dbh = pb_connect_db();
    46244624    # For date handling
    4625     $ENV{LANGUAGE}="C";
     4625    $ENV{'LANGUAGE'}="C";
    46264626    my $firstjan = strftime("%Y-%m-%d", 0, 0, 0, 1, 0, localtime->year(), 0, 0, -1);
    46274627    my $oldfirst = strftime("%Y-%m-%d", 0, 0, 0, 1, 0, localtime->year()-1, 0, 0, -1);
     
    50995099    my $changes = "";
    51005100    foreach my $c (split(/ /,$made)) {
    5101         $changes .= " $ENV{'PBBUILDDIR'}/$c" if (($c =~ /\.changes$/) && (-f "$ENV{PBBUILDDIR}/$c"));
     5101        $changes .= " $ENV{'PBBUILDDIR'}/$c" if (($c =~ /\.changes$/) && (-f "$ENV{'PBBUILDDIR'}/$c"));
    51025102    }
    51035103    my $debsigncmd = pb_check_req("debsign",1);
     
    51215121    my @pt = pb_conf_get_if("vmlist","velist","rmlist");
    51225122    foreach my $pt (@pt) {
    5123         push(@dists, split(/,/, $pt->{$ENV{PBPROJ}})) if defined $pt->{$ENV{PBPROJ}};
     5123        push(@dists, split(/,/, $pt->{$ENV{'PBPROJ'}})) if defined $pt->{$ENV{'PBPROJ'}};
    51245124    }
    51255125    # remove any whitespace
     
    52475247my ($projcomponent_map) = pb_conf_get_if("projcomponent");
    52485248pb_log(2,"projcomponent = ".Dumper($projcomponent_map)."\n");
    5249 my $projcomponent = $projcomponent_map->{$ENV{PBPROJ}};
     5249my $projcomponent = $projcomponent_map->{$ENV{'PBPROJ'}};
    52505250$projcomponent ||= 'contrib';
    52515251
  • devel/pb/lib/ProjectBuilder/CMS.pm

    r2284 r2287  
    151151}
    152152
    153 pb_log(1,"pb_cms_init returns $scheme,$pburl->{$ENV{'PBPROJ'}}\n");
    154 return($scheme,$pburl->{$ENV{'PBPROJ'}});
     153pb_log(1,"pb_cms_init returns $scheme,$pbprojurl->{$ENV{'PBPROJ'}}\n");
     154return($scheme,$pbprojurl->{$ENV{'PBPROJ'}});
    155155}
    156156
  • devel/pb/lib/ProjectBuilder/Changelog.pm

    r2109 r2287  
    7878pb_log(2,"Entering pb_changelog - OUTPUT: $OUTPUT\n") if (defined $OUTPUT);
    7979# For date handling
    80 $ENV{LANG}="C";
     80$ENV{'LANG'}="C";
    8181
    8282if ((not (defined $dtype)) || ($dtype eq "") ||
  • devel/pb/lib/ProjectBuilder/Filter.pm

    r2267 r2287  
    7878@file_basenames = reverse pb_distro_to_keylist($pbos, 'all') if (defined $pbos);
    7979# Build list of all filter files
    80 foreach my $dir ("$ENV{PBROOTDIR}/pbfilter", "$ENV{PBROOTDIR}/$pbpkg/pbfilter") {
     80foreach my $dir ("$ENV{'PBROOTDIR'}/pbfilter", "$ENV{'PBROOTDIR'}/$pbpkg/pbfilter") {
    8181    foreach my $file_basename (@file_basenames) {
    8282        my $path = "$dir/${file_basename}.yml";
  • devel/rpmbootstrap/bin/rpmbootstrap

    r2279 r2287  
    585585#
    586586$pbos->{'install'} =~ s/sudo//g;
    587 if (((defined $ENV{http_proxy}) && ($ENV{http_proxy} ne '')) || ((defined $ENV{https_proxy}) && ($ENV{https_proxy} ne '')) || ((defined $ENV{ftp_proxy}) && ($ENV{ftp_proxy} ne ''))) {
     587if (((defined $ENV{'http_proxy'}) && ($ENV{'http_proxy'} ne '')) || ((defined $ENV{'https_proxy'}) && ($ENV{'https_proxy'} ne '')) || ((defined $ENV{'ftp_proxy'}) && ($ENV{'ftp_proxy'} ne ''))) {
    588588    if ($pbos->{'name'} eq "opensuse") {
    589589        # For opensuse 11.4 or 12.1 -- one of them didn't work with http_proxy or HTTP_PROXY set.
    590590        open(PROXY, "> $vepath/etc/sysconfig/proxy") || die "can't open $vepath/etc/sysconfig/proxy: $!";
    591         print PROXY "HTTP_PROXY=$ENV{http_proxy}\n" if ((defined $ENV{http_proxy}) && ($ENV{http_proxy} ne ''));
    592         print PROXY "HTTPS_PROXY=$ENV{https_proxy}\n" if ((defined $ENV{https_proxy}) && ($ENV{https_proxy} ne ''));
    593         print PROXY "FTP_PROXY=$ENV{ftp_proxy}\n" if ((defined $ENV{ftp_proxy}) && ($ENV{ftp_proxy} ne ''));
     591        print PROXY "HTTP_PROXY=$ENV{'http_proxy'}\n" if ((defined $ENV{'http_proxy'}) && ($ENV{'http_proxy'} ne ''));
     592        print PROXY "HTTPS_PROXY=$ENV{'https_proxy'}\n" if ((defined $ENV{'https_proxy'}) && ($ENV{'https_proxy'} ne ''));
     593        print PROXY "FTP_PROXY=$ENV{'ftp_proxy'}\n" if ((defined $ENV{'ftp_proxy'}) && ($ENV{'ftp_proxy'} ne ''));
    594594        close(PROXY);
    595595    }
Note: See TracChangeset for help on using the changeset viewer.