Archived
3
0

Fixes file://.

This commit is contained in:
Luka Vandervelden 2019-11-05 14:08:33 +01:00
parent 2eb87bdf25
commit ae43eda669

View File

@ -210,16 +210,20 @@ class Package::Recipe
def download
sources.each do |url|
next if url.scheme == "file"
filename = @context.sources_directory + "/" + url.filename
unless File.exists? filename
@context.info "Downloading '#{url.filename}'"
if url.scheme == "file"
@context.info "Copying '#{url.filename}'"
status = @context.run @context.sources_directory, "wget", [ url.to_s, "-O", filename ]
FileUtils.cp "#{recipe_directory}/#{url.filename}", filename
else
@context.info "Downloading '#{url.filename}'"
raise DownloadError.new self, url unless status.success?
status = @context.run @context.sources_directory, "wget", [ url.to_s, "-O", filename ]
raise DownloadError.new self, url unless status.success?
end
end
end
end