Add custom bottle URL support.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
parent
443bf9f287
commit
22aec1d0d9
@ -70,6 +70,11 @@ def bottle_regex
|
|||||||
Pathname::BOTTLE_EXTNAME_RX
|
Pathname::BOTTLE_EXTNAME_RX
|
||||||
end
|
end
|
||||||
|
|
||||||
def bottle_base_url
|
def bottle_root_url f
|
||||||
"https://downloads.sf.net/project/machomebrew/Bottles/"
|
root_url = f.bottle.root_url
|
||||||
|
root_url ||= 'https://downloads.sf.net/project/machomebrew/Bottles'
|
||||||
|
end
|
||||||
|
|
||||||
|
def bottle_url f
|
||||||
|
"#{bottle_root_url(f)}/#{bottle_filename(f)}"
|
||||||
end
|
end
|
||||||
|
|||||||
@ -39,7 +39,7 @@ class Formula
|
|||||||
# Ensure the bottle URL is set. If it does not have a checksum,
|
# Ensure the bottle URL is set. If it does not have a checksum,
|
||||||
# then a bottle is not available for the current platform.
|
# then a bottle is not available for the current platform.
|
||||||
if @bottle and not (@bottle.checksum.nil? or @bottle.checksum.empty?)
|
if @bottle and not (@bottle.checksum.nil? or @bottle.checksum.empty?)
|
||||||
@bottle.url ||= bottle_base_url + bottle_filename(self)
|
@bottle.url ||= bottle_url(self)
|
||||||
if @bottle.cat_without_underscores
|
if @bottle.cat_without_underscores
|
||||||
@bottle.url.gsub!(MacOS.cat.to_s, MacOS.cat_without_underscores.to_s)
|
@bottle.url.gsub!(MacOS.cat.to_s, MacOS.cat_without_underscores.to_s)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -79,7 +79,7 @@ end
|
|||||||
|
|
||||||
class Bottle < SoftwareSpec
|
class Bottle < SoftwareSpec
|
||||||
attr_writer :url
|
attr_writer :url
|
||||||
attr_reader :revision
|
attr_reader :revision, :root_url
|
||||||
# TODO: Can be removed when all bottles migrated to underscored cat symbols.
|
# TODO: Can be removed when all bottles migrated to underscored cat symbols.
|
||||||
attr_reader :cat_without_underscores
|
attr_reader :cat_without_underscores
|
||||||
|
|
||||||
@ -113,6 +113,10 @@ class Bottle < SoftwareSpec
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def root_url val=nil
|
||||||
|
val.nil? ? @root_url : @root_url = val
|
||||||
|
end
|
||||||
|
|
||||||
def revision val=nil
|
def revision val=nil
|
||||||
val.nil? ? @revision : @revision = val
|
val.nil? ? @revision : @revision = val
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user