BuildOptions: store option tuples in a Set

As options are stored in an object owned by the eigenclass of a formula,
options defined in the Formula#options method can be added multiple
times if the formula is instantiated multiple times.

Store them in a set to prevent duplicates.

Fixes Homebrew/homebrew#14133.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
Jack Nagel 2012-08-12 00:58:48 -05:00
parent c9f824b54a
commit 0549a9ab05

View File

@ -162,7 +162,7 @@ class BuildOptions
@args = Array.new(args)
# Extend it into an ARGV extension
@args.extend(HomebrewArgvExtension)
@options = []
@options = Set.new
end
def add name, description=nil