Changeset 982 in ProjectBuilder for devel


Ignore:
Timestamp:
Feb 19, 2010, 5:30:20 AM (14 years ago)
Author:
Bruno Cornec
Message:
  • Fix variable substitution which was too aggressive in pb_distro_get_param
Location:
devel
Files:
4 edited

Legend:

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

    r974 r982  
    400400
    401401my $cmds = shift || "";
    402 my $opts = shift || "";
     402my $options = shift || "";
    403403
    404404# cmds is a string of coma separated commands
    405 foreach my $file (split(/,/,$cmds) {
     405foreach my $file (split(/,/,$cmds)) {
    406406    pb_check_req($file,0);
    407407}
    408408
    409409# opts is a string of coma separated commands
    410 foreach my $file (split(/,/,$opts) {
     410foreach my $file (split(/,/,$options)) {
    411411    pb_check_req($file,1);
    412412}
  • devel/pb-modules/lib/ProjectBuilder/Distribution.pm

    r974 r982  
    444444}
    445445
    446 # Allow replacement of variables inside the parameter such as ddir, dver, darch for rpmbootstrap
    447 eval { $param =~ s/(\$\w+)/$1/eeg };
    448 
    449 pb_log(2,"DEBUG: pb_distro_get_param on ",Dumper($opt)," returns $param\n");
     446# Allow replacement of variables inside the parameter such as ddir, dver, darch for rpmbootstrap
     447# but not shell variable which ae backslashed
     448if ($param =~ /[^\\]\$/) {
     449    pb_log(3,"Expanding variable on $param\n");
     450    eval { $param =~ s/(\$\w+)/$1/eeg };
     451}
     452
     453pb_log(2,"DEBUG: pb_distro_get_param on $ddir-$dver-$darch returns ==$param==\n");
    450454return($param);
    451455
  • devel/pb/bin/pb

    r980 r982  
    419419die pb_syntax(-1,1) if (not defined $action);
    420420
     421my ($filteredfiles, $supfiles, $defpkgdir, $extpkgdir);
     422my $pbinit = undef;
     423$pbinit = 1 if ($action =~ /^newproj$/);
     424
     425# Handles project name if any
     426# And get global params
     427($filteredfiles, $supfiles, $defpkgdir, $extpkgdir) = pb_env_init($opts{'p'},$pbinit,$action);
     428
    421429#
    422430# Check for command requirements
    423431#
    424432my ($req,$opt) = pb_conf_get_if("oscmd","oscmdopt");
    425 pb_check_requirements($req->{$appname},$opt->{$appname});
    426 
    427 my ($filteredfiles, $supfiles, $defpkgdir, $extpkgdir);
    428 my $pbinit = undef;
    429 $pbinit = 1 if ($action =~ /^newproj$/);
    430 
    431 # Handles project name if any
    432 # And get global params
    433 ($filteredfiles, $supfiles, $defpkgdir, $extpkgdir) = pb_env_init($opts{'p'},$pbinit,$action);
     433my ($req2,$opt2) = (undef,undef);
     434$req2 = $req->{$appname} if (defined $req);
     435$opt2 = $opt->{$appname} if (defined $opt);
     436pb_check_requirements($req2,$opt2);
    434437
    435438pb_log(0,"Project: $ENV{'PBPROJ'}\n");
  • devel/rpmbootstrap/bin/rpmbootstrap

    r981 r982  
    192192
    193193#
    194 # Check for command requirements
    195 #
    196 my ($req,$opt) = pb_conf_get_if("oscmd","oscmdopt");
    197 pb_check_requirements($req->{$appname},$opt->{$appname});
    198 
    199 #
    200194# Check target dir
    201195# Create if not existent and use default if none given
     
    203197pb_env_init_pbrc(); # to get content of HOME/.pbrc
    204198my $vepath = shift @ARGV;
     199
     200#
     201# Check for command requirements
     202#
     203my ($req,$opt) = pb_conf_get_if("oscmd","oscmdopt");
     204my ($req2,$opt2) = (undef,undef);
     205$req2 = $req->{$appname} if (defined $req);
     206$opt2 = $opt->{$appname} if (defined $opt);
     207pb_check_requirements($req2,$opt2);
    205208
    206209if (not defined $vepath) {
Note: See TracChangeset for help on using the changeset viewer.