summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCasey Dahlin <cdahlin@redhat.com>2008-12-15 11:52:49 -0500
committerCasey Dahlin <cdahlin@redhat.com>2008-12-15 11:53:37 -0500
commitcbb7f144560c05073914c77e26c8c5fdb8d8c990 (patch)
treea12bd184d5c325c944eaf5e1ff792977f247a767
parentd94e3ebf1adfd83a356f015c1d56122e601e83c0 (diff)
downloadupstate-cbb7f144560c05073914c77e26c8c5fdb8d8c990.tar.gz
upstate-cbb7f144560c05073914c77e26c8c5fdb8d8c990.tar.xz
upstate-cbb7f144560c05073914c77e26c8c5fdb8d8c990.zip
Add or groups to hold provides
You can now specify hold provisions which read "One of (a,b,c)"
-rw-r--r--state.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/state.rb b/state.rb
index a15f6b8..94fca64 100644
--- a/state.rb
+++ b/state.rb
@@ -152,6 +152,17 @@ class State
@holds = Set.new [hold]
@hold_params = {}
self.class.hold_provides.each do |x|
+ if x.is_a? Array
+ worked = false
+ x.each do |y|
+ hold.params[y] or next
+ @hold_params[y] = hold.params[y]
+ worked = true
+ end
+ worked or raise AmbiguousRequest, "None of #{x.join(', ')} defined"
+ next
+ end
+
hold.params[x] or raise AmbiguousRequest, "#{x} undefined"
@hold_params[x] = hold.params[x]
end