Permalink
Browse files

salt: use new dsl

  • Loading branch information...
1 parent 7137731 commit 0697c8f3bea5001c7d43292d4f49a9b62c2448bf @adamv adamv committed Aug 23, 2012
Showing with 6 additions and 10 deletions.
  1. +6 −10 Library/Formula/salt.rb
View
@@ -69,15 +69,11 @@ def linkto () return 'MagSys/BD17-snls3.dat' end
end
class Salt < Formula
- url 'http://supernovae.in2p3.fr/~guy/salt/download/snfit-2.2.2b.tar.gz'
homepage 'http://supernovae.in2p3.fr/~guy/salt/'
+ url 'http://supernovae.in2p3.fr/~guy/salt/download/snfit-2.2.2b.tar.gz'
md5 'bf227accaf89a751c28d0bf1ed2b0851'
- def options
- [
- ['--with-data', 'Install model data']
- ]
- end
+ option 'with-data', 'Install model data'
def install_subbrew(subbrew, installdir)
s = subbrew.new
@@ -108,10 +104,10 @@ def install
# install all the model data
# http://supernovae.in2p3.fr/~guy/salt/download/snls3-intallation.sh
- if ARGV.include? '--with-data'
- data = prefix + 'data'
+ if build.include? 'with-data'
+ data = prefix/'data'
data.mkpath
- File.open(data+'fitmodel.card', 'w') do |fitmodel|
+ File.open(data/'fitmodel.card', 'w') do |fitmodel|
# salt2 model + magsys
[SaltSALT2, SaltVEGA, SaltSDSS_AB_off, SaltVEGAHST].each do |cls|
fitmodel.write(install_subbrew(cls, data))
@@ -140,7 +136,7 @@ def test
end
def caveats
- if ARGV.include? '--with-data'
+ if build.include? 'with-data'
<<-EOS.undent
You should add the following to your .bashrc or equivalent:
export PATHMODEL=#{prefix}/data

0 comments on commit 0697c8f

Please sign in to comment.