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

Multiple fixes and improvements

parent 184af33a
...@@ -55,7 +55,7 @@ def download ...@@ -55,7 +55,7 @@ def download
sha1sum = @pkg.binary_sha1[@device[:architecture]] sha1sum = @pkg.binary_sha1[@device[:architecture]]
end end
Dir.chdir CREW_BREW_DIR do 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 abort 'Checksum mismatch :/ try again' unless Digest::SHA1.hexdigest( File.read("./#{filename}") ) == sha1sum
end end
puts "Archive downloaded" puts "Archive downloaded"
...@@ -125,15 +125,16 @@ def install ...@@ -125,15 +125,16 @@ def install
meta = download meta = download
Dir.chdir CREW_BREW_DIR do Dir.chdir CREW_BREW_DIR do
puts "Unpacking archive, this may take a while..." puts "Unpacking archive, this may take a while..."
system "tar", "zxf", meta[:filename] system "tar", "xf", meta[:filename]
if meta[:source] == true if meta[:source] == true
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..." puts "Building from source, this may take a while..."
sytem "cd *"
@pkg.build @pkg.build
system "rm -rf", CREW_DEST_DIR + "/*" #wipe crew destdir system "rm -rf", CREW_DEST_DIR + "/*" #wipe crew destdir
puts "Installing..." puts "Installing..."
@pkg.install @pkg.install
end
Dir.chdir CREW_DEST_DIR do Dir.chdir CREW_DEST_DIR do
#create directory list #create directory list
...@@ -157,12 +158,12 @@ def install ...@@ -157,12 +158,12 @@ def install
FileUtils.mv './filelist', CREW_CONFIG_PATH + "meta/#{@pkg.name}.filelist" FileUtils.mv './filelist', CREW_CONFIG_PATH + "meta/#{@pkg.name}.filelist"
Dir.chdir CREW_CONFIG_PATH do Dir.chdir CREW_CONFIG_PATH do
File.open("meta/#{@pkg.name}.directorylist").each_line do |line| File.open("meta/#{@pkg.name}.directorylist").each_line do |line|
system "mkdir", "-p", line.chomp system "sudo mkdir", "-p", line.chomp
end end
File.open("meta/#{@pkg.name}.filelist").each_line do |line| File.open("meta/#{@pkg.name}.filelist").each_line do |line|
Dir.chdir CREW_BREW_DIR do Dir.chdir CREW_BREW_DIR do
system "mv", '.' + line.chomp, line.chomp system "sudo mv", '.' + line.chomp, line.chomp
end end
end 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