Commit c0cab698 authored by Michał Siwek's avatar Michał Siwek

Multiple fixes and improvements

parent 184af33a
......@@ -55,7 +55,7 @@ def download
sha1sum = @pkg.binary_sha1[@device[:architecture]]
end
Dir.chdir CREW_BREW_DIR do
system('wget', '--content-disposition', url)
system('wget', '--content-disposition', '-N', url)
abort 'Checksum mismatch :/ try again' unless Digest::SHA1.hexdigest( File.read("./#{filename}") ) == sha1sum
end
puts "Archive downloaded"
......@@ -125,15 +125,16 @@ def install
meta = download
Dir.chdir CREW_BREW_DIR do
puts "Unpacking archive, this may take a while..."
system "tar", "zxf", meta[:filename]
system "tar", "xf", meta[:filename]
if meta[:source] == true
puts "Building from source, this may take a while..."
sytem "cd *"
@pkg.build
system "rm -rf", CREW_DEST_DIR + "/*" #wipe crew destdir
puts "Installing..."
@pkg.install
topdir = `tar -tf #{meta[:filename]} | sed -e 's@/.*@@' | uniq`.chomp!
Dir.chdir CREW_BREW_DIR + topdir do
puts "Building from source, this may take a while..."
@pkg.build
system "rm -rf", CREW_DEST_DIR + "/*" #wipe crew destdir
puts "Installing..."
@pkg.install
end
Dir.chdir CREW_DEST_DIR do
#create directory list
......@@ -157,12 +158,12 @@ def install
FileUtils.mv './filelist', CREW_CONFIG_PATH + "meta/#{@pkg.name}.filelist"
Dir.chdir CREW_CONFIG_PATH do
File.open("meta/#{@pkg.name}.directorylist").each_line do |line|
system "mkdir", "-p", line.chomp
system "sudo mkdir", "-p", line.chomp
end
File.open("meta/#{@pkg.name}.filelist").each_line do |line|
Dir.chdir CREW_BREW_DIR do
system "mv", '.' + line.chomp, line.chomp
system "sudo mv", '.' + line.chomp, line.chomp
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment