mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-07 22:54:11 -05:00
Install and build adjustments (#12057)
Signed-off-by: Satadru Pramanik <satadru@gmail.com>
This commit is contained in:
committed by
GitHub
parent
439ca73df7
commit
770a4b8067
8
bin/crew
8
bin/crew
@@ -1024,7 +1024,11 @@ def install_package(pkgdir)
|
||||
|
||||
unless CREW_NOT_LINKS || @pkg.no_links?
|
||||
Find.find(Dir.pwd) do |path|
|
||||
next unless File.symlink?(path)
|
||||
begin
|
||||
next unless File.symlink?(path)
|
||||
rescue Errno::ENOENT
|
||||
next
|
||||
end
|
||||
begin
|
||||
File.stat(path)
|
||||
rescue Errno::ENOENT, Errno::ELOOP
|
||||
@@ -1034,7 +1038,7 @@ def install_package(pkgdir)
|
||||
fixedlink_loc = File.join(pkgdir, path.delete_prefix('.'))
|
||||
# If no changes were made, don't replace symlink
|
||||
unless fixedtarget == brokentarget
|
||||
FileUtils.ln_sf fixedtarget, fixedlink_loc
|
||||
FileUtils.ln_sf fixedtarget, fixedlink_loc if File.file?(fixedlink_loc)
|
||||
puts "Fixed: #{fixedtarget} -> #{path.delete_prefix('.')}".orange if CREW_VERBOSE
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,7 +4,7 @@ require 'etc'
|
||||
require 'open3'
|
||||
|
||||
OLD_CREW_VERSION ||= defined?(CREW_VERSION) ? CREW_VERSION : '1.0'
|
||||
CREW_VERSION ||= '1.61.9' unless defined?(CREW_VERSION) && CREW_VERSION == OLD_CREW_VERSION
|
||||
CREW_VERSION ||= '1.62.0' unless defined?(CREW_VERSION) && CREW_VERSION == OLD_CREW_VERSION
|
||||
|
||||
# Kernel architecture.
|
||||
KERN_ARCH ||= Etc.uname[:machine]
|
||||
|
||||
@@ -70,7 +70,7 @@ def downloader(url, sha256sum, filename = File.basename(url), verbose: false)
|
||||
puts "Updating checksum for #{filename}".lightblue
|
||||
puts "from #{sha256sum} to #{calc_sha256sum}".lightblue
|
||||
puts "in #{CREW_LOCAL_REPO_ROOT}/packages/#{pkg_name}.rb .".lightblue
|
||||
system "sed -i 's/#{sha256sum}/#{calc_sha256sum}/' #{CREW_LOCAL_REPO_ROOT}/packages/#{pkg_name}.rb"
|
||||
system "sed 's/#{sha256sum}/#{calc_sha256sum}/g;w #{CREW_LOCAL_REPO_ROOT}/packages/#{pkg_name}.rb' #{CREW_LOCAL_REPO_ROOT}/packages/#{pkg_name}.rb"
|
||||
else
|
||||
FileUtils.rm_f filename
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ def refresh_crew_json
|
||||
end
|
||||
|
||||
# Rename the binary_sha256 variable to sha256 in the device.json file
|
||||
system(" sed -i 's/binary_sha256/sha256/g' #{File.join(CREW_CONFIG_PATH, 'device.json')}")
|
||||
system("sed -i 's/binary_sha256/sha256/g' #{File.join(CREW_CONFIG_PATH, 'device.json')}")
|
||||
|
||||
# Check for renamed and deprecated packages, and handle them.
|
||||
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#!/bin/bash
|
||||
# This is for use as a Github CI Unit Test.
|
||||
# Version 1.3
|
||||
# Version 1.4
|
||||
set -e
|
||||
cd /usr/local/lib/crew/packages/
|
||||
echo "CREW_BRANCH: $CREW_BRANCH"
|
||||
crew update && yes | crew upgrade
|
||||
git clone --depth=1 --branch="$CREW_BRANCH" "$CREW_REPO" ~/build_test
|
||||
# Check if rubocop-chromebrew is installed and working, and if not install it.
|
||||
rubocop --require rubocop-chromebrew &>/dev/null || gem install rubocop-chromebrew
|
||||
|
||||
@@ -65,7 +65,7 @@ def self.check_build_uploads(architectures_to_check = nil, name = nil)
|
||||
unless @remote_hash == binary_sha256_hash[arch.to_sym]
|
||||
puts "#{arch}/#{name}: Adjusting sha256sum in package file to the remote binary sha256sum".lightpurple
|
||||
puts "#{binary_sha256_hash[arch.to_sym]} =>\n#{@remote_hash}".blue
|
||||
system "sed -i 's,#{binary_sha256_hash[arch.to_sym]},#{@remote_hash},g' packages/#{name}.rb"
|
||||
system "sed 's,#{binary_sha256_hash[arch.to_sym]},#{@remote_hash},g;w packages/#{name}.rb' packages/#{name}.rb"
|
||||
# Do a force install to make sure the package hashes are ok.
|
||||
puts "Checking install of #{name} to confirm binary hashes are correct.".lightpurple
|
||||
system "yes | crew install -f #{name} ; crew remove #{name}", exception: false
|
||||
|
||||
Reference in New Issue
Block a user