Changeset 2153 in ProjectBuilder for devel/pb-modules/bin/pbgetparam


Ignore:
Timestamp:
Dec 23, 2016, 2:45:39 AM (4 years ago)
Author:
Bruno Cornec
Message:
  • Use function pb_distro_conf_print in pbgetparam to avoid code duplication
  • Improve pb_distro_conf_print with former code from pbgetparam
File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb-modules/bin/pbgetparam

    r2151 r2153  
    108108
    109109my $dist = $opts{'d'};
     110my $pbos = pb_distro_get_context($dist);
    110111pb_env_init($opts{'p'},0,"getconf",0);
    111 my $pbos = pb_distro_get_context($dist);
    112112
    113113my @tab = @ARGV;
    114114@tab = pb_conf_get_all() if (defined $opts{'a'});
    115115
    116 my %rep;
    117 my $i = 0;
    118 # Index on prj
    119 foreach my $r (pb_conf_get(@tab)) {
    120     $rep{$tab[$i]} = $r->{'default'} if (defined  $r->{'default'});
    121     $rep{$tab[$i]} = $r->{$ENV{'PBPROJ'}} if (defined  $r->{$ENV{'PBPROJ'}});
    122     $i++;
    123 }
    124 # Index on distro
    125 $i = 0;
    126 foreach my $r (pb_distro_get_param($pbos,pb_conf_get(@tab))) {
    127     $rep{$tab[$i]} = $r if (defined $tab[$i]);
    128     $i++;
    129 }
    130 foreach my $r (keys %rep) {
    131     print "$r => " if ((defined $opts{'v'}) || (defined $opts{'a'}));
    132     print "$rep{$r}\n";
    133 }
     116pb_distro_conf_print($pbos,@tab);
Note: See TracChangeset for help on using the changeset viewer.