Ignore:
Timestamp:
Sep 3, 2007, 4:47:47 PM (12 years ago)
Author:
bruno
Message:

Better interface for pb_get functions

File:
1 edited

Legend:

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

    r88 r89  
    3737# and use its content
    3838#
    39 my $pbrc = pb_conf_read("$ENV{'PBETC'}","pbrc");
     39my ($pbrc) = pb_conf_read("$ENV{'PBETC'}","pbrc");
    4040print "DEBUG pbrc: ".Dumper($pbrc)."\n" if ($debug >= 1);
    4141
     
    6060if (not defined $ENV{'PBROOT'}) {
    6161    if (-f $pbrc{$proj}) {
    62         my $pbroot = pb_conf_read($pbrc{$proj},"pbroot");
     62        my ($pbroot) = pb_conf_read($pbrc{$proj},"pbroot");
    6363        my %pbroot = %$pbroot;
    6464        # All lines should point to the same pbroot so take the first
     
    8282    # Valid version names (optional)
    8383    # List of files to filter (optional)
    84     my $ptr = pb_conf_read("$ENV{'PBCONF'}/$proj.pb","defpkgdir","extpkgdir","version","filteredfiles");
    85     my ($defpkgdir, $extpkgdir, $version, $filteredfiles) = @$ptr;
     84    my ($defpkgdir, $extpkgdir, $version, $filteredfiles) = pb_conf_read("$ENV{'PBCONF'}/$proj.pb","defpkgdir","extpkgdir","version","filteredfiles");
    8685    print "DEBUG: defpkgdir: ".Dumper($defpkgdir)."\n" if ($debug >= 1);
    8786    print "DEBUG: extpkgdir: ".Dumper($extpkgdir)."\n" if ($debug >= 1);
     
    199198my @param = @_;
    200199
    201 my $ptr = pb_conf_read("$ENV{'PBETC'}", @param);
    202 my @ptr;
    203 if ($#param == 0) {
    204     push @ptr, $ptr;
    205 } else {
    206     @ptr = @$ptr;
    207 }
     200my @ptr = pb_conf_read("$ENV{'PBETC'}", @param);
     201
    208202foreach my $i (0..$#param) {
    209203    die "No $param[$i] defined for $ENV{'PBPROJ'}" if (not defined $ptr[$i]);
     
    212206    die "No $param[$i] defined for $ENV{'PBPROJ'}" if (not defined $p->{$ENV{'PBPROJ'}});
    213207}
    214 if ($#param == 0) {
    215     print "DEBUG: param: ".Dumper($ptr[0])."\n" if ($debug >= 1);
    216     return($ptr[0]);
    217 } else {
    218     my $ptr = \@ptr;
    219     print "DEBUG: param: ".Dumper($ptr)."\n" if ($debug >= 1);
    220     return($ptr);
    221 }
     208print "DEBUG: param: ".Dumper($ptr)."\n" if ($debug >= 1);
     209return(@ptr);
    222210}
    223211
     
    251239    push @ptr,$config->get($param);
    252240}
    253 if ($#param == 0) {
    254     print "DEBUG: param: $param[0] ".Dumper($ptr[0])."\n" if ($debug >= 1);
    255     return($ptr[0]);
    256 } else {
    257     my $ptr = \@ptr;
    258     print "DEBUG: params: ".Dumper(@param)." ".Dumper($ptr)."\n" if ($debug >= 1);
    259     return($ptr);
    260 }
     241print "DEBUG: params: ".Dumper(@param)." ".Dumper(@ptr)."\n" if ($debug >= 1);
     242return(@ptr);
    261243}
    262244
     
    267249my $ret;
    268250
    269 my $cms = pb_conf_get("cms");
     251my ($cms) = pb_conf_get("cms");
    270252# This one is optional
    271 my $cvsroot = pb_conf_read($ENV{'PBETC'},"cvsroot");
     253my ($cvsroot) = pb_conf_read($ENV{'PBETC'},"cvsroot");
    272254
    273255if ($cms->{$proj} eq "svn") {
Note: See TracChangeset for help on using the changeset viewer.