Skip to content

Commit

Permalink
Update ant download URL
Browse files Browse the repository at this point in the history
Also, fail immediately when untarring fails.

Signed-off-by: Elena Sharma <[email protected]>
  • Loading branch information
Andrew Bruce authored and elenasharma committed Jun 8, 2015
1 parent 3bad2a7 commit e9107aa
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions spec/helpers/dita_ot_installer.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
module Bookbinder
class DitaOTInstaller
UnpackingError = Class.new(RuntimeError)

def install_dita
tar('-jxf', download(AntDownload.new))
dita_ot = DitaOTDownload.new
Expand All @@ -15,7 +17,11 @@ def download(resource)
end

def tar(opts, path)
`cd #{File.dirname(path)}; tar #{opts} #{path}; cd -`
Dir.chdir(File.dirname(path)) do
unless system("tar #{opts} #{path}")
raise UnpackingError.new("Failed to unpack #{path} with the command `tar #{opts} #{path}`")
end
end
end

def java_home
Expand All @@ -33,7 +39,7 @@ def spec_root

class AntDownload
def tarball_url
"http://mirror.ox.ac.uk/sites/rsync.apache.org//ant/binaries/#{tarball_filename}"
"http://archive.apache.org/dist/ant/binaries/#{tarball_filename}"
end

def tarball_filename
Expand Down Expand Up @@ -67,4 +73,4 @@ def version
end
end

end
end

0 comments on commit e9107aa

Please sign in to comment.