Procházet zdrojové kódy

include target options when computing deferred attributes

Michael van Elst před 23 roky
rodič
revize
58de2d47d7
1 změnil soubory, kde provedl 7 přidání a 15 odebrání
  1. 7 15
      openpkg-tool/openpkg-build.pl

+ 7 - 15
openpkg-tool/openpkg-build.pl

@@ -551,18 +551,6 @@ sub override_options ($$$) {
     }
 }
 
-#
-# merge any number of options together
-#
-sub combine_options {
-    my($old) = shift;
-    my($new) = { %$old };
-    foreach (grep { defined $_ } @_) {
-        override_options($new,$_,''),
-    }
-    return $new;
-}
-
 #
 # pull in OPTIONS for a package or an RPM file
 #
@@ -1203,14 +1191,18 @@ sub target_lookup ($$) {
 #
 sub target_attribute ($$$) {
     my($target, $env, $attr) = @_;
-    my($with) = $env->{with};
-    my($name) = $target->{name};
+    my($with)   = $env->{with};
+    my($optreg) = $env->{config}->{optreg};
+    my($name)   = $target->{name};
     my(@out);
 
     return unless $target;
 
+    my(%mywith) = %{$target->{OPTIONS}};
+    override_options(\%mywith, name_with($name, $with), $optreg);
+
     foreach (@{$target->{$attr}}) {
-        next unless conditional($_->{'cond'}, name_with($name, $with));
+        next unless conditional($_->{'cond'}, \%mywith);
         push @out, $_->{'value'};
     }
     return \@out;