[BACK]Return to pkg-config CVS log [TXT][DIR] Up to [local] / src / usr.bin / pkg-config

Diff for /src/usr.bin/pkg-config/pkg-config between version 1.96 and 1.97

version 1.96, 2023/06/08 08:55:27 version 1.97, 2023/09/22 07:28:31
Line 279 
Line 279 
 exit $rc;  exit $rc;
   
 ###########################################################################  ###########################################################################
   sub set_variables_from_env($file)
   {
               state (%done, @l);
   
               if (!defined $done{$file}) {
                       my $pkg = $file;
   
                       $pkg =~ s/(^.*\/)?(.*?)\.pc$/$2/g;
                       $pkg = uc($pkg);
                       if (!@l) {
                               @l = grep {/PKG_CONFIG_/} keys %ENV;
                       }
                       for my $k (@l) {
                               next unless $k =~ m/PKG_CONFIG_${pkg}_(\w+)/;
                               $variables->{lc($1)} = $ENV{$k};
                       }
                       $done{$file} = 1;
               }
   
   }
   
 sub handle_config($p, $op, $v, $list)  sub handle_config($p, $op, $v, $list)
 {  {
         my $cfg = cache_find_config($p);          my $cfg = cache_find_config($p);
Line 300 
Line 320 
         }          }
   
         my $get_props = sub($property) {          my $get_props = sub($property) {
             my $pkg;              set_variables_from_env($p);
   
             # See if there's anything in the environment that we need to  
             # take into account.  
             ($pkg = $p) =~ s/(^.*\/)?(.*?)\.pc$/$2/g;  
             $pkg = uc($pkg);  
   
             if (grep {/PKG_CONFIG_${pkg}.*/} keys %ENV) {  
                     # Now that we know we have something to look for, do  
                     # the inefficient iteration.  
                     while (my ($k, $v) = each %ENV) {  
                             if ($k =~ /^PKG_CONFIG_${pkg}_(\w+)/) {  
                                     $variables->{lc($1)} = $v;  
                             }  
                     }  
             }  
   
             my $deps = $cfg->get_property($property, $variables);              my $deps = $cfg->get_property($property, $variables);
             return unless defined $deps;              return unless defined $deps;

Legend:
Removed from v.1.96  
changed lines
  Added in v.1.97