Obsolete
/
packaging
Archived
3
0
Fork 0

Non-tar files in sources are copied and not extracted.

master
Luka Vandervelden 2019-08-22 20:09:15 +02:00
parent 8322c78e30
commit 3700d5769d
1 changed files with 17 additions and 8 deletions

View File

@ -180,6 +180,8 @@ class Package::Recipe
def download def download
sources.each do |url| sources.each do |url|
next if url.scheme == "file"
unless File.exists? url.filename unless File.exists? url.filename
status = @context.run @context.sources_directory, "wget", [ url.to_s, "-O", url.filename ] status = @context.run @context.sources_directory, "wget", [ url.to_s, "-O", url.filename ]
@ -194,15 +196,22 @@ class Package::Recipe
sources.each do |url| sources.each do |url|
basename = url.filename basename = url.filename
if basename.match /\.(tar\.(gz|xz|bz2|lzma)|tgz)$/
puts ":: Extracting '#{url.filename}'"
status = @context.run( status = @context.run(
building_directory, building_directory,
"bsdtar", [ "bsdtar", [
"xvf", "xf",
@context.sources_directory + "/" + url.filename @context.sources_directory + "/" + url.filename
] ]
) )
raise ExtractionError.new self, url unless status.success? raise ExtractionError.new self, url unless status.success?
else
puts ":: Copying '#{url.filename}'"
FileUtils.cp "#{@context.sources_directory}/#{url.filename}",
url.filename
end
end end
end end