Fix for require issues with highline and glibc 2.37 refactor (#10363)

* Adjust highline requires.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Refactor glibc_build237.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Adjust cmake logic for cmake_build_relative_dir.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Update buildsystems...

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Rebuild glibc 2.37 packages.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Adjust fixup for case of loading from much older crew.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Try to handle loading fixup on older crew update.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Handle older crew setups.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Use rubocop exclusion for only const.rb and fixup.rb.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Remove attr_accessor from buildsystems.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Force update compatible if coming from an older crew.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* remove require_gem from package.rb

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add fallback for remove.rb

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* const tweaks...

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Adjust const.rb & fixup.rb to remove error messages on load after require.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Make remove run crew update compatible if being run on a newer underlying chromebrew.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* lint

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Adjust fixup to be more resilient to being loaded in an older crew.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Switch from symbolized json import.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* fixup

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* fixup

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* fixup

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* fixup

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Revert most changes.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Adjust essential deps handling in fixup.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Cleanup save_json in fixup.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* update highline

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* save json more.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* save json more.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* test remove changes

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add more remove debug code.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add more remove debug code.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* add debug to fixup

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* add debug to fixup

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* add debug to fixup

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* fixup

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Refresh crew json when calling crew functions or exiting fixup.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Refresh crew json when calling crew functions or exiting fixup.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* fixup

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* fix json string usage in remove

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* essential package debugging

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* fixup

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* fixup

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Adjust remove debugging...

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* more remove debugging

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Remove debugging code from commands/remove.rb

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Remove more debugging code from lib/fixup.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Adjust remove test to test both remove with and without debug argument.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Update const.rb to not set x86 constants when not on x86.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Set x86 constants to nil when not on x86.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Bump crew version.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

---------

Signed-off-by: Satadru Pramanik <satadru@gmail.com>
This commit is contained in:
Satadru Pramanik, DO, MPH, MEng
2024-08-31 15:06:18 -04:00
committed by GitHub
parent 7caa9077ad
commit 386f42ff6e
22 changed files with 1170 additions and 403 deletions

View File

@@ -11,10 +11,10 @@
# See https://docs.rubocop.org/rubocop/configuration
AllCops:
NewCops: enable
TargetRubyVersion: 3.3
Exclude:
- 'lib/docopt.rb'
NewCops: enable
TargetRubyVersion: 3.3
# These cops have been temporarily disabled and should be reenabled asap
Lint/ShadowingOuterLocalVariable:
@@ -24,6 +24,12 @@ Lint/Debugger:
DebuggerMethods:
Pry: ~
# Need to allow reloading const.rb from fixup.rb
Lint/OrAssignmentToConstant:
Exclude:
- 'lib/const.rb'
- 'lib/fixup.rb'
Lint/SuppressedException:
Enabled: false

View File

@@ -21,6 +21,7 @@ def require_gem(gem_name_and_require = nil, require_override = nil)
end
require requires
end
require_gem('highline')
# The json gem can break when upgrading from a much older version of ruby.
require_gem('json')
require_gem('activesupport', 'active_support/core_ext/object/blank')
@@ -1272,7 +1273,7 @@ def install
# remove it just before the file copy
if @pkg.in_upgrade
puts 'Attempting removal since this is an upgrade or reinstall...'
Command.remove(@pkg, CREW_VERBOSE)
Command.remove(@pkg)
end
if @pkg.is_fake?
@@ -1741,7 +1742,7 @@ end
def remove_command(args)
args['<name>'].each do |name|
search name
Command.remove(@pkg, CREW_VERBOSE)
Command.remove(@pkg)
end
end

View File

@@ -7,10 +7,10 @@ require_relative '../lib/package_utils'
class Command
def self.list(available, compatible, incompatible, essential, installed, verbose)
device_json = JSON.load_file(File.join(CREW_CONFIG_PATH, 'device.json'), symbolize_names: true)
device_json = JSON.load_file(File.join(CREW_CONFIG_PATH, 'device.json'))
installed_packages = {}
device_json[:installed_packages].each do |package|
installed_packages[package[:name]] = package[:version]
device_json['installed_packages'].each do |package|
installed_packages[package['name']] = package['version']
end
if available
@@ -34,7 +34,7 @@ class Command
puts pkg_name.lightred unless PackageUtils.compatible?(pkg)
end
elsif essential
puts device_json[:essential_deps].join("\n")
puts device_json['essential_deps'].join("\n")
elsif installed
if verbose
installed_packages['======='] = '======='

View File

@@ -1,12 +1,13 @@
require 'fileutils'
require 'json'
require_relative '../lib/const'
require_relative '../lib/convenience_functions'
require_relative '../lib/package'
require_relative '../lib/package_utils'
class Command
def self.remove(pkg, verbose)
device_json = ConvenienceFunctions.load_symbolized_json
def self.remove(pkg, verbose = CREW_VERBOSE)
device_json = JSON.load_file(File.join(CREW_CONFIG_PATH, 'device.json'))
# Make sure the package is actually installed before we attempt to remove it.
unless PackageUtils.installed?(pkg.name)
@@ -18,7 +19,7 @@ class Command
# their dependencies, as those are needed for ruby and crew to run,
# and thus should not be removed.
# essential_deps = recursive_deps(CREW_ESSENTIAL_PACKAGES)
essential_deps = device_json[:essential_deps]
essential_deps = device_json['essential_deps']
crewlog "Essential Deps are #{essential_deps}."
if essential_deps.include?(pkg.name)
return if pkg.in_upgrade
@@ -62,7 +63,7 @@ class Command
essential_deps_exclude_froms = essential_deps.map { |i| File.file?("#{File.join(CREW_META_PATH, i.to_s)}.filelist") ? "--exclude-from=#{File.join(CREW_META_PATH, i.to_s)}.filelist" : '' }.join(' ')
package_files = `grep -h #{essential_deps_exclude_froms} \"^#{CREW_PREFIX}\\|^#{HOME}\" #{flist}`.split("\n").uniq.sort
all_other_files = `grep -h --exclude #{pkg.name}.filelist \"^#{CREW_PREFIX}\\|^#{HOME}\" #{CREW_META_PATH}/*.filelist`.split("\n").uniq.sort
all_other_files = `grep -h --exclude #{pkg.name}.filelist \"^#{CREW_PREFIX}\\|^#{HOME}\" #{CREW_META_PATH}/*.filelist 2>/dev/null`.split("\n").uniq.sort
# We want the difference of these arrays.
unique_to_package_files = package_files - all_other_files
@@ -75,7 +76,7 @@ class Command
puts package_files_that_overlap.join("\n").orange
end
unique_to_package_files.each do |file|
puts "Removing file #{file}".yellow if CREW_VERBOSE
puts "Removing file #{file}".yellow if verbose
FileUtils.remove_file file, exception: false
end
FileUtils.remove_file flist
@@ -96,7 +97,7 @@ class Command
# Remove the package from the list of installed packages in device.json.
puts "Removing package #{pkg.name} from device.json".yellow if verbose
device_json[:installed_packages].delete_if { |entry| entry[:name] == pkg.name }
device_json['installed_packages'].delete_if { |entry| entry['name'] == pkg.name }
# Update device.json with our changes.
ConvenienceFunctions.save_json(device_json)

View File

@@ -3,18 +3,16 @@ require 'package'
class CMake < Package
property :cmake_build_extras, :cmake_build_relative_dir, :cmake_install_extras, :cmake_options, :pre_cmake_options
attr_accessor :cmake_build_relative_dir
def initialize
super
@cmake_build_relative_dir = '.'
end
def self.build
puts "Additional cmake_options being used: #{@pre_cmake_options.nil? ? '<no pre_cmake_options>' : @pre_cmake_options} #{@cmake_options.nil? ? '<no cmake_options>' : @cmake_options}".orange
@cmake_build_relative_dir ||= '.'
@crew_cmake_options = @no_lto ? CREW_CMAKE_FNO_LTO_OPTIONS : CREW_CMAKE_OPTIONS
puts 'Additional cmake options being used:'.orange
method_list = methods.grep(/cmake_/).delete_if { |i| send(i).blank? }
method_list.each do |method|
puts "#{method}: #{send method}".orange
end
@mold_linker_prefix_cmd = CREW_LINKER == 'mold' ? 'mold -run' : ''
system "#{@pre_cmake_options} #{@mold_linker_prefix_cmd} cmake -C #{@cmake_build_relative_dir} -B builddir -G Ninja #{@crew_cmake_options} #{@cmake_options}"
system "#{@pre_cmake_options} #{@mold_linker_prefix_cmd} cmake -S #{@cmake_build_relative_dir} -B #{@cmake_build_relative_dir}/builddir -G Ninja #{@crew_cmake_options} #{@cmake_options}"
system "#{CREW_NINJA} -C #{@cmake_build_relative_dir}/builddir"
@cmake_build_extras&.call
end

View File

@@ -4,9 +4,13 @@ class Meson < Package
property :meson_options, :pre_meson_options, :meson_build_extras, :meson_install_extras
def self.build
puts "Additional meson_options being used: #{@pre_meson_options.nil? ? '<no pre_meson_options>' : @pre_meson_options} #{@meson_options.nil? ? '<no meson_options>' : @meson_options}".orange
@crew_meson_options = @no_lto ? CREW_MESON_OPTIONS.sub('-Db_lto=true', '-Db_lto=false') : CREW_MESON_OPTIONS
@mold_linker_prefix_cmd = CREW_LINKER == 'mold' ? 'mold -run' : ''
puts 'Additional meson options being used:'.orange
method_list = methods.grep(/meson_/).delete_if { |i| send(i).blank? }
method_list.each do |method|
puts "#{method}: #{send method}".orange
end
system "#{@pre_meson_options} #{@mold_linker_prefix_cmd} meson setup #{@crew_meson_options} #{@meson_options} builddir"
system 'meson configure --no-pager builddir'
system "#{CREW_NINJA} -C builddir"

View File

@@ -3,22 +3,8 @@ require 'package'
class Python < Package
property :no_svem, :python_build_extras, :python_build_options, :python_build_relative_dir, :python_install_extras, :python_install_options
attr_accessor :python_build_relative_dir
def initialize
super
@python_build_relative_dir = '.'
end
def self.build
# @required_pip_modules = %w[build installer setuptools wheel pyproject_hooks]
# @pip_list = `pip list --exclude pip`
# @required_pip_modules.each do |pip_pkg|
# unless @pip_list.include?(pip_pkg)
# puts "Installing #{pip_pkg} using pip..."
# system "MAKEFLAGS=-j#{CREW_NPROC} pip install #{pip_pkg}"
# end
# end
@python_build_relative_dir ||= '.'
Dir.chdir(@python_build_relative_dir) do
if File.file?('setup.py')
puts "Python build options being used: #{PY3_SETUP_BUILD_OPTIONS} #{@python_build_options}".orange

View File

@@ -4,7 +4,7 @@ class Qmake < Package
property :qmake_build_extras, :qmake_install_extras
def self.build
system "QMAKE_CXX='g++ #{ARCH == 'x86_64' && LIBC_VERSION.to_f >= 2.35 ? File.join(CREW_LIB_PREFIX, 'libC.so.6').to_s : ''}' qmake"
system "QMAKE_CXX='g++ #{ARCH == 'x86_64' && Gem::Version.new(LIBC_VERSION.to_s) >= Gem::Version.new('2.35') ? File.join(CREW_LIB_PREFIX, 'libC.so.6').to_s : ''}' qmake"
system 'make'
@qmake_build_extras&.call
end

View File

@@ -2,19 +2,20 @@
# Defines common constants used in different parts of crew
require 'etc'
CREW_VERSION = '1.51.3'
OLD_CREW_VERSION ||= defined?(CREW_VERSION) ? CREW_VERSION : '1.0'
CREW_VERSION ||= '1.51.4' unless defined?(CREW_VERSION) && CREW_VERSION == OLD_CREW_VERSION
# Kernel architecture.
KERN_ARCH = Etc.uname[:machine]
KERN_ARCH ||= Etc.uname[:machine]
# Read and parse processor information from /proc/cpuinfo
CPUINFO = File.readlines('/proc/cpuinfo').map { |line| line.chomp.split(/\t+: /) if line.include?("\t") }.compact.to_h
CPUINFO ||= File.readlines('/proc/cpuinfo').map { |line| line.chomp.split(/\t+: /) if line.include?("\t") }.compact.to_h
# We report aarch64 & armv8l machines as armv7l for now, as we treat
# them as if they were armv7l.
# When we have proper aarch64 support, remove this.
# Also, we allow ARCH to be changed via the ARCH environment variable.
ARCH = ENV.fetch('ARCH') do |_name|
ARCH ||= ENV.fetch('ARCH') do |_name|
case KERN_ARCH
when 'aarch64', 'armv8l'
'armv7l'
@@ -24,79 +25,89 @@ end
# Allow for edge case of i686 install on a x86_64 host before linux32 is
# downloaded, e.g. in a docker container.
CREW_LIB_SUFFIX = ARCH.eql?('x86_64') && Dir.exist?('/lib64') ? '64' : ''
ARCH_LIB = "lib#{CREW_LIB_SUFFIX}"
CREW_LIB_SUFFIX ||= ARCH.eql?('x86_64') && Dir.exist?('/lib64') ? '64' : ''
ARCH_LIB ||= "lib#{CREW_LIB_SUFFIX}"
# Glibc version can be found from the output of libc.so.6
LIBC_VERSION = ENV.fetch('LIBC_VERSION', Etc.confstr(Etc::CS_GNU_LIBC_VERSION).split.last)
LIBC_VERSION ||= ENV.fetch('LIBC_VERSION', Etc.confstr(Etc::CS_GNU_LIBC_VERSION).split.last) unless defined?(LIBC_VERSION)
CREW_PREFIX = ENV.fetch('CREW_PREFIX', '/usr/local')
CREW_PREFIX ||= ENV.fetch('CREW_PREFIX', '/usr/local') unless defined?(CREW_PREFIX)
if CREW_PREFIX == '/usr/local'
CREW_BUILD_FROM_SOURCE = ENV.fetch('CREW_BUILD_FROM_SOURCE', '0').eql?('1')
HOME = Dir.home
CREW_BUILD_FROM_SOURCE ||= ENV.fetch('CREW_BUILD_FROM_SOURCE', false) unless defined?(CREW_BUILD_FROM_SOURCE)
HOME ||= Dir.home
else
CREW_BUILD_FROM_SOURCE = true
HOME = File.join(CREW_PREFIX, Dir.home)
CREW_BUILD_FROM_SOURCE ||= true
HOME ||= File.join(CREW_PREFIX, Dir.home)
end
CREW_ESSENTIAL_PACKAGES = %w[gcc_lib glibc gmp lz4 ruby xzutils zlib zstd]
CREW_ESSENTIAL_PACKAGES ||= %w[gcc_lib glibc gmp lz4 ruby xzutils zlib zstd]
CREW_IN_CONTAINER = File.exist?('/.dockerenv') || ENV.fetch('CREW_IN_CONTAINER', '0').eql?('1')
CREW_IN_CONTAINER ||= File.exist?('/.dockerenv') || ENV.fetch('CREW_IN_CONTAINER', false)
CREW_CPU_VENDOR = CPUINFO['vendor_id']
CREW_CPU_VENDOR ||= CPUINFO['vendor_id']
# The cpuinfo vendor_id may not exist on non-x86 platforms, or when a
# container is virtualized on non-x86 platforms. Default to
# CREW_IS_INTEL for x86 architectures.
CREW_IS_AMD = CREW_CPU_VENDOR.eql?('AuthenticAMD')
CREW_IS_INTEL = %w[x86_64 i686].include?(ARCH) && %w[unknown GenuineIntel].include?(CREW_CPU_VENDOR)
if %w[x86_64 i686].include?(ARCH)
CREW_IS_AMD ||= CREW_CPU_VENDOR.eql?('AuthenticAMD').nil? unless defined?(CREW_IS_AMD)
CREW_IS_INTEL ||= %w[unknown GenuineIntel].include?(CREW_CPU_VENDOR) unless defined?(CREW_IS_INTEL)
else
CREW_IS_AMD ||= nil
CREW_IS_INTEL ||= nil
end
# Use sane minimal defaults if in container and no override specified.
CREW_KERNEL_VERSION = \
if CREW_IN_CONTAINER && ENV['CREW_KERNEL_VERSION'].nil?
CREW_KERNEL_VERSION ||= \
if CREW_IN_CONTAINER || ENV.fetch('CREW_KERNEL_VERSION', nil)
ARCH.eql?('i686') ? '3.8' : '5.10'
else
ENV.fetch('CREW_KERNEL_VERSION', Etc.uname[:release].rpartition('.').first)
end
CREW_LIB_PREFIX = File.join(CREW_PREFIX, ARCH_LIB)
CREW_MAN_PREFIX = File.join(CREW_PREFIX, 'share/man')
CREW_LIB_PATH = File.join(CREW_PREFIX, 'lib/crew')
CREW_PACKAGES_PATH = File.join(CREW_LIB_PATH, 'packages')
CREW_CONFIG_PATH = File.join(CREW_PREFIX, 'etc/crew')
CREW_META_PATH = File.join(CREW_CONFIG_PATH, 'meta')
CREW_BREW_DIR = File.join(CREW_PREFIX, 'tmp/crew')
CREW_DEST_DIR = File.join(CREW_BREW_DIR, 'dest')
CREW_WINE_PREFIX = File.join(CREW_LIB_PREFIX, 'wine')
CREW_DEST_PREFIX = File.join(CREW_DEST_DIR, CREW_PREFIX)
CREW_DEST_LIB_PREFIX = File.join(CREW_DEST_DIR, CREW_LIB_PREFIX)
CREW_DEST_WINE_PREFIX = File.join(CREW_DEST_PREFIX, CREW_WINE_PREFIX)
CREW_DEST_MAN_PREFIX = File.join(CREW_DEST_DIR, CREW_MAN_PREFIX)
CREW_LIB_PREFIX ||= File.join(CREW_PREFIX, ARCH_LIB)
CREW_MAN_PREFIX ||= File.join(CREW_PREFIX, 'share/man')
CREW_LIB_PATH ||= File.join(CREW_PREFIX, 'lib/crew')
CREW_PACKAGES_PATH ||= File.join(CREW_LIB_PATH, 'packages')
CREW_CONFIG_PATH ||= File.join(CREW_PREFIX, 'etc/crew')
CREW_META_PATH ||= File.join(CREW_CONFIG_PATH, 'meta')
CREW_BREW_DIR ||= File.join(CREW_PREFIX, 'tmp/crew')
CREW_DEST_DIR ||= File.join(CREW_BREW_DIR, 'dest')
CREW_WINE_PREFIX ||= File.join(CREW_LIB_PREFIX, 'wine')
CREW_DEST_PREFIX ||= File.join(CREW_DEST_DIR, CREW_PREFIX)
CREW_DEST_LIB_PREFIX ||= File.join(CREW_DEST_DIR, CREW_LIB_PREFIX)
CREW_DEST_WINE_PREFIX ||= File.join(CREW_DEST_PREFIX, CREW_WINE_PREFIX)
CREW_DEST_MAN_PREFIX ||= File.join(CREW_DEST_DIR, CREW_MAN_PREFIX)
# Local constants for contributors.
CREW_LOCAL_REPO_ROOT = `git rev-parse --show-toplevel 2> /dev/null`.chomp
CREW_LOCAL_BUILD_DIR = "#{CREW_LOCAL_REPO_ROOT}/release/#{ARCH}"
CREW_LOCAL_REPO_ROOT ||= `git rev-parse --show-toplevel 2> /dev/null`.chomp
CREW_LOCAL_BUILD_DIR ||= "#{CREW_LOCAL_REPO_ROOT}/release/#{ARCH}"
# The following is used in fixup.rb to determine if crew update needs to
# be run again.
CREW_CONST_GIT_COMMIT = `git -C #{CREW_LIB_PATH} log -n1 --oneline #{__FILE__} 2> /dev/null`.split.first
@git_commit = `git -C #{CREW_LIB_PATH} log -n1 --oneline #{__FILE__} 2> /dev/null`.split.first
if defined?(CREW_CONST_GIT_COMMIT)
CREW_CONST_GIT_COMMIT = @git_commit if @git_commit != CREW_CONST_GIT_COMMIT
else
CREW_CONST_GIT_COMMIT ||= @git_commit
end
# Put musl build dir under CREW_PREFIX/share/musl to avoid FHS incompatibility
CREW_MUSL_PREFIX = File.join(CREW_PREFIX, '/share/musl/')
CREW_DEST_MUSL_PREFIX = File.join(CREW_DEST_DIR, CREW_MUSL_PREFIX)
MUSL_LIBC_VERSION = File.executable?("#{CREW_MUSL_PREFIX}/lib/libc.so") ? `#{CREW_MUSL_PREFIX}/lib/libc.so 2>&1`[/\bVersion\s+\K\S+/] : nil
CREW_MUSL_PREFIX ||= File.join(CREW_PREFIX, '/share/musl/')
CREW_DEST_MUSL_PREFIX ||= File.join(CREW_DEST_DIR, CREW_MUSL_PREFIX)
MUSL_LIBC_VERSION ||= File.executable?("#{CREW_MUSL_PREFIX}/lib/libc.so") ? `#{CREW_MUSL_PREFIX}/lib/libc.so 2>&1`[/\bVersion\s+\K\S+/] : nil unless defined?(MUSL_LIBC_VERSION)
CREW_DEST_HOME = File.join(CREW_DEST_DIR, HOME)
CREW_CACHE_DIR = ENV.fetch('CREW_CACHE_DIR', "#{HOME}/.cache/crewcache")
CREW_CACHE_BUILD = ENV.fetch('CREW_CACHE_BUILD', '0').eql?('1')
CREW_CACHE_FAILED_BUILD = ENV.fetch('CREW_CACHE_FAILED_BUILD', '0').eql?('1')
CREW_DEST_HOME ||= File.join(CREW_DEST_DIR, HOME)
CREW_CACHE_DIR ||= ENV.fetch('CREW_CACHE_DIR', "#{HOME}/.cache/crewcache") unless defined?(CREW_CACHE_DIR)
CREW_CACHE_BUILD ||= ENV.fetch('CREW_CACHE_BUILD', false) unless defined?(CREW_CACHE_BUILD)
CREW_CACHE_FAILED_BUILD ||= ENV.fetch('CREW_CACHE_FAILED_BUILD', false) unless defined?(CREW_CACHE_FAILED_BUILD)
CREW_DEBUG = ARGV.intersect?(%w[-D --debug])
CREW_FORCE = ARGV.intersect?(%w[-f --force])
CREW_VERBOSE = ARGV.intersect?(%w[-v --verbose])
CREW_DEBUG ||= ARGV.intersect?(%w[-D --debug]) unless defined?(CREW_DEBUG)
CREW_FORCE ||= ARGV.intersect?(%w[-f --force]) unless defined?(CREW_FORCE)
CREW_VERBOSE ||= ARGV.intersect?(%w[-v --verbose]) unless defined?(CREW_VERBOSE)
# Set CREW_NPROC from environment variable, `distcc -j`, or `nproc`.
CREW_NPROC = \
CREW_NPROC ||= \
if File.file?("#{CREW_PREFIX}/bin/distcc")
ENV.fetch('CREW_NPROC', `distcc -j`.chomp)
else
@@ -104,50 +115,59 @@ CREW_NPROC = \
end
# Set following as boolean if environment variables exist.
CREW_CACHE_ENABLED = ENV.fetch('CREW_CACHE_ENABLED', '0').eql?('1')
CREW_CONFLICTS_ONLY_ADVISORY = ENV.fetch('CREW_CONFLICTS_ONLY_ADVISORY', '0').eql?('1') # or use conflicts_ok
CREW_DISABLE_ENV_OPTIONS = ENV.fetch('CREW_DISABLE_ENV_OPTIONS', '0').eql?('1') # or use no_env_options
CREW_FHS_NONCOMPLIANCE_ONLY_ADVISORY = ENV.fetch('CREW_FHS_NONCOMPLIANCE_ONLY_ADVISORY', '0').eql?('1') # or use no_fhs
CREW_NOT_COMPRESS = ENV.fetch('CREW_NOT_COMPRESS', '0').eql?('1') # or use no_compress
CREW_NOT_LINKS = ENV.fetch('CREW_NOT_LINKS', '0').eql?('1') # or use no_links
CREW_NOT_STRIP = ENV.fetch('CREW_NOT_STRIP', '0').eql?('1') # or use no_strip
CREW_NOT_SHRINK_ARCHIVE = ENV.fetch('CREW_NOT_SHRINK_ARCHIVE', '0').eql?('1') # or use no_shrink
CREW_CACHE_ENABLED ||= ENV.fetch('CREW_CACHE_ENABLED', false) unless defined?(CREW_CACHE_ENABLED)
CREW_CONFLICTS_ONLY_ADVISORY ||= ENV.fetch('CREW_CONFLICTS_ONLY_ADVISORY', false) unless defined?(CREW_CONFLICTS_ONLY_ADVISORY)
# or use conflicts_ok
CREW_DISABLE_ENV_OPTIONS ||= ENV.fetch('CREW_DISABLE_ENV_OPTIONS', false) unless defined?(CREW_DISABLE_ENV_OPTIONS)
# or use no_env_options
CREW_FHS_NONCOMPLIANCE_ONLY_ADVISORY ||= ENV.fetch('CREW_FHS_NONCOMPLIANCE_ONLY_ADVISORY', false) unless defined?(CREW_FHS_NONCOMPLIANCE_ONLY_ADVISORY)
# or use no_fhs
CREW_NOT_COMPRESS ||= ENV.fetch('CREW_NOT_COMPRESS', false) unless defined?(CREW_NOT_COMPRESS)
# or use no_compress
CREW_NOT_LINKS ||= ENV.fetch('CREW_NOT_LINKS', false) unless defined?(CREW_NOT_LINKS)
# or use no_links
CREW_NOT_STRIP ||= ENV.fetch('CREW_NOT_STRIP', false) unless defined?(CREW_NOT_STRIP)
# or use no_strip
CREW_NOT_SHRINK_ARCHIVE ||= ENV.fetch('CREW_NOT_SHRINK_ARCHIVE', false) unless defined?(CREW_NOT_SHRINK_ARCHIVE)
# or use no_shrink
# Allow git constants to be set from environment variables (for testing)
CREW_REPO = ENV.fetch('CREW_REPO', 'https://github.com/chromebrew/chromebrew.git')
CREW_BRANCH = ENV.fetch('CREW_BRANCH', 'master')
CREW_REPO ||= ENV.fetch('CREW_REPO', 'https://github.com/chromebrew/chromebrew.git') unless defined?(CRE_REPO)
CREW_BRANCH ||= ENV.fetch('CREW_BRANCH', 'master') unless defined?(CREW_BRANCH)
USER = Etc.getlogin
USER ||= Etc.getlogin
CHROMEOS_RELEASE = \
if File.exist?('/etc/lsb-release')
File.read('/etc/lsb-release')[/CHROMEOS_RELEASE_CHROME_MILESTONE=(.+)/, 1]
else
# newer version of Chrome OS exports info to env by default
ENV.fetch('CHROMEOS_RELEASE_CHROME_MILESTONE', nil)
end
unless defined?(CHROMEOS_RELEASE)
CHROMEOS_RELEASE = \
if File.exist?('/etc/lsb-release')
File.read('/etc/lsb-release')[/CHROMEOS_RELEASE_CHROME_MILESTONE||=(.+)/, 1]
else
# newer version of Chrome OS exports info to env by default
ENV.fetch('CHROMEOS_RELEASE_CHROME_MILESTONE', nil)
end
end
# If CREW_DISABLE_MVDIR environment variable exists and is equal to 1 use rsync/tar to install files in lieu of crew-mvdir.
CREW_DISABLE_MVDIR = ENV.fetch('CREW_DISABLE_MVDIR', '0').eql?('1')
CREW_DISABLE_MVDIR ||= ENV.fetch('CREW_DISABLE_MVDIR', false) unless defined?(CREW_DISABLE_MVDIR)
# Days between crew prompting to run 'crew update' and doing gem updates.
CREW_UPDATE_CHECK_INTERVAL = ENV.fetch('CREW_UPDATE_CHECK_INTERVAL', 7).to_i
CREW_UPDATE_CHECK_INTERVAL ||= ENV.fetch('CREW_UPDATE_CHECK_INTERVAL', 7).to_i unless defined?(CREW_UPDATE_CHECK_INTERVAL)
# If CREW_USE_CURL environment variable exists use curl in lieu of net/http.
CREW_USE_CURL = ENV.fetch('CREW_USE_CURL', '0').eql?('1')
CREW_USE_CURL ||= ENV.fetch('CREW_USE_CURL', false) unless defined?(CREW_USE_CURL)
# Use an external downloader instead of net/http if CREW_DOWNLOADER is set, see lib/downloader.rb for more info
# About the format of the CREW_DOWNLOADER variable, see line 130-133 in lib/downloader.rb
CREW_DOWNLOADER = ENV.fetch('CREW_DOWNLOADER', nil)
CREW_DOWNLOADER ||= ENV.fetch('CREW_DOWNLOADER', nil) unless defined?(CREW_DOWNLOADER)
# Downloader maximum retry count
CREW_DOWNLOADER_RETRY = ENV.fetch('CREW_DOWNLOADER_RETRY', 3).to_i
CREW_DOWNLOADER_RETRY ||= ENV.fetch('CREW_DOWNLOADER_RETRY', 3).to_i unless defined?(CREW_DOWNLOADER_RETRY)
# show download progress bar or not (only applied when using the default ruby downloader)
CREW_HIDE_PROGBAR = ENV.fetch('CREW_HIDE_PROGBAR', '0').eql?('1')
CREW_HIDE_PROGBAR = ENV.fetch('CREW_HIDE_PROGBAR', false) unless defined?(CREW_HIDE_PROGBAR)
# set certificate file location for lib/downloader.rb
SSL_CERT_FILE = \
SSL_CERT_FILE ||= \
if ENV['SSL_CERT_FILE'] && File.exist?(ENV['SSL_CERT_FILE'])
ENV['SSL_CERT_FILE']
elsif File.exist?("#{CREW_PREFIX}/etc/ssl/certs/ca-certificates.crt")
@@ -156,7 +176,7 @@ SSL_CERT_FILE = \
'/etc/ssl/certs/ca-certificates.crt'
end
SSL_CERT_DIR = \
SSL_CERT_DIR ||= \
if ENV['SSL_CERT_DIR'] && Dir.exist?(ENV['SSL_CERT_DIR'])
ENV['SSL_CERT_DIR']
elsif Dir.exist?("#{CREW_PREFIX}/etc/ssl/certs")
@@ -165,32 +185,32 @@ SSL_CERT_DIR = \
'/etc/ssl/certs'
end
CREW_ARCH_FLAGS_OVERRIDE = ENV.fetch('CREW_ARCH_FLAGS_OVERRIDE', '')
CREW_ARCH_FLAGS_OVERRIDE ||= ENV.fetch('CREW_ARCH_FLAGS_OVERRIDE', '') unless defined?(CREW_ARCH_FLAGS_OVERRIDE)
case ARCH
when 'aarch64', 'armv7l'
CREW_TARGET = 'armv7l-cros-linux-gnueabihf'
CREW_TARGET ||= 'armv7l-cros-linux-gnueabihf'
# These settings have been selected to match debian armhf.
# Using -mfpu=neon breaks builds such as webkit2gtk.
CREW_ARCH_FLAGS = CREW_ARCH_FLAGS_OVERRIDE.to_s.empty? ? '-mfloat-abi=hard -mthumb -mfpu=vfpv3-d16 -march=armv7-a+fp' : CREW_ARCH_FLAGS_OVERRIDE
CREW_ARCH_FLAGS ||= CREW_ARCH_FLAGS_OVERRIDE.to_s.empty? ? '-mfloat-abi=hard -mthumb -mfpu=vfpv3-d16 -march=armv7-a+fp' : CREW_ARCH_FLAGS_OVERRIDE
when 'i686'
CREW_TARGET = 'i686-cros-linux-gnu'
CREW_ARCH_FLAGS = CREW_ARCH_FLAGS_OVERRIDE.to_s.empty? ? '' : CREW_ARCH_FLAGS_OVERRIDE
CREW_TARGET ||= 'i686-cros-linux-gnu'
CREW_ARCH_FLAGS ||= CREW_ARCH_FLAGS_OVERRIDE.to_s.empty? ? '' : CREW_ARCH_FLAGS_OVERRIDE
when 'x86_64'
CREW_TARGET = 'x86_64-cros-linux-gnu'
CREW_ARCH_FLAGS = CREW_ARCH_FLAGS_OVERRIDE.to_s.empty? ? '' : CREW_ARCH_FLAGS_OVERRIDE
CREW_TARGET ||= 'x86_64-cros-linux-gnu'
CREW_ARCH_FLAGS ||= CREW_ARCH_FLAGS_OVERRIDE.to_s.empty? ? '' : CREW_ARCH_FLAGS_OVERRIDE
end
CREW_LINKER = ENV.fetch('CREW_LINKER', 'mold')
CREW_GLIBC_OVERRIDE_LINKER_FLAGS = ARCH == 'x86_64' && LIBC_VERSION.to_f >= 2.35 ? " #{File.join(CREW_LIB_PREFIX, 'libC.so.6')} " : ''
CREW_LINKER_FLAGS = ENV.fetch('CREW_LINKER_FLAGS', CREW_GLIBC_OVERRIDE_LINKER_FLAGS)
CREW_LINKER ||= ENV.fetch('CREW_LINKER', 'mold') unless defined?(CREW_LINKER)
CREW_GLIBC_OVERRIDE_LINKER_FLAGS ||= ARCH == 'x86_64' && LIBC_VERSION.to_f >= 2.35 ? " #{File.join(CREW_LIB_PREFIX, 'libC.so.6')} " : ''
CREW_LINKER_FLAGS ||= ENV.fetch('CREW_LINKER_FLAGS', CREW_GLIBC_OVERRIDE_LINKER_FLAGS) unless defined?(CREW_LINKER_FLAGS)
CREW_CORE_FLAGS = "-O2 -pipe -ffat-lto-objects -fPIC #{CREW_ARCH_FLAGS} -fuse-ld=#{CREW_LINKER} #{CREW_LINKER_FLAGS}"
CREW_COMMON_FLAGS = "#{CREW_CORE_FLAGS} -flto=auto"
CREW_COMMON_FNO_LTO_FLAGS = "#{CREW_CORE_FLAGS} -fno-lto"
CREW_LDFLAGS = "-flto=auto #{CREW_LINKER_FLAGS}"
CREW_FNO_LTO_LDFLAGS = '-fno-lto'
CREW_CORE_FLAGS ||= "-O2 -pipe -ffat-lto-objects -fPIC #{CREW_ARCH_FLAGS} -fuse-ld=#{CREW_LINKER} #{CREW_LINKER_FLAGS}"
CREW_COMMON_FLAGS ||= "#{CREW_CORE_FLAGS} -flto=auto"
CREW_COMMON_FNO_LTO_FLAGS ||= "#{CREW_CORE_FLAGS} -fno-lto"
CREW_LDFLAGS ||= "-flto=auto #{CREW_LINKER_FLAGS}"
CREW_FNO_LTO_LDFLAGS ||= '-fno-lto'
CREW_ENV_OPTIONS_HASH = \
CREW_ENV_OPTIONS_HASH ||= \
if CREW_DISABLE_ENV_OPTIONS
{ 'CREW_DISABLE_ENV_OPTIONS' => '1' }
else
@@ -205,9 +225,9 @@ CREW_ENV_OPTIONS_HASH = \
end
# parse from hash to shell readable string
CREW_ENV_OPTIONS = CREW_ENV_OPTIONS_HASH.map { |k, v| "#{k}=\"#{v}\"" }.join(' ')
CREW_ENV_OPTIONS ||= CREW_ENV_OPTIONS_HASH.map { |k, v| "#{k}=\"#{v}\"" }.join(' ')
CREW_ENV_FNO_LTO_OPTIONS_HASH = {
CREW_ENV_FNO_LTO_OPTIONS_HASH ||= {
'CFLAGS' => CREW_COMMON_FNO_LTO_FLAGS,
'CXXFLAGS' => CREW_COMMON_FNO_LTO_FLAGS,
'FCFLAGS' => CREW_COMMON_FNO_LTO_FLAGS,
@@ -216,9 +236,9 @@ CREW_ENV_FNO_LTO_OPTIONS_HASH = {
'LDFLAGS' => CREW_FNO_LTO_LDFLAGS
}
# parse from hash to shell readable string
CREW_ENV_FNO_LTO_OPTIONS = CREW_ENV_FNO_LTO_OPTIONS_HASH.map { |k, v| "#{k}=\"#{v}\"" }.join(' ')
CREW_ENV_FNO_LTO_OPTIONS ||= CREW_ENV_FNO_LTO_OPTIONS_HASH.map { |k, v| "#{k}=\"#{v}\"" }.join(' ')
CREW_OPTIONS = <<~OPT.chomp
CREW_OPTIONS ||= <<~OPT.chomp
--prefix=#{CREW_PREFIX} \
--libdir=#{CREW_LIB_PREFIX} \
--mandir=#{CREW_MAN_PREFIX} \
@@ -227,7 +247,7 @@ CREW_OPTIONS = <<~OPT.chomp
--program-suffix=''
OPT
CREW_MESON_OPTIONS = <<~OPT.chomp
CREW_MESON_OPTIONS ||= <<~OPT.chomp
-Dprefix=#{CREW_PREFIX} \
-Dlibdir=#{CREW_LIB_PREFIX} \
-Dlocalstatedir=#{CREW_PREFIX}/var/local \
@@ -242,13 +262,13 @@ CREW_MESON_OPTIONS = <<~OPT.chomp
OPT
# Use ninja or samurai
CREW_NINJA = ENV.fetch('CREW_NINJA', 'ninja')
CREW_NINJA ||= ENV.fetch('CREW_NINJA', 'ninja') unless defined?(CREW_NINJA)
# Cmake sometimes wants to use LIB_SUFFIX to install libs in LIB64, so specify such for x86_64
# This is often considered deprecated. See discussio at https://gitlab.kitware.com/cmake/cmake/-/issues/18640
# and also https://bugzilla.redhat.com/show_bug.cgi?id=1425064
# Let's have two CREW_CMAKE_OPTIONS since this avoids the logic in the recipe file.
CREW_CMAKE_OPTIONS = <<~OPT.chomp
CREW_CMAKE_OPTIONS ||= <<~OPT.chomp
-DCMAKE_INSTALL_PREFIX=#{CREW_PREFIX} \
-DCMAKE_LIBRARY_PATH=#{CREW_LIB_PREFIX} \
-DCMAKE_C_FLAGS='#{CREW_COMMON_FLAGS.gsub(/-fuse-ld=.{2,4}\s/, '')}' \
@@ -260,7 +280,7 @@ CREW_CMAKE_OPTIONS = <<~OPT.chomp
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=TRUE \
-DCMAKE_BUILD_TYPE=Release
OPT
CREW_CMAKE_FNO_LTO_OPTIONS = <<~OPT.chomp
CREW_CMAKE_FNO_LTO_OPTIONS ||= <<~OPT.chomp
-DCMAKE_INSTALL_PREFIX=#{CREW_PREFIX} \
-DCMAKE_LIBRARY_PATH=#{CREW_LIB_PREFIX} \
-DCMAKE_C_FLAGS='#{CREW_COMMON_FNO_LTO_FLAGS.gsub(/-fuse-ld=.{2,4}\s/, '')}' \
@@ -272,16 +292,16 @@ CREW_CMAKE_FNO_LTO_OPTIONS = <<~OPT.chomp
-DCMAKE_BUILD_TYPE=Release
OPT
CREW_CMAKE_LIBSUFFIX_OPTIONS = "#{CREW_CMAKE_OPTIONS} -DLIB_SUFFIX=#{CREW_LIB_SUFFIX}"
CREW_CMAKE_LIBSUFFIX_OPTIONS ||= "#{CREW_CMAKE_OPTIONS} -DLIB_SUFFIX=#{CREW_LIB_SUFFIX}"
PY3_SETUP_BUILD_OPTIONS = "--executable=#{CREW_PREFIX}/bin/python3"
PY2_SETUP_BUILD_OPTIONS = "--executable=#{CREW_PREFIX}/bin/python2"
PY_SETUP_INSTALL_OPTIONS_NO_SVEM = "--root=#{CREW_DEST_DIR} --prefix=#{CREW_PREFIX} -O2 --compile"
PY_SETUP_INSTALL_OPTIONS = "#{PY_SETUP_INSTALL_OPTIONS_NO_SVEM} --single-version-externally-managed"
PY3_BUILD_OPTIONS = '--wheel --no-isolation'
PY3_INSTALLER_OPTIONS = "--destdir=#{CREW_DEST_DIR} --compile-bytecode 2 dist/*.whl"
PY3_SETUP_BUILD_OPTIONS ||= "--executable=#{CREW_PREFIX}/bin/python3"
PY2_SETUP_BUILD_OPTIONS ||= "--executable=#{CREW_PREFIX}/bin/python2"
PY_SETUP_INSTALL_OPTIONS_NO_SVEM ||= "--root=#{CREW_DEST_DIR} --prefix=#{CREW_PREFIX} -O2 --compile"
PY_SETUP_INSTALL_OPTIONS ||= "#{PY_SETUP_INSTALL_OPTIONS_NO_SVEM} --single-version-externally-managed"
PY3_BUILD_OPTIONS ||= '--wheel --no-isolation'
PY3_INSTALLER_OPTIONS ||= "--destdir=#{CREW_DEST_DIR} --compile-bytecode 2 dist/*.whl"
CREW_LICENSE = <<~LICENSESTRING
CREW_LICENSE ||= <<~LICENSESTRING
Copyright (C) 2013-2024 Chromebrew Authors
This program is free software: you can redistribute it and/or modify
@@ -302,7 +322,7 @@ CREW_LICENSE = <<~LICENSESTRING
If not, see https://github.com/docopt/docopt.rb/blob/master/LICENSE
LICENSESTRING
CREW_DOCOPT = <<~DOCOPT
CREW_DOCOPT ||= <<~DOCOPT
Chromebrew - Package manager for Chrome OS https://chromebrew.github.io
Usage:
@@ -343,4 +363,4 @@ CREW_DOCOPT = <<~DOCOPT
DOCOPT
# All available crew commands.
CREW_COMMANDS = CREW_DOCOPT.scan(/crew ([^\s]+)/).flatten.sort.join(', ').gsub('.', '')
CREW_COMMANDS ||= CREW_DOCOPT.scan(/crew ([^\s]+)/).flatten.sort.join(', ').gsub('.', '')

View File

@@ -4,30 +4,107 @@ require 'etc'
require 'json'
require_relative 'color'
require_relative 'package'
require_relative 'convenience_functions'
def require_gem(gem_name_and_require = nil, require_override = nil)
# Allow only loading gems when needed.
return if gem_name_and_require.nil?
gem_name = gem_name_and_require.split('/')[0]
begin
gem gem_name
rescue LoadError
puts " -> install #{gem_name} gem".orange
Gem.install(gem_name)
gem gem_name
end
requires = if require_override.nil?
gem_name_and_require.split('/')[1].nil? ? gem_name_and_require.split('/')[0] : gem_name_and_require
else
require_override
end
require requires
end
require_gem('highline')
# All needed constants & variables should be defined here in case they
# have not yet been loaded or fixup is being run standalone.
CREW_VERBOSE = ARGV.intersect?(%w[-v --verbose]) unless defined?(CREW_VERBOSE)
CREW_VERBOSE ||= ARGV.intersect?(%w[-v --verbose]) unless defined?(CREW_VERBOSE)
HOME = '/home/chronos/user' unless defined?(HOME)
CREW_PREFIX = '/usr/local' unless defined?(CREW_PREFIX)
CREW_LIB_PATH = File.join(CREW_PREFIX, 'lib/crew') unless defined?(CREW_LIB_PATH)
CREW_CONFIG_PATH = File.join(CREW_PREFIX, 'etc/crew') unless defined?(CREW_CONFIG_PATH)
CREW_META_PATH = File.join(CREW_CONFIG_PATH, 'meta') unless defined?(CREW_CONFIG_PATH)
CREW_PREFIX ||= '/usr/local'
CREW_LIB_PATH ||= File.join(CREW_PREFIX, 'lib/crew')
load "#{CREW_LIB_PATH}/lib/const.rb"
load "#{CREW_LIB_PATH}/lib/package.rb"
load "#{CREW_LIB_PATH}/lib/convenience_functions.rb"
CREW_CONFIG_PATH ||= File.join(CREW_PREFIX, 'etc/crew')
CREW_META_PATH ||= File.join(CREW_CONFIG_PATH, 'meta')
# via git log --reverse --oneline lib/const.rb | head -n 1
CREW_CONST_GIT_COMMIT = '72d807aac' unless defined?(CREW_CONST_GIT_COMMIT)
CREW_REPO = 'https://github.com/chromebrew/chromebrew.git' unless defined?(CREW_REPO)
CREW_BRANCH = 'master' unless defined?(CREW_BRANCH)
unless defined?(ARCH)
KERN_ARCH = Etc.uname[:machine] unless defined? KERN_ARCH
ARCH = %w[aarch64 armv8l].include?(KERN_ARCH) ? 'armv7l' : KERN_ARCH
end
LIBC_VERSION = Etc.confstr(Etc::CS_GNU_LIBC_VERSION).split.last unless defined?(LIBC_VERSION)
CREW_PACKAGES_PATH = File.join(CREW_LIB_PATH, 'packages') unless defined?(CREW_PACKAGES_PATH)
@device = ConvenienceFunctions.load_symbolized_json unless defined? @device
CREW_CONST_GIT_COMMIT ||= '72d807aac'
CREW_REPO ||= 'https://github.com/chromebrew/chromebrew.git'
CREW_BRANCH ||= 'master'
# Restart crew update as quickly as possibnle if the git commit of
# const.rb loaded in const.rb is different from the git commit of the
# potentially updated const.rb loaded here after a git pull.
unless `git -C #{CREW_LIB_PATH} log -n1 --oneline #{CREW_LIB_PATH}/lib/const.rb`.split.first == CREW_CONST_GIT_COMMIT
puts 'Restarting crew update since there is an updated crew version.'.lightcyan
puts "CREW_REPO=#{CREW_REPO} CREW_BRANCH=#{CREW_BRANCH} crew update".orange if CREW_VERBOSE
exec "CREW_REPO=#{CREW_REPO} CREW_BRANCH=#{CREW_BRANCH} crew update"
end
KERN_ARCH ||= Etc.uname[:machine]
ARCH ||= %w[aarch64 armv8l].include?(KERN_ARCH) ? 'armv7l' : KERN_ARCH
LIBC_VERSION ||= Etc.confstr(Etc::CS_GNU_LIBC_VERSION).split.last
CREW_PACKAGES_PATH ||= File.join(CREW_LIB_PATH, 'packages')
@fixup_json = JSON.load_file(File.join(CREW_CONFIG_PATH, 'device.json'))
def keep_keys(arr, keeper_keys)
keepers = keeper_keys.to_set
arr.map { |h| h.select { |k, _| keepers.include?(k) } }
end
# Use @installed_packages.include?(pkg_name) to determine if a package is
# installed.
@installed_packages = keep_keys(@fixup_json['installed_packages'], ['name']).flat_map(&:values).to_set
def save_json(json_object)
crewlog 'Saving device.json...'
begin
File.write File.join(CREW_CONFIG_PATH, 'device.json.tmp'), JSON.pretty_generate(JSON.parse(json_object.to_json))
rescue StandardError
puts 'Error writing updated packages json file!'.lightred
abort
end
# Copy over original if the write to the tmp file succeeds.
FileUtils.cp("#{CREW_CONFIG_PATH}/device.json.tmp", File.join(CREW_CONFIG_PATH, 'device.json')) && FileUtils.rm("#{CREW_CONFIG_PATH}/device.json.tmp")
end
def refresh_crew_json
if defined?(@device)
@device = if @device['architecture'].nil?
JSON.parse(@fixup_json.to_json, symbolize_names: true).transform_values! { |val| val.is_a?(String) ? val.to_sym : val }
else
JSON.parse(@fixup_json.to_json)
end
end
end
def save_essential_deps(json_object)
puts 'Determining essential dependencies from CREW_ESSENTIAL_PACKAGES...'.orange if CREW_VERBOSE
json_object['essential_deps'] ||= []
json_object['essential_deps'].concat(CREW_ESSENTIAL_PACKAGES.flat_map { |i| Package.load_package("#{i}.rb").get_deps_list }.push(*CREW_ESSENTIAL_PACKAGES).uniq.sort)
crewlog "Essential packages: #{json_object['essential_deps']}"
save_json(json_object)
refresh_crew_json
puts 'Determined compatibility & which packages are essential.'.orange if CREW_VERBOSE
end
if @fixup_json['essential_deps'].nil?
crewlog('saving essential deps because nil')
save_essential_deps(@fixup_json)
end
# remove deprecated directory
FileUtils.rm_rf "#{HOME}/.cache/crewcache/manifest"
@@ -116,95 +193,103 @@ pkg_update_arr = [
{ pkg_name: 'util_macros', pkg_rename: 'xorg_macros', pkg_deprecated: nil, comments: 'Renamed to better match upstream.' },
{ pkg_name: 'wget', pkg_rename: 'wget2', pkg_deprecated: nil, comments: 'Renamed to better match upstream.' },
{ pkg_name: 'zlibpkg', pkg_rename: 'zlib', pkg_deprecated: nil, comments: 'Renamed to better match upstream.' }
]
].to_set
pkg_update_arr.each do |pkg|
next unless @device[:installed_packages].any? { |elem| elem[:name] == pkg[:pkg_name] }
fixup_pkgs = pkg_update_arr.to_set { |h| h[:pkg_name] }
installed_fixup_packages = @installed_packages & fixup_pkgs
puts "\n#{pkg[:pkg_name].capitalize} found in package fixup list".lightcyan
# Handle package renames.
renamed_packages = false
installed_fixup_packages.each do |fixup_pkg|
working_pkg = pkg_update_arr.select { |i| i[:pkg_name] == fixup_pkg }
pkg_name = working_pkg[0][:pkg_name]
pkg_rename = working_pkg[0][:pkg_rename]
next unless pkg_rename
# Package rename.
unless pkg[:pkg_rename].to_s.empty?
puts "#{pkg[:pkg_name].capitalize} has been renamed to #{pkg[:pkg_rename].capitalize}".lightpurple
puts "#{pkg[:pkg_name].capitalize}: #{pkg[:comments]}".lightpurple unless pkg[:comments].to_s.empty?
renamed_packages = true
comments = working_pkg[0][:comments]
renamed_packages = true
puts "#{pkg_name.capitalize} has been renamed to #{pkg_rename.capitalize}. #{comments.nil? ? '' : "(#{comments})"}".lightpurple
old_filelist = File.join(CREW_META_PATH, "#{pkg[:pkg_name]}.filelist")
new_filelist = File.join(CREW_META_PATH, "#{pkg[:pkg_rename]}.filelist")
old_directorylist = File.join(CREW_META_PATH, "#{pkg[:pkg_name]}.directorylist")
new_directorylist = File.join(CREW_META_PATH, "#{pkg[:pkg_rename]}.directorylist")
# Handle case of new package already installed.
if @device[:installed_packages].any? { |elem| elem[:name] == pkg[:pkg_rename] }
puts "Renamed #{pkg[:pkg_rename].capitalize} is already installed. Deleting old package (#{pkg[:pkg_rename].capitalize}) information...".lightblue
FileUtils.rm_f old_filelist
FileUtils.rm_f old_directorylist
@device[:installed_packages].delete_if { |elem| elem[:name] == pkg[:pkg_name] }
File.write "#{CREW_CONFIG_PATH}/device.json", JSON.pretty_generate(JSON.parse(@device.to_json))
next
old_filelist = File.join(CREW_META_PATH, "#{pkg_name}.filelist")
new_filelist = File.join(CREW_META_PATH, "#{pkg_rename}.filelist")
old_directorylist = File.join(CREW_META_PATH, "#{pkg_name}.directorylist")
new_directorylist = File.join(CREW_META_PATH, "#{pkg_rename}.directorylist")
# Handle case of new package already installed.
if @installed_packages.include?(pkg_rename)
puts "Renamed #{pkg_rename.capitalize} is already installed. Deleting old package (#{pkg_rename.capitalize}) information...".lightblue
FileUtils.rm_f old_filelist
FileUtils.rm_f old_directorylist
@fixup_json['installed_packages'].delete_if { |elem| elem[:name] == pkg_name }
@installed_packages = keep_keys(@fixup_json['installed_packages'], ['name']).flat_map(&:values).to_set
if @fixup_json['essential_deps'].include?(pkg_rename)
crewlog("Running save_essential_deps because essential deps contained #{pkg_name}")
save_essential_deps(@fixup_json)
## save_json(@fixup_json)
## @fixup_json = JSON.load_file(File.join(CREW_CONFIG_PATH, 'device.json'))
end
# Handle case of package needing to be replaced.
if File.file?(new_filelist)
puts "new filelist for #{pkg[:pkg_rename].capitalize} already exists!"
next
end
if File.file?(new_directorylist)
puts "new directorylist for #{pkg[:pkg_rename].capitalize} already exists!"
next
end
# If new filelist or directorylist do not exist and new package is not
# marked as installed in device.json then rename and edit device.json .
begin
FileUtils.cp "#{CREW_CONFIG_PATH}/device.json", "#{CREW_CONFIG_PATH}/device.json.bak"
FileUtils.mv old_filelist, new_filelist
FileUtils.mv old_directorylist, new_directorylist
@device[:installed_packages].map do |x|
x[:name] = pkg[:pkg_rename] if x[:name] == pkg[:pkg_name]
next x
end
File.write "#{CREW_CONFIG_PATH}/device.json.new", JSON.pretty_generate(JSON.parse(@device.to_json))
@device = JSON.load_file(File.join(CREW_CONFIG_PATH, 'device.json.new'), symbolize_names: true).transform_values! { |val| val.is_a?(String) ? val.to_sym : val }
raise StandardError, 'Failed to replace pkg name...'.lightred unless @device[:installed_packages].any? { |elem| elem[:name] == pkg[:pkg_rename] }
# Ok to write working device.json
File.write "#{CREW_CONFIG_PATH}/device.json", JSON.pretty_generate(JSON.parse(@device.to_json))
puts "#{pkg[:pkg_name].capitalize} renamed to #{pkg[:pkg_rename].capitalize}".lightgreen
rescue StandardError
puts 'Restoring old filelist, directorylist, and device.json...'.lightred
FileUtils.mv new_filelist, old_filelist
FileUtils.mv new_directorylist, old_directorylist
FileUtils.cp "#{CREW_CONFIG_PATH}/device.json.bak", "#{CREW_CONFIG_PATH}/device.json"
end
# Reload json file.
@device = JSON.load_file(File.join(CREW_CONFIG_PATH, 'device.json'), symbolize_names: true).transform_values! { |val| val.is_a?(String) ? val.to_sym : val }
# Ok to remove backup and temporary json files.
FileUtils.rm_f "#{CREW_CONFIG_PATH}/device.json.bak"
FileUtils.rm_f "#{CREW_CONFIG_PATH}/device.json.new"
next
end
# Handle case of package needing to be replaced.
if File.file?(new_filelist)
puts "new filelist for #{pkg_rename.capitalize} already exists!"
next
end
if File.file?(new_directorylist)
puts "new directorylist for #{pkg_rename.capitalize} already exists!"
next
end
# If new filelist or directorylist do not exist and new package is not
# marked as installed in device.json then rename and edit json.
FileUtils.mv old_filelist, new_filelist
FileUtils.mv old_directorylist, new_directorylist
@fixup_json['installed_packages'].find { |h| h['name'] == pkg_name }
@fixup_json['installed_packages'].find { |h| h['name'] == pkg_name }['name'] = pkg_rename
@fixup_json['compatible_packages'].find { |h| h['name'] == pkg_name }
@fixup_json['compatible_packages'].find { |h| h['name'] == pkg_name }['name'] = pkg_rename
## save_json(@fixup_json)
## next unless @fixup_json['essential_deps'].include?(pkg_rename)
## save_essential_deps(@fixup_json)
## save_json(@fixup_json)
## @fixup_json = JSON.load_file(File.join(CREW_CONFIG_PATH, 'device.json'))
## save_json(@fixup_json)
end
# Deprecated package deletion.
next if pkg[:pkg_deprecated].to_s.empty?
puts "#{pkg[:pkg_name].capitalize} is deprecated and should be removed.".lightpurple
puts "#{pkg[:pkg_name].capitalize}: #{pkg[:comments]}".lightpurple unless pkg[:comments].to_s.empty?
if Package.agree_default_yes("\nWould you like to remove deprecated package #{pkg[:pkg_name].capitalize}")
if renamed_packages
@installed_packages = keep_keys(@fixup_json['installed_packages'], ['name']).flat_map(&:values).to_set
save_json(@fixup_json)
refresh_crew_json
end
# Handle deprecated package deletions.
deprecate_packages = false
installed_fixup_packages.each do |fixup_pkg|
working_pkg = pkg_update_arr.select { |i| i[:pkg_name] == fixup_pkg }
delete_package = working_pkg[0][:pkg_deprecated]
next unless delete_package
deprecate_packages = true
pkg_name = working_pkg[0][:pkg_name]
comments = working_pkg[0][:comments]
puts "#{pkg_name.capitalize} is deprecated and should be removed. #{comments.nil? ? '' : "(#{comments})"}".lightpurple
if Package.agree_default_yes("\nWould you like to remove deprecated package #{pkg_name.capitalize}")
# Create a minimal Package object and pass it to Command.remove
pkg_object = Package
pkg_object.instance_eval do
self.name = pkg[:pkg_name]
self.name = pkg_name
def self.preremove; end
def self.postremove; end
end
Command.remove(pkg_object, CREW_VERBOSE)
else
puts "#{pkg[:pkg_name].capitalize} not removed.".lightblue
puts "#{pkg_name.capitalize} not removed.".lightblue
end
end
# Restart crew update if the git commit of const.rb loaded in const.rb
# is different from the git commit of the potentially updated const.rb
# loaded here after a git pull.
unless `git -C #{CREW_LIB_PATH} log -n1 --oneline #{CREW_LIB_PATH}/lib/const.rb`.split.first == CREW_CONST_GIT_COMMIT
puts 'Restarting crew update since there is an updated crew version.'.lightcyan
puts "CREW_REPO=#{CREW_REPO} CREW_BRANCH=#{CREW_BRANCH} crew update".orange if CREW_VERBOSE
exec "CREW_REPO=#{CREW_REPO} CREW_BRANCH=#{CREW_BRANCH} crew update"
# Reload json after all external fixups are done, as there may have been external changes.
if deprecate_packages
@fixup_json = JSON.load_file(File.join(CREW_CONFIG_PATH, 'device.json')) if deprecate_packages
@installed_packages = keep_keys(@fixup_json['installed_packages'], ['name']).flat_map(&:values).to_set
refresh_crew_json
end
# Remove pagerenv tmp file in CREW_PACKAGES_PATH if it exists
@@ -235,3 +320,6 @@ if (ARCH == 'x86_64') && (Gem::Version.new(LIBC_VERSION.to_s) >= Gem::Version.ne
end
end
end
# Reload @device with the appropriate symbolized or nonsymbolized json load before we exit fixup.
refresh_crew_json

View File

@@ -24,10 +24,10 @@ def require_gem(gem_name_and_require = nil, require_override = nil)
end
require requires
end
require_gem 'highline'
def agree_with_default(yes_or_no_question_msg, character = nil, default:)
yes_or_no_question = yes_or_no_question_msg.lightpurple
require_gem('highline')
answer_type = ->(yn) { yn.downcase[0] == 'y' || (yn.empty? && default.downcase[0] == 'y') }
HighLine.ask(yes_or_no_question, answer_type) do |q|

View File

@@ -769,6 +769,7 @@
/usr/local/lib/libm.so.6
/usr/local/lib/libmcheck.a
/usr/local/lib/libmemusage.so
/usr/local/lib/libnsl.so.2
/usr/local/lib/libnss_compat.so
/usr/local/lib/libnss_compat.so.2
/usr/local/lib/libnss_db.so

View File

@@ -725,12 +725,96 @@
/usr/local/share/i18n/charmaps/VISCII.gz
/usr/local/share/i18n/charmaps/WINDOWS-31J.gz
/usr/local/share/i18n/locales/C
/usr/local/share/i18n/locales/POSIX
/usr/local/share/i18n/locales/aa_DJ
/usr/local/share/i18n/locales/aa_ER
/usr/local/share/i18n/locales/aa_ER@saaho
/usr/local/share/i18n/locales/aa_ET
/usr/local/share/i18n/locales/ab_GE
/usr/local/share/i18n/locales/af_ZA
/usr/local/share/i18n/locales/agr_PE
/usr/local/share/i18n/locales/ak_GH
/usr/local/share/i18n/locales/am_ET
/usr/local/share/i18n/locales/an_ES
/usr/local/share/i18n/locales/anp_IN
/usr/local/share/i18n/locales/ar_AE
/usr/local/share/i18n/locales/ar_BH
/usr/local/share/i18n/locales/ar_DZ
/usr/local/share/i18n/locales/ar_EG
/usr/local/share/i18n/locales/ar_IN
/usr/local/share/i18n/locales/ar_IQ
/usr/local/share/i18n/locales/ar_JO
/usr/local/share/i18n/locales/ar_KW
/usr/local/share/i18n/locales/ar_LB
/usr/local/share/i18n/locales/ar_LY
/usr/local/share/i18n/locales/ar_MA
/usr/local/share/i18n/locales/ar_OM
/usr/local/share/i18n/locales/ar_QA
/usr/local/share/i18n/locales/ar_SA
/usr/local/share/i18n/locales/ar_SD
/usr/local/share/i18n/locales/ar_SS
/usr/local/share/i18n/locales/ar_SY
/usr/local/share/i18n/locales/ar_TN
/usr/local/share/i18n/locales/ar_YE
/usr/local/share/i18n/locales/as_IN
/usr/local/share/i18n/locales/ast_ES
/usr/local/share/i18n/locales/ayc_PE
/usr/local/share/i18n/locales/az_AZ
/usr/local/share/i18n/locales/az_IR
/usr/local/share/i18n/locales/be_BY
/usr/local/share/i18n/locales/be_BY@latin
/usr/local/share/i18n/locales/bem_ZM
/usr/local/share/i18n/locales/ber_DZ
/usr/local/share/i18n/locales/ber_MA
/usr/local/share/i18n/locales/bg_BG
/usr/local/share/i18n/locales/bhb_IN
/usr/local/share/i18n/locales/bho_IN
/usr/local/share/i18n/locales/bho_NP
/usr/local/share/i18n/locales/bi_VU
/usr/local/share/i18n/locales/bn_BD
/usr/local/share/i18n/locales/bn_IN
/usr/local/share/i18n/locales/bo_CN
/usr/local/share/i18n/locales/bo_IN
/usr/local/share/i18n/locales/br_FR
/usr/local/share/i18n/locales/br_FR@euro
/usr/local/share/i18n/locales/brx_IN
/usr/local/share/i18n/locales/bs_BA
/usr/local/share/i18n/locales/byn_ER
/usr/local/share/i18n/locales/ca_AD
/usr/local/share/i18n/locales/ca_ES
/usr/local/share/i18n/locales/ca_ES@euro
/usr/local/share/i18n/locales/ca_ES@valencia
/usr/local/share/i18n/locales/ca_FR
/usr/local/share/i18n/locales/ca_IT
/usr/local/share/i18n/locales/ce_RU
/usr/local/share/i18n/locales/chr_US
/usr/local/share/i18n/locales/ckb_IQ
/usr/local/share/i18n/locales/cmn_TW
/usr/local/share/i18n/locales/cns11643_stroke
/usr/local/share/i18n/locales/crh_UA
/usr/local/share/i18n/locales/cs_CZ
/usr/local/share/i18n/locales/csb_PL
/usr/local/share/i18n/locales/cv_RU
/usr/local/share/i18n/locales/cy_GB
/usr/local/share/i18n/locales/da_DK
/usr/local/share/i18n/locales/de_AT
/usr/local/share/i18n/locales/de_AT@euro
/usr/local/share/i18n/locales/de_BE
/usr/local/share/i18n/locales/de_BE@euro
/usr/local/share/i18n/locales/de_CH
/usr/local/share/i18n/locales/de_DE
/usr/local/share/i18n/locales/de_DE@euro
/usr/local/share/i18n/locales/de_IT
/usr/local/share/i18n/locales/de_LI
/usr/local/share/i18n/locales/de_LU
/usr/local/share/i18n/locales/de_LU@euro
/usr/local/share/i18n/locales/doi_IN
/usr/local/share/i18n/locales/dsb_DE
/usr/local/share/i18n/locales/dv_MV
/usr/local/share/i18n/locales/dz_BT
/usr/local/share/i18n/locales/el_CY
/usr/local/share/i18n/locales/el_GR
/usr/local/share/i18n/locales/el_GR@euro
/usr/local/share/i18n/locales/en_AG
/usr/local/share/i18n/locales/en_AU
/usr/local/share/i18n/locales/en_BW
@@ -751,36 +835,254 @@
/usr/local/share/i18n/locales/en_ZA
/usr/local/share/i18n/locales/en_ZM
/usr/local/share/i18n/locales/en_ZW
/usr/local/share/i18n/locales/eo
/usr/local/share/i18n/locales/es_AR
/usr/local/share/i18n/locales/es_BO
/usr/local/share/i18n/locales/es_CL
/usr/local/share/i18n/locales/es_CO
/usr/local/share/i18n/locales/es_CR
/usr/local/share/i18n/locales/es_CU
/usr/local/share/i18n/locales/es_DO
/usr/local/share/i18n/locales/es_EC
/usr/local/share/i18n/locales/es_ES
/usr/local/share/i18n/locales/es_ES@euro
/usr/local/share/i18n/locales/es_GT
/usr/local/share/i18n/locales/es_HN
/usr/local/share/i18n/locales/es_MX
/usr/local/share/i18n/locales/es_NI
/usr/local/share/i18n/locales/es_PA
/usr/local/share/i18n/locales/es_PE
/usr/local/share/i18n/locales/es_PR
/usr/local/share/i18n/locales/es_PY
/usr/local/share/i18n/locales/es_SV
/usr/local/share/i18n/locales/es_US
/usr/local/share/i18n/locales/es_UY
/usr/local/share/i18n/locales/es_VE
/usr/local/share/i18n/locales/et_EE
/usr/local/share/i18n/locales/eu_ES
/usr/local/share/i18n/locales/eu_ES@euro
/usr/local/share/i18n/locales/fa_IR
/usr/local/share/i18n/locales/ff_SN
/usr/local/share/i18n/locales/fi_FI
/usr/local/share/i18n/locales/fi_FI@euro
/usr/local/share/i18n/locales/fil_PH
/usr/local/share/i18n/locales/fo_FO
/usr/local/share/i18n/locales/fr_BE
/usr/local/share/i18n/locales/fr_BE@euro
/usr/local/share/i18n/locales/fr_CA
/usr/local/share/i18n/locales/fr_CH
/usr/local/share/i18n/locales/fr_FR
/usr/local/share/i18n/locales/fr_FR@euro
/usr/local/share/i18n/locales/fr_LU
/usr/local/share/i18n/locales/fr_LU@euro
/usr/local/share/i18n/locales/fur_IT
/usr/local/share/i18n/locales/fy_DE
/usr/local/share/i18n/locales/fy_NL
/usr/local/share/i18n/locales/ga_IE
/usr/local/share/i18n/locales/ga_IE@euro
/usr/local/share/i18n/locales/gd_GB
/usr/local/share/i18n/locales/gez_ER
/usr/local/share/i18n/locales/gez_ER@abegede
/usr/local/share/i18n/locales/gez_ET
/usr/local/share/i18n/locales/gez_ET@abegede
/usr/local/share/i18n/locales/gl_ES
/usr/local/share/i18n/locales/gl_ES@euro
/usr/local/share/i18n/locales/gu_IN
/usr/local/share/i18n/locales/gv_GB
/usr/local/share/i18n/locales/ha_NG
/usr/local/share/i18n/locales/hak_TW
/usr/local/share/i18n/locales/he_IL
/usr/local/share/i18n/locales/hi_IN
/usr/local/share/i18n/locales/hif_FJ
/usr/local/share/i18n/locales/hne_IN
/usr/local/share/i18n/locales/hr_HR
/usr/local/share/i18n/locales/hsb_DE
/usr/local/share/i18n/locales/ht_HT
/usr/local/share/i18n/locales/hu_HU
/usr/local/share/i18n/locales/hy_AM
/usr/local/share/i18n/locales/i18n
/usr/local/share/i18n/locales/i18n_ctype
/usr/local/share/i18n/locales/ia_FR
/usr/local/share/i18n/locales/id_ID
/usr/local/share/i18n/locales/ig_NG
/usr/local/share/i18n/locales/ik_CA
/usr/local/share/i18n/locales/is_IS
/usr/local/share/i18n/locales/iso14651_t1
/usr/local/share/i18n/locales/iso14651_t1_common
/usr/local/share/i18n/locales/iso14651_t1_pinyin
/usr/local/share/i18n/locales/it_CH
/usr/local/share/i18n/locales/it_IT
/usr/local/share/i18n/locales/it_IT@euro
/usr/local/share/i18n/locales/iu_CA
/usr/local/share/i18n/locales/ja_JP
/usr/local/share/i18n/locales/ka_GE
/usr/local/share/i18n/locales/kab_DZ
/usr/local/share/i18n/locales/kk_KZ
/usr/local/share/i18n/locales/kl_GL
/usr/local/share/i18n/locales/km_KH
/usr/local/share/i18n/locales/kn_IN
/usr/local/share/i18n/locales/ko_KR
/usr/local/share/i18n/locales/kok_IN
/usr/local/share/i18n/locales/ks_IN
/usr/local/share/i18n/locales/ks_IN@devanagari
/usr/local/share/i18n/locales/ku_TR
/usr/local/share/i18n/locales/kw_GB
/usr/local/share/i18n/locales/ky_KG
/usr/local/share/i18n/locales/lb_LU
/usr/local/share/i18n/locales/lg_UG
/usr/local/share/i18n/locales/li_BE
/usr/local/share/i18n/locales/li_NL
/usr/local/share/i18n/locales/lij_IT
/usr/local/share/i18n/locales/ln_CD
/usr/local/share/i18n/locales/lo_LA
/usr/local/share/i18n/locales/lt_LT
/usr/local/share/i18n/locales/lv_LV
/usr/local/share/i18n/locales/lzh_TW
/usr/local/share/i18n/locales/mag_IN
/usr/local/share/i18n/locales/mai_IN
/usr/local/share/i18n/locales/mai_NP
/usr/local/share/i18n/locales/mfe_MU
/usr/local/share/i18n/locales/mg_MG
/usr/local/share/i18n/locales/mhr_RU
/usr/local/share/i18n/locales/mi_NZ
/usr/local/share/i18n/locales/miq_NI
/usr/local/share/i18n/locales/mjw_IN
/usr/local/share/i18n/locales/mk_MK
/usr/local/share/i18n/locales/ml_IN
/usr/local/share/i18n/locales/mn_MN
/usr/local/share/i18n/locales/mni_IN
/usr/local/share/i18n/locales/mnw_MM
/usr/local/share/i18n/locales/mr_IN
/usr/local/share/i18n/locales/ms_MY
/usr/local/share/i18n/locales/mt_MT
/usr/local/share/i18n/locales/my_MM
/usr/local/share/i18n/locales/nan_TW
/usr/local/share/i18n/locales/nan_TW@latin
/usr/local/share/i18n/locales/nb_NO
/usr/local/share/i18n/locales/nds_DE
/usr/local/share/i18n/locales/nds_NL
/usr/local/share/i18n/locales/ne_NP
/usr/local/share/i18n/locales/nhn_MX
/usr/local/share/i18n/locales/niu_NU
/usr/local/share/i18n/locales/niu_NZ
/usr/local/share/i18n/locales/nl_AW
/usr/local/share/i18n/locales/nl_BE
/usr/local/share/i18n/locales/nl_BE@euro
/usr/local/share/i18n/locales/nl_NL
/usr/local/share/i18n/locales/nl_NL@euro
/usr/local/share/i18n/locales/nn_NO
/usr/local/share/i18n/locales/nr_ZA
/usr/local/share/i18n/locales/nso_ZA
/usr/local/share/i18n/locales/oc_FR
/usr/local/share/i18n/locales/om_ET
/usr/local/share/i18n/locales/om_KE
/usr/local/share/i18n/locales/or_IN
/usr/local/share/i18n/locales/os_RU
/usr/local/share/i18n/locales/pa_IN
/usr/local/share/i18n/locales/pa_PK
/usr/local/share/i18n/locales/pap_AW
/usr/local/share/i18n/locales/pap_CW
/usr/local/share/i18n/locales/pl_PL
/usr/local/share/i18n/locales/ps_AF
/usr/local/share/i18n/locales/pt_BR
/usr/local/share/i18n/locales/pt_PT
/usr/local/share/i18n/locales/pt_PT@euro
/usr/local/share/i18n/locales/quz_PE
/usr/local/share/i18n/locales/raj_IN
/usr/local/share/i18n/locales/rif_MA
/usr/local/share/i18n/locales/ro_RO
/usr/local/share/i18n/locales/ru_RU
/usr/local/share/i18n/locales/ru_UA
/usr/local/share/i18n/locales/rw_RW
/usr/local/share/i18n/locales/sa_IN
/usr/local/share/i18n/locales/sah_RU
/usr/local/share/i18n/locales/sat_IN
/usr/local/share/i18n/locales/sc_IT
/usr/local/share/i18n/locales/sd_IN
/usr/local/share/i18n/locales/sd_IN@devanagari
/usr/local/share/i18n/locales/se_NO
/usr/local/share/i18n/locales/sgs_LT
/usr/local/share/i18n/locales/shn_MM
/usr/local/share/i18n/locales/shs_CA
/usr/local/share/i18n/locales/si_LK
/usr/local/share/i18n/locales/sid_ET
/usr/local/share/i18n/locales/sk_SK
/usr/local/share/i18n/locales/sl_SI
/usr/local/share/i18n/locales/sm_WS
/usr/local/share/i18n/locales/so_DJ
/usr/local/share/i18n/locales/so_ET
/usr/local/share/i18n/locales/so_KE
/usr/local/share/i18n/locales/so_SO
/usr/local/share/i18n/locales/sq_AL
/usr/local/share/i18n/locales/sq_MK
/usr/local/share/i18n/locales/sr_ME
/usr/local/share/i18n/locales/sr_RS
/usr/local/share/i18n/locales/sr_RS@latin
/usr/local/share/i18n/locales/ss_ZA
/usr/local/share/i18n/locales/st_ZA
/usr/local/share/i18n/locales/sv_FI
/usr/local/share/i18n/locales/sv_FI@euro
/usr/local/share/i18n/locales/sv_SE
/usr/local/share/i18n/locales/sw_KE
/usr/local/share/i18n/locales/sw_TZ
/usr/local/share/i18n/locales/syr
/usr/local/share/i18n/locales/szl_PL
/usr/local/share/i18n/locales/ta_IN
/usr/local/share/i18n/locales/ta_LK
/usr/local/share/i18n/locales/tcy_IN
/usr/local/share/i18n/locales/te_IN
/usr/local/share/i18n/locales/tg_TJ
/usr/local/share/i18n/locales/th_TH
/usr/local/share/i18n/locales/the_NP
/usr/local/share/i18n/locales/ti_ER
/usr/local/share/i18n/locales/ti_ET
/usr/local/share/i18n/locales/tig_ER
/usr/local/share/i18n/locales/tk_TM
/usr/local/share/i18n/locales/tl_PH
/usr/local/share/i18n/locales/tn_ZA
/usr/local/share/i18n/locales/to_TO
/usr/local/share/i18n/locales/tpi_PG
/usr/local/share/i18n/locales/tr_CY
/usr/local/share/i18n/locales/tr_TR
/usr/local/share/i18n/locales/translit_circle
/usr/local/share/i18n/locales/translit_cjk_compat
/usr/local/share/i18n/locales/translit_cjk_variants
/usr/local/share/i18n/locales/translit_combining
/usr/local/share/i18n/locales/translit_compat
/usr/local/share/i18n/locales/translit_font
/usr/local/share/i18n/locales/translit_fraction
/usr/local/share/i18n/locales/translit_hangul
/usr/local/share/i18n/locales/translit_narrow
/usr/local/share/i18n/locales/translit_neutral
/usr/local/share/i18n/locales/translit_small
/usr/local/share/i18n/locales/translit_wide
/usr/local/share/i18n/locales/ts_ZA
/usr/local/share/i18n/locales/tt_RU
/usr/local/share/i18n/locales/tt_RU@iqtelif
/usr/local/share/i18n/locales/ug_CN
/usr/local/share/i18n/locales/uk_UA
/usr/local/share/i18n/locales/unm_US
/usr/local/share/i18n/locales/ur_IN
/usr/local/share/i18n/locales/ur_PK
/usr/local/share/i18n/locales/uz_UZ
/usr/local/share/i18n/locales/uz_UZ@cyrillic
/usr/local/share/i18n/locales/ve_ZA
/usr/local/share/i18n/locales/vi_VN
/usr/local/share/i18n/locales/wa_BE
/usr/local/share/i18n/locales/wa_BE@euro
/usr/local/share/i18n/locales/wae_CH
/usr/local/share/i18n/locales/wal_ET
/usr/local/share/i18n/locales/wo_SN
/usr/local/share/i18n/locales/xh_ZA
/usr/local/share/i18n/locales/yi_US
/usr/local/share/i18n/locales/yo_NG
/usr/local/share/i18n/locales/yue_HK
/usr/local/share/i18n/locales/yuw_PG
/usr/local/share/i18n/locales/zh_CN
/usr/local/share/i18n/locales/zh_HK
/usr/local/share/i18n/locales/zh_SG
/usr/local/share/i18n/locales/zh_TW
/usr/local/share/i18n/locales/zu_ZA
/usr/local/share/info/libc.info-1.zst
/usr/local/share/info/libc.info-10.zst
/usr/local/share/info/libc.info-11.zst
@@ -800,7 +1102,43 @@
/usr/local/share/info/libc.info-8.zst
/usr/local/share/info/libc.info-9.zst
/usr/local/share/info/libc.info.zst
/usr/local/share/locale/be/LC_MESSAGES/libc.mo
/usr/local/share/locale/bg/LC_MESSAGES/libc.mo
/usr/local/share/locale/ca/LC_MESSAGES/libc.mo
/usr/local/share/locale/cs/LC_MESSAGES/libc.mo
/usr/local/share/locale/da/LC_MESSAGES/libc.mo
/usr/local/share/locale/de/LC_MESSAGES/libc.mo
/usr/local/share/locale/el/LC_MESSAGES/libc.mo
/usr/local/share/locale/en_GB/LC_MESSAGES/libc.mo
/usr/local/share/locale/eo/LC_MESSAGES/libc.mo
/usr/local/share/locale/es/LC_MESSAGES/libc.mo
/usr/local/share/locale/fi/LC_MESSAGES/libc.mo
/usr/local/share/locale/fr/LC_MESSAGES/libc.mo
/usr/local/share/locale/gl/LC_MESSAGES/libc.mo
/usr/local/share/locale/hr/LC_MESSAGES/libc.mo
/usr/local/share/locale/hu/LC_MESSAGES/libc.mo
/usr/local/share/locale/ia/LC_MESSAGES/libc.mo
/usr/local/share/locale/id/LC_MESSAGES/libc.mo
/usr/local/share/locale/it/LC_MESSAGES/libc.mo
/usr/local/share/locale/ja/LC_MESSAGES/libc.mo
/usr/local/share/locale/ka/LC_MESSAGES/libc.mo
/usr/local/share/locale/ko/LC_MESSAGES/libc.mo
/usr/local/share/locale/locale.alias
/usr/local/share/locale/lt/LC_MESSAGES/libc.mo
/usr/local/share/locale/nb/LC_MESSAGES/libc.mo
/usr/local/share/locale/nl/LC_MESSAGES/libc.mo
/usr/local/share/locale/pl/LC_MESSAGES/libc.mo
/usr/local/share/locale/pt/LC_MESSAGES/libc.mo
/usr/local/share/locale/pt_BR/LC_MESSAGES/libc.mo
/usr/local/share/locale/ru/LC_MESSAGES/libc.mo
/usr/local/share/locale/rw/LC_MESSAGES/libc.mo
/usr/local/share/locale/sk/LC_MESSAGES/libc.mo
/usr/local/share/locale/sl/LC_MESSAGES/libc.mo
/usr/local/share/locale/sr/LC_MESSAGES/libc.mo
/usr/local/share/locale/sv/LC_MESSAGES/libc.mo
/usr/local/share/locale/tr/LC_MESSAGES/libc.mo
/usr/local/share/locale/uk/LC_MESSAGES/libc.mo
/usr/local/share/locale/vi/LC_MESSAGES/libc.mo
/usr/local/share/locale/zh_CN/LC_MESSAGES/libc.mo
/usr/local/share/locale/zh_TW/LC_MESSAGES/libc.mo
/usr/local/var/db/Makefile

View File

@@ -288,6 +288,7 @@
/usr/local/lib/libm.so.6
/usr/local/lib/libmemusage.so
/usr/local/lib/libmvec.so.1
/usr/local/lib/libnsl.so.2
/usr/local/lib/libnss_compat.so
/usr/local/lib/libnss_compat.so.2
/usr/local/lib/libnss_db.so

View File

@@ -754,6 +754,7 @@
/usr/local/lib64/gcrt1.o
/usr/local/lib64/grcrt1.o
/usr/local/lib64/ld-linux-x86-64.so.2
/usr/local/lib64/ld-lsb-x86-64.so.3
/usr/local/lib64/libBrokenLocale.a
/usr/local/lib64/libBrokenLocale.so
/usr/local/lib64/libBrokenLocale.so.1
@@ -770,6 +771,9 @@
/usr/local/lib64/libcrypt.a
/usr/local/lib64/libcrypt.so
/usr/local/lib64/libcrypt.so.1
/usr/local/lib64/libcrypt.so.1.1.0
/usr/local/lib64/libcrypt.so.2
/usr/local/lib64/libcrypt.so.2.0.0
/usr/local/lib64/libdl.a
/usr/local/lib64/libdl.so.2
/usr/local/lib64/libg.a
@@ -782,6 +786,7 @@
/usr/local/lib64/libmvec.a
/usr/local/lib64/libmvec.so
/usr/local/lib64/libmvec.so.1
/usr/local/lib64/libnsl.so.2
/usr/local/lib64/libnss_compat.so
/usr/local/lib64/libnss_compat.so.2
/usr/local/lib64/libnss_db.so

View File

@@ -733,12 +733,96 @@
/usr/local/share/i18n/charmaps/VISCII.gz
/usr/local/share/i18n/charmaps/WINDOWS-31J.gz
/usr/local/share/i18n/locales/C
/usr/local/share/i18n/locales/POSIX
/usr/local/share/i18n/locales/aa_DJ
/usr/local/share/i18n/locales/aa_ER
/usr/local/share/i18n/locales/aa_ER@saaho
/usr/local/share/i18n/locales/aa_ET
/usr/local/share/i18n/locales/ab_GE
/usr/local/share/i18n/locales/af_ZA
/usr/local/share/i18n/locales/agr_PE
/usr/local/share/i18n/locales/ak_GH
/usr/local/share/i18n/locales/am_ET
/usr/local/share/i18n/locales/an_ES
/usr/local/share/i18n/locales/anp_IN
/usr/local/share/i18n/locales/ar_AE
/usr/local/share/i18n/locales/ar_BH
/usr/local/share/i18n/locales/ar_DZ
/usr/local/share/i18n/locales/ar_EG
/usr/local/share/i18n/locales/ar_IN
/usr/local/share/i18n/locales/ar_IQ
/usr/local/share/i18n/locales/ar_JO
/usr/local/share/i18n/locales/ar_KW
/usr/local/share/i18n/locales/ar_LB
/usr/local/share/i18n/locales/ar_LY
/usr/local/share/i18n/locales/ar_MA
/usr/local/share/i18n/locales/ar_OM
/usr/local/share/i18n/locales/ar_QA
/usr/local/share/i18n/locales/ar_SA
/usr/local/share/i18n/locales/ar_SD
/usr/local/share/i18n/locales/ar_SS
/usr/local/share/i18n/locales/ar_SY
/usr/local/share/i18n/locales/ar_TN
/usr/local/share/i18n/locales/ar_YE
/usr/local/share/i18n/locales/as_IN
/usr/local/share/i18n/locales/ast_ES
/usr/local/share/i18n/locales/ayc_PE
/usr/local/share/i18n/locales/az_AZ
/usr/local/share/i18n/locales/az_IR
/usr/local/share/i18n/locales/be_BY
/usr/local/share/i18n/locales/be_BY@latin
/usr/local/share/i18n/locales/bem_ZM
/usr/local/share/i18n/locales/ber_DZ
/usr/local/share/i18n/locales/ber_MA
/usr/local/share/i18n/locales/bg_BG
/usr/local/share/i18n/locales/bhb_IN
/usr/local/share/i18n/locales/bho_IN
/usr/local/share/i18n/locales/bho_NP
/usr/local/share/i18n/locales/bi_VU
/usr/local/share/i18n/locales/bn_BD
/usr/local/share/i18n/locales/bn_IN
/usr/local/share/i18n/locales/bo_CN
/usr/local/share/i18n/locales/bo_IN
/usr/local/share/i18n/locales/br_FR
/usr/local/share/i18n/locales/br_FR@euro
/usr/local/share/i18n/locales/brx_IN
/usr/local/share/i18n/locales/bs_BA
/usr/local/share/i18n/locales/byn_ER
/usr/local/share/i18n/locales/ca_AD
/usr/local/share/i18n/locales/ca_ES
/usr/local/share/i18n/locales/ca_ES@euro
/usr/local/share/i18n/locales/ca_ES@valencia
/usr/local/share/i18n/locales/ca_FR
/usr/local/share/i18n/locales/ca_IT
/usr/local/share/i18n/locales/ce_RU
/usr/local/share/i18n/locales/chr_US
/usr/local/share/i18n/locales/ckb_IQ
/usr/local/share/i18n/locales/cmn_TW
/usr/local/share/i18n/locales/cns11643_stroke
/usr/local/share/i18n/locales/crh_UA
/usr/local/share/i18n/locales/cs_CZ
/usr/local/share/i18n/locales/csb_PL
/usr/local/share/i18n/locales/cv_RU
/usr/local/share/i18n/locales/cy_GB
/usr/local/share/i18n/locales/da_DK
/usr/local/share/i18n/locales/de_AT
/usr/local/share/i18n/locales/de_AT@euro
/usr/local/share/i18n/locales/de_BE
/usr/local/share/i18n/locales/de_BE@euro
/usr/local/share/i18n/locales/de_CH
/usr/local/share/i18n/locales/de_DE
/usr/local/share/i18n/locales/de_DE@euro
/usr/local/share/i18n/locales/de_IT
/usr/local/share/i18n/locales/de_LI
/usr/local/share/i18n/locales/de_LU
/usr/local/share/i18n/locales/de_LU@euro
/usr/local/share/i18n/locales/doi_IN
/usr/local/share/i18n/locales/dsb_DE
/usr/local/share/i18n/locales/dv_MV
/usr/local/share/i18n/locales/dz_BT
/usr/local/share/i18n/locales/el_CY
/usr/local/share/i18n/locales/el_GR
/usr/local/share/i18n/locales/el_GR@euro
/usr/local/share/i18n/locales/en_AG
/usr/local/share/i18n/locales/en_AU
/usr/local/share/i18n/locales/en_BW
@@ -759,36 +843,254 @@
/usr/local/share/i18n/locales/en_ZA
/usr/local/share/i18n/locales/en_ZM
/usr/local/share/i18n/locales/en_ZW
/usr/local/share/i18n/locales/eo
/usr/local/share/i18n/locales/es_AR
/usr/local/share/i18n/locales/es_BO
/usr/local/share/i18n/locales/es_CL
/usr/local/share/i18n/locales/es_CO
/usr/local/share/i18n/locales/es_CR
/usr/local/share/i18n/locales/es_CU
/usr/local/share/i18n/locales/es_DO
/usr/local/share/i18n/locales/es_EC
/usr/local/share/i18n/locales/es_ES
/usr/local/share/i18n/locales/es_ES@euro
/usr/local/share/i18n/locales/es_GT
/usr/local/share/i18n/locales/es_HN
/usr/local/share/i18n/locales/es_MX
/usr/local/share/i18n/locales/es_NI
/usr/local/share/i18n/locales/es_PA
/usr/local/share/i18n/locales/es_PE
/usr/local/share/i18n/locales/es_PR
/usr/local/share/i18n/locales/es_PY
/usr/local/share/i18n/locales/es_SV
/usr/local/share/i18n/locales/es_US
/usr/local/share/i18n/locales/es_UY
/usr/local/share/i18n/locales/es_VE
/usr/local/share/i18n/locales/et_EE
/usr/local/share/i18n/locales/eu_ES
/usr/local/share/i18n/locales/eu_ES@euro
/usr/local/share/i18n/locales/fa_IR
/usr/local/share/i18n/locales/ff_SN
/usr/local/share/i18n/locales/fi_FI
/usr/local/share/i18n/locales/fi_FI@euro
/usr/local/share/i18n/locales/fil_PH
/usr/local/share/i18n/locales/fo_FO
/usr/local/share/i18n/locales/fr_BE
/usr/local/share/i18n/locales/fr_BE@euro
/usr/local/share/i18n/locales/fr_CA
/usr/local/share/i18n/locales/fr_CH
/usr/local/share/i18n/locales/fr_FR
/usr/local/share/i18n/locales/fr_FR@euro
/usr/local/share/i18n/locales/fr_LU
/usr/local/share/i18n/locales/fr_LU@euro
/usr/local/share/i18n/locales/fur_IT
/usr/local/share/i18n/locales/fy_DE
/usr/local/share/i18n/locales/fy_NL
/usr/local/share/i18n/locales/ga_IE
/usr/local/share/i18n/locales/ga_IE@euro
/usr/local/share/i18n/locales/gd_GB
/usr/local/share/i18n/locales/gez_ER
/usr/local/share/i18n/locales/gez_ER@abegede
/usr/local/share/i18n/locales/gez_ET
/usr/local/share/i18n/locales/gez_ET@abegede
/usr/local/share/i18n/locales/gl_ES
/usr/local/share/i18n/locales/gl_ES@euro
/usr/local/share/i18n/locales/gu_IN
/usr/local/share/i18n/locales/gv_GB
/usr/local/share/i18n/locales/ha_NG
/usr/local/share/i18n/locales/hak_TW
/usr/local/share/i18n/locales/he_IL
/usr/local/share/i18n/locales/hi_IN
/usr/local/share/i18n/locales/hif_FJ
/usr/local/share/i18n/locales/hne_IN
/usr/local/share/i18n/locales/hr_HR
/usr/local/share/i18n/locales/hsb_DE
/usr/local/share/i18n/locales/ht_HT
/usr/local/share/i18n/locales/hu_HU
/usr/local/share/i18n/locales/hy_AM
/usr/local/share/i18n/locales/i18n
/usr/local/share/i18n/locales/i18n_ctype
/usr/local/share/i18n/locales/ia_FR
/usr/local/share/i18n/locales/id_ID
/usr/local/share/i18n/locales/ig_NG
/usr/local/share/i18n/locales/ik_CA
/usr/local/share/i18n/locales/is_IS
/usr/local/share/i18n/locales/iso14651_t1
/usr/local/share/i18n/locales/iso14651_t1_common
/usr/local/share/i18n/locales/iso14651_t1_pinyin
/usr/local/share/i18n/locales/it_CH
/usr/local/share/i18n/locales/it_IT
/usr/local/share/i18n/locales/it_IT@euro
/usr/local/share/i18n/locales/iu_CA
/usr/local/share/i18n/locales/ja_JP
/usr/local/share/i18n/locales/ka_GE
/usr/local/share/i18n/locales/kab_DZ
/usr/local/share/i18n/locales/kk_KZ
/usr/local/share/i18n/locales/kl_GL
/usr/local/share/i18n/locales/km_KH
/usr/local/share/i18n/locales/kn_IN
/usr/local/share/i18n/locales/ko_KR
/usr/local/share/i18n/locales/kok_IN
/usr/local/share/i18n/locales/ks_IN
/usr/local/share/i18n/locales/ks_IN@devanagari
/usr/local/share/i18n/locales/ku_TR
/usr/local/share/i18n/locales/kw_GB
/usr/local/share/i18n/locales/ky_KG
/usr/local/share/i18n/locales/lb_LU
/usr/local/share/i18n/locales/lg_UG
/usr/local/share/i18n/locales/li_BE
/usr/local/share/i18n/locales/li_NL
/usr/local/share/i18n/locales/lij_IT
/usr/local/share/i18n/locales/ln_CD
/usr/local/share/i18n/locales/lo_LA
/usr/local/share/i18n/locales/lt_LT
/usr/local/share/i18n/locales/lv_LV
/usr/local/share/i18n/locales/lzh_TW
/usr/local/share/i18n/locales/mag_IN
/usr/local/share/i18n/locales/mai_IN
/usr/local/share/i18n/locales/mai_NP
/usr/local/share/i18n/locales/mfe_MU
/usr/local/share/i18n/locales/mg_MG
/usr/local/share/i18n/locales/mhr_RU
/usr/local/share/i18n/locales/mi_NZ
/usr/local/share/i18n/locales/miq_NI
/usr/local/share/i18n/locales/mjw_IN
/usr/local/share/i18n/locales/mk_MK
/usr/local/share/i18n/locales/ml_IN
/usr/local/share/i18n/locales/mn_MN
/usr/local/share/i18n/locales/mni_IN
/usr/local/share/i18n/locales/mnw_MM
/usr/local/share/i18n/locales/mr_IN
/usr/local/share/i18n/locales/ms_MY
/usr/local/share/i18n/locales/mt_MT
/usr/local/share/i18n/locales/my_MM
/usr/local/share/i18n/locales/nan_TW
/usr/local/share/i18n/locales/nan_TW@latin
/usr/local/share/i18n/locales/nb_NO
/usr/local/share/i18n/locales/nds_DE
/usr/local/share/i18n/locales/nds_NL
/usr/local/share/i18n/locales/ne_NP
/usr/local/share/i18n/locales/nhn_MX
/usr/local/share/i18n/locales/niu_NU
/usr/local/share/i18n/locales/niu_NZ
/usr/local/share/i18n/locales/nl_AW
/usr/local/share/i18n/locales/nl_BE
/usr/local/share/i18n/locales/nl_BE@euro
/usr/local/share/i18n/locales/nl_NL
/usr/local/share/i18n/locales/nl_NL@euro
/usr/local/share/i18n/locales/nn_NO
/usr/local/share/i18n/locales/nr_ZA
/usr/local/share/i18n/locales/nso_ZA
/usr/local/share/i18n/locales/oc_FR
/usr/local/share/i18n/locales/om_ET
/usr/local/share/i18n/locales/om_KE
/usr/local/share/i18n/locales/or_IN
/usr/local/share/i18n/locales/os_RU
/usr/local/share/i18n/locales/pa_IN
/usr/local/share/i18n/locales/pa_PK
/usr/local/share/i18n/locales/pap_AW
/usr/local/share/i18n/locales/pap_CW
/usr/local/share/i18n/locales/pl_PL
/usr/local/share/i18n/locales/ps_AF
/usr/local/share/i18n/locales/pt_BR
/usr/local/share/i18n/locales/pt_PT
/usr/local/share/i18n/locales/pt_PT@euro
/usr/local/share/i18n/locales/quz_PE
/usr/local/share/i18n/locales/raj_IN
/usr/local/share/i18n/locales/rif_MA
/usr/local/share/i18n/locales/ro_RO
/usr/local/share/i18n/locales/ru_RU
/usr/local/share/i18n/locales/ru_UA
/usr/local/share/i18n/locales/rw_RW
/usr/local/share/i18n/locales/sa_IN
/usr/local/share/i18n/locales/sah_RU
/usr/local/share/i18n/locales/sat_IN
/usr/local/share/i18n/locales/sc_IT
/usr/local/share/i18n/locales/sd_IN
/usr/local/share/i18n/locales/sd_IN@devanagari
/usr/local/share/i18n/locales/se_NO
/usr/local/share/i18n/locales/sgs_LT
/usr/local/share/i18n/locales/shn_MM
/usr/local/share/i18n/locales/shs_CA
/usr/local/share/i18n/locales/si_LK
/usr/local/share/i18n/locales/sid_ET
/usr/local/share/i18n/locales/sk_SK
/usr/local/share/i18n/locales/sl_SI
/usr/local/share/i18n/locales/sm_WS
/usr/local/share/i18n/locales/so_DJ
/usr/local/share/i18n/locales/so_ET
/usr/local/share/i18n/locales/so_KE
/usr/local/share/i18n/locales/so_SO
/usr/local/share/i18n/locales/sq_AL
/usr/local/share/i18n/locales/sq_MK
/usr/local/share/i18n/locales/sr_ME
/usr/local/share/i18n/locales/sr_RS
/usr/local/share/i18n/locales/sr_RS@latin
/usr/local/share/i18n/locales/ss_ZA
/usr/local/share/i18n/locales/st_ZA
/usr/local/share/i18n/locales/sv_FI
/usr/local/share/i18n/locales/sv_FI@euro
/usr/local/share/i18n/locales/sv_SE
/usr/local/share/i18n/locales/sw_KE
/usr/local/share/i18n/locales/sw_TZ
/usr/local/share/i18n/locales/syr
/usr/local/share/i18n/locales/szl_PL
/usr/local/share/i18n/locales/ta_IN
/usr/local/share/i18n/locales/ta_LK
/usr/local/share/i18n/locales/tcy_IN
/usr/local/share/i18n/locales/te_IN
/usr/local/share/i18n/locales/tg_TJ
/usr/local/share/i18n/locales/th_TH
/usr/local/share/i18n/locales/the_NP
/usr/local/share/i18n/locales/ti_ER
/usr/local/share/i18n/locales/ti_ET
/usr/local/share/i18n/locales/tig_ER
/usr/local/share/i18n/locales/tk_TM
/usr/local/share/i18n/locales/tl_PH
/usr/local/share/i18n/locales/tn_ZA
/usr/local/share/i18n/locales/to_TO
/usr/local/share/i18n/locales/tpi_PG
/usr/local/share/i18n/locales/tr_CY
/usr/local/share/i18n/locales/tr_TR
/usr/local/share/i18n/locales/translit_circle
/usr/local/share/i18n/locales/translit_cjk_compat
/usr/local/share/i18n/locales/translit_cjk_variants
/usr/local/share/i18n/locales/translit_combining
/usr/local/share/i18n/locales/translit_compat
/usr/local/share/i18n/locales/translit_font
/usr/local/share/i18n/locales/translit_fraction
/usr/local/share/i18n/locales/translit_hangul
/usr/local/share/i18n/locales/translit_narrow
/usr/local/share/i18n/locales/translit_neutral
/usr/local/share/i18n/locales/translit_small
/usr/local/share/i18n/locales/translit_wide
/usr/local/share/i18n/locales/ts_ZA
/usr/local/share/i18n/locales/tt_RU
/usr/local/share/i18n/locales/tt_RU@iqtelif
/usr/local/share/i18n/locales/ug_CN
/usr/local/share/i18n/locales/uk_UA
/usr/local/share/i18n/locales/unm_US
/usr/local/share/i18n/locales/ur_IN
/usr/local/share/i18n/locales/ur_PK
/usr/local/share/i18n/locales/uz_UZ
/usr/local/share/i18n/locales/uz_UZ@cyrillic
/usr/local/share/i18n/locales/ve_ZA
/usr/local/share/i18n/locales/vi_VN
/usr/local/share/i18n/locales/wa_BE
/usr/local/share/i18n/locales/wa_BE@euro
/usr/local/share/i18n/locales/wae_CH
/usr/local/share/i18n/locales/wal_ET
/usr/local/share/i18n/locales/wo_SN
/usr/local/share/i18n/locales/xh_ZA
/usr/local/share/i18n/locales/yi_US
/usr/local/share/i18n/locales/yo_NG
/usr/local/share/i18n/locales/yue_HK
/usr/local/share/i18n/locales/yuw_PG
/usr/local/share/i18n/locales/zh_CN
/usr/local/share/i18n/locales/zh_HK
/usr/local/share/i18n/locales/zh_SG
/usr/local/share/i18n/locales/zh_TW
/usr/local/share/i18n/locales/zu_ZA
/usr/local/share/info/libc.info-1.zst
/usr/local/share/info/libc.info-10.zst
/usr/local/share/info/libc.info-11.zst
@@ -808,7 +1110,43 @@
/usr/local/share/info/libc.info-8.zst
/usr/local/share/info/libc.info-9.zst
/usr/local/share/info/libc.info.zst
/usr/local/share/locale/be/LC_MESSAGES/libc.mo
/usr/local/share/locale/bg/LC_MESSAGES/libc.mo
/usr/local/share/locale/ca/LC_MESSAGES/libc.mo
/usr/local/share/locale/cs/LC_MESSAGES/libc.mo
/usr/local/share/locale/da/LC_MESSAGES/libc.mo
/usr/local/share/locale/de/LC_MESSAGES/libc.mo
/usr/local/share/locale/el/LC_MESSAGES/libc.mo
/usr/local/share/locale/en_GB/LC_MESSAGES/libc.mo
/usr/local/share/locale/eo/LC_MESSAGES/libc.mo
/usr/local/share/locale/es/LC_MESSAGES/libc.mo
/usr/local/share/locale/fi/LC_MESSAGES/libc.mo
/usr/local/share/locale/fr/LC_MESSAGES/libc.mo
/usr/local/share/locale/gl/LC_MESSAGES/libc.mo
/usr/local/share/locale/hr/LC_MESSAGES/libc.mo
/usr/local/share/locale/hu/LC_MESSAGES/libc.mo
/usr/local/share/locale/ia/LC_MESSAGES/libc.mo
/usr/local/share/locale/id/LC_MESSAGES/libc.mo
/usr/local/share/locale/it/LC_MESSAGES/libc.mo
/usr/local/share/locale/ja/LC_MESSAGES/libc.mo
/usr/local/share/locale/ka/LC_MESSAGES/libc.mo
/usr/local/share/locale/ko/LC_MESSAGES/libc.mo
/usr/local/share/locale/locale.alias
/usr/local/share/locale/lt/LC_MESSAGES/libc.mo
/usr/local/share/locale/nb/LC_MESSAGES/libc.mo
/usr/local/share/locale/nl/LC_MESSAGES/libc.mo
/usr/local/share/locale/pl/LC_MESSAGES/libc.mo
/usr/local/share/locale/pt/LC_MESSAGES/libc.mo
/usr/local/share/locale/pt_BR/LC_MESSAGES/libc.mo
/usr/local/share/locale/ru/LC_MESSAGES/libc.mo
/usr/local/share/locale/rw/LC_MESSAGES/libc.mo
/usr/local/share/locale/sk/LC_MESSAGES/libc.mo
/usr/local/share/locale/sl/LC_MESSAGES/libc.mo
/usr/local/share/locale/sr/LC_MESSAGES/libc.mo
/usr/local/share/locale/sv/LC_MESSAGES/libc.mo
/usr/local/share/locale/tr/LC_MESSAGES/libc.mo
/usr/local/share/locale/uk/LC_MESSAGES/libc.mo
/usr/local/share/locale/vi/LC_MESSAGES/libc.mo
/usr/local/share/locale/zh_CN/LC_MESSAGES/libc.mo
/usr/local/share/locale/zh_TW/LC_MESSAGES/libc.mo
/usr/local/var/db/Makefile

View File

@@ -273,6 +273,7 @@
/usr/local/lib64/gconv/libJISX0213.so
/usr/local/lib64/gconv/libKSC.so
/usr/local/lib64/ld-linux-x86-64.so.2
/usr/local/lib64/ld-lsb-x86-64.so.3
/usr/local/lib64/libBrokenLocale.so
/usr/local/lib64/libBrokenLocale.so.1
/usr/local/lib64/libC.so.6
@@ -284,12 +285,16 @@
/usr/local/lib64/libc_malloc_debug.so.0
/usr/local/lib64/libcrypt.so
/usr/local/lib64/libcrypt.so.1
/usr/local/lib64/libcrypt.so.1.1.0
/usr/local/lib64/libcrypt.so.2
/usr/local/lib64/libcrypt.so.2.0.0
/usr/local/lib64/libdl.so.2
/usr/local/lib64/libm.so
/usr/local/lib64/libm.so.6
/usr/local/lib64/libmemusage.so
/usr/local/lib64/libmvec.so
/usr/local/lib64/libmvec.so.1
/usr/local/lib64/libnsl.so.2
/usr/local/lib64/libnss_compat.so
/usr/local/lib64/libnss_compat.so.2
/usr/local/lib64/libnss_db.so

View File

@@ -3,7 +3,7 @@ require 'package'
class Glibc_build237 < Package
description 'The GNU C Library project provides the core libraries for GNU/Linux systems.'
homepage 'https://www.gnu.org/software/libc/'
version '2.37-1'
version '2.37-2'
license 'LGPL-2.1+, BSD, HPND, ISC, inner-net, rc, and PCRE'
# @libc_version = LIBC_VERSION
@libc_version = '2.37'
@@ -11,13 +11,15 @@ class Glibc_build237 < Package
min_glibc version.split('-').first
max_glibc version.split('-').first
source_url 'https://github.com/bminor/glibc.git'
git_hashtag 'glibc-2.37'
# git_hashtag 'glibc-2.37'
# From the release/2.37/master/ branch...
git_hashtag 'f82e0922de82ccee60c15d5ffd9e7165ced00a83'
binary_compression 'tar.zst'
binary_sha256({
aarch64: 'fffbe32d69e3d972c9c845e8fa244159d7ac8b82ae9f07206c7189b20e3457c8',
armv7l: 'fffbe32d69e3d972c9c845e8fa244159d7ac8b82ae9f07206c7189b20e3457c8',
x86_64: '890a2ba75346498bb20165d55ee2d91bcb57d8c65df485029a5b8a20a5f73c19'
aarch64: '41389ad4ecc6183fca15e2335e20b1617585ea068eed0e280d05dec5aebd9e10',
armv7l: '41389ad4ecc6183fca15e2335e20b1617585ea068eed0e280d05dec5aebd9e10',
x86_64: '476d322fca4f023479303c2a39e638d1bfaf12b78693e3b3a96dbece93a76df2'
})
depends_on 'gawk' => :build
@@ -28,6 +30,8 @@ class Glibc_build237 < Package
conflicts_ok
no_env_options
# strip breaks libc.so.6
no_strip
no_upstream_update
def self.patch
@@ -41,7 +45,15 @@ class Glibc_build237 < Package
system "sed -i 's,verbose,locale_verbose,g' fedora/build-locale-archive.c"
system "sed -i 's,be_quiet,locale_be_quiet,g' fedora/build-locale-archive.c"
@googlesource_branch = 'release-R128-15964.B'
# Reverse Fix name space violation in fortify wrappers (bug 32052)
# https://github.com/bminor/glibc/commit/6e642a47fa483f1f571a7ca68d8f6517b259cd21
# It causes this error:
# ../wcsmbs/bits/wchar2.h:248:10: error: implicit declaration of function __vswprintf_alias; did you mean __swprintf_alias? [-Wimplicit-function-declaration]
downloader 'https://github.com/bminor/glibc/commit/6e642a47fa483f1f571a7ca68d8f6517b259cd21.diff', '6e9fd773c1ad1be331ea2a6d81452bc2e97f6e70942a670c98fd07d356f76dc9'
puts 'Reversing patch: Fix name space violation in fortify wrappers (bug 32052)'
system 'patch -Np1 -R -i 6e642a47fa483f1f571a7ca68d8f6517b259cd21.diff'
@googlesource_branch = 'release-R129-16002.B'
system "git clone --depth=1 -b #{@googlesource_branch} https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay googlesource"
# We need to avoid this patch to preserve float128. Otherwise strtof128,
# strfromf128, and __strtof128_nan, are not available in our glibc.
@@ -60,6 +72,28 @@ class Glibc_build237 < Package
puts "patch -Np1 < #{patch} || true" if @opt_verbose
system "patch -Np1 -F 10 -i #{patch} || true"
end
return unless Gem::Version.new(@libc_version.to_s) > Gem::Version.new('2.32')
# These are the only locales we want.
@locales = %w[C cs_CZ de_DE en es_MX fa_IR fr_FR it_IT ja_JP ru_RU tr_TR zh].to_set
puts 'Paring locales to a minimal set before build.'.lightblue
localetypes = `awk -F '/' '{print $2}' localedata/SUPPORTED | sort -u | awk '{print $1}'`.split.flat_map(&:split)
localetypes_sed = localetypes.join('|')
Dir['localedata/{*.in,locales/*}'].compact.each do |f|
g = File.basename(f).gsub(/.UTF-8.*.in/, '').gsub(/.ISO-8859-.*.in/, '')
h = g.gsub(/_.*/, '')
locale_test = [g, h].uniq
# Just check to see if the set difference is smaller than the
# original set of locales.
if (@locales - locale_test).length < @locales.length
puts "Saving locale: #{f}"
else
# FileUtils.rm(f)
system "sed -i -r '/^[[:space:]]#{g}.*(#{localetypes_sed}).*\\\\/d' localedata/Makefile", exception: false
system "sed -i -r '/^#{g}.*(#{localetypes_sed}).*\\\\/d' localedata/SUPPORTED", exception: false
end
end
end
def self.build
@@ -198,156 +232,98 @@ class Glibc_build237 < Package
case ARCH
when 'aarch64', 'armv7l'
FileUtils.ln_sf '/lib/ld-linux-armhf.so.3', 'ld-linux-armhf.so.3'
when 'i686'
FileUtils.ln_sf "/lib/ld-#{@libc_version}.so", 'ld-linux-i686.so.2'
# newer x86_64 ChromeOS glibc lacks strtof128, strfromf128
# and __strtof128_nan
# when 'x86_64'
# FileUtils.ln_sf '/lib64/ld-linux-x86-64.so.2', 'ld-linux-x86-64.so.2.system'
when 'x86_64'
FileUtils.ln_sf '/lib64/ld-linux-x86-64.so.2', 'ld-linux-x86-64.so.2'
FileUtils.ln_sf '/lib64/ld-linux-x86-64.so.2', 'ld-lsb-x86-64.so.3'
end
if ARCH == 'x86_64'
# newer x86_64 ChromeOS glibc lacks strtof128, strfromf128
# and __strtof128_nan
if ARCH == 'x86_64' && Gem::Version.new(@libc_version.to_s) >= Gem::Version.new('2.37')
# Save our copy of libc.so.6
FileUtils.mv File.join(CREW_DEST_LIB_PREFIX, 'libc.so.6'), File.join(CREW_DEST_LIB_PREFIX, 'libC.so.6')
FileUtils.cp File.join(CREW_DEST_LIB_PREFIX, 'libc.so.6'), File.join(CREW_DEST_LIB_PREFIX, 'libC.so.6')
FileUtils.cp "/#{ARCH_LIB}/libc.so.6", File.join(CREW_DEST_LIB_PREFIX, 'libc.so.6.tmp')
# Patching the running libc.so.6 breaks.
Kernel.system 'patchelf --add-needed libC.so.6 libc.so.6.tmp'
FileUtils.cp File.join(CREW_DEST_LIB_PREFIX, 'libc.so.6.tmp'), File.join(CREW_DEST_LIB_PREFIX, 'libc.so.6')
FileUtils.rm File.join(CREW_DEST_LIB_PREFIX, 'libc.so.6.tmp')
# Make a symlink to the system libc.so.6, which will require patchelf run on it in the postinstall.
FileUtils.ln_sf "/#{ARCH_LIB}/libc.so.6", 'libc.so.6'
# Copy over the system lib[c,m].so.6
# FileUtils.cp "/#{ARCH_LIB}/libc.so.6", File.join(CREW_DEST_LIB_PREFIX, 'libc.so.6')
# FileUtils.cp "/#{ARCH_LIB}/libm.so.6", File.join(CREW_DEST_LIB_PREFIX, 'libm.so.6')
## Also save our copy of libm.so.6 since it has the float128 functions.
## Reject entries which aren't libraries ending in .so, and which aren't files.
## Reject text files such as libc.so because they points to files like
## libc_nonshared.a, which are not provided by ChromeOS
# Dir["{,/usr}/#{ARCH_LIB}/#{lib}.so*"].compact.reject { |f| File.directory?(f) }.each do |f|
# @filetype = `file #{f}`.chomp
# puts "f: #{@filetype}" if @opt_verbose
# if ['shared object', 'symbolic link'].any? { |type| @filetype.include?(type) }
# g = File.basename(f)
# FileUtils.ln_sf f.to_s, "#{CREW_DEST_LIB_PREFIX}/#{g}"
# elsif @opt_verbose
# puts "#{f} excluded because #{@filetype}"
# end
# end
# Link our libm to also require our renamed libC.so.6
# which provides the float128 functions strtof128, strfromf128,
# and __strtof128_nan.
# For some reason handling libc.so.6 here isn't working.
libc_patch_libraries = %w[libm.so.6]
libc_patch_libraries.each do |lib|
system "patchelf --replace-needed libc.so.6 libC.so.6 #{lib}"
FileUtils.cp lib, "#{lib}.tmp"
Kernel.system "patchelf --add-needed libC.so.6 #{lib}.tmp"
Kernel.system "patchelf --remove-needed libc.so.6 #{lib}.tmp", exception: false
FileUtils.mv lib, "#{lib}.old"
FileUtils.cp "#{lib}.tmp", lib
FileUtils.rm "#{lib}.tmp"
FileUtils.rm "#{lib}.old"
puts "#{lib} patched for use with Chromebrew's glibc.".lightgreen
end
end
@libraries = %w[ld libBrokenLocale libSegFault libanl libc libcrypt
libdl libm libmemusage libmvec libnsl libnss_compat libnss_db
libnss_dns libnss_files libnss_hesiod libpcprofile libpthread
libthread_db libresolv librlv librt libthread_db-1.0 libutil]
@libraries -= ['libpthread'] if Gem::Version.new(@libc_version.to_s) >= Gem::Version.new('2.37')
@libraries -= ['libc'] if Gem::Version.new(@libc_version.to_s) >= Gem::Version.new('2.37') && ARCH == 'x86_64'
# Also save our copy of libm.so.6 since it has the float128 functions
@libraries -= ['libm'] if Gem::Version.new(@libc_version.to_s) >= Gem::Version.new('2.37') && ARCH == 'x86_64'
@libraries.each do |lib|
# Reject entries which aren't libraries ending in .so, and which aren't files.
# Reject text files such as libc.so because they points to files like
# libc_nonshared.a, which are not provided by ChromeOS
Dir["{,/usr}/#{ARCH_LIB}/#{lib}.so*"].compact.reject { |f| File.directory?(f) }.each do |f|
@filetype = `file #{f}`.chomp
puts "f: #{@filetype}" if @opt_verbose
if ['shared object', 'symbolic link'].any? { |type| @filetype.include?(type) }
g = File.basename(f)
FileUtils.ln_sf f.to_s, "#{CREW_DEST_LIB_PREFIX}/#{g}"
elsif @opt_verbose
puts "#{f} excluded because #{@filetype}"
end
end
end
end
end
# Only save libnsl.so.2, since libnsl.so.1 is provided by perl
# For this to work, build on a M107 or newer container.
FileUtils.ln_sf File.realpath("#{CREW_DEST_LIB_PREFIX}/libnsl.so.1"), "#{CREW_DEST_LIB_PREFIX}/libnsl.so.2" if LIBC_VERSION.to_f >= 2.35
FileUtils.ln_sf File.realpath("/#{ARCH_LIB}/libnsl.so.1"), "#{CREW_DEST_LIB_PREFIX}/libnsl.so.2" if LIBC_VERSION.to_f >= 2.35
FileUtils.rm_f "#{CREW_DEST_LIB_PREFIX}/libnsl.so"
FileUtils.rm_f "#{CREW_DEST_LIB_PREFIX}/libnsl.so.1"
# Remove libmount.so since it conflicts with the one from util_linux.
FileUtils.rm Dir.glob("#{CREW_DEST_LIB_PREFIX}/libmount.so*")
end
def self.check
# Dir.chdir 'glibc_build' do
# system 'make -j1 check'
# end
locale_keeps = @locales.map { |i| "-e ^#{i}" }.join(' ')
system "localedef --list-archive --prefix=#{CREW_DEST_PREFIX}| grep -v -i #{locale_keeps}| xargs localedef --delete-from-archive --prefix=#{CREW_DEST_PREFIX}",
exception: false
end
def self.postinstall
# Handle broken system glibc affecting system glibc and libm.so.6 on newer x86_64 ChromeOS milestones.
if (ARCH == 'x86_64') && Gem::Version.new(LIBC_VERSION.to_s) >= Gem::Version.new('2.35')
FileUtils.cp "/#{ARCH_LIB}/libc.so.6", File.join(CREW_LIB_PREFIX, 'libc.so.6.system') and FileUtils.mv File.join(CREW_LIB_PREFIX, 'libc.so.6.system'), File.join(CREW_LIB_PREFIX, 'libc.so.6')
puts "patchelf is needed. Please run: 'crew install patchelf ; crew postinstall #{name}'".lightred unless File.file?(File.join(CREW_PREFIX, 'bin/patchelf'))
# Link the system libc.so.6 to also require our renamed libC.so.6
# which provides the float128 functions strtof128, strfromf128,
# and __strtof128_nan.
libc_patch_libraries = %w[libc.so.6 libm.so.6 libstdc++.so.6]
libc_patch_libraries.keep_if { |lib| File.file?(File.join(CREW_LIB_PREFIX, lib)) }
libc_patch_libraries.delete_if { |lib| Kernel.system "patchelf --print-needed #{File.join(CREW_LIB_PREFIX, lib)} | grep -q libC.so.6" }
return if libc_patch_libraries.empty?
if File.file?(File.join(CREW_LIB_PREFIX, 'libC.so.6'))
Dir.chdir(CREW_LIB_PREFIX) do
libc_patch_libraries.each do |lib|
Kernel.system "patchelf --add-needed libC.so.6 #{lib}" and Kernel.system "patchelf --remove-needed libc.so.6 #{lib}"
puts "#{lib} patched for use with Chromebrew's glibc.".lightgreen
end
end
end
end
unless ARCH == 'x86_64'
if File.exist?("#{CREW_LIB_PREFIX}/libc.so.6")
FileUtils.chmod 'u=wrx', "#{CREW_LIB_PREFIX}/libc.so.6"
@crew_libcvertokens = `#{CREW_LIB_PREFIX}/libc.so.6`.lines.first.chomp.split(/\s/)
@libc_version = @crew_libcvertokens[@crew_libcvertokens.find_index('version') + 1].sub!(/[[:punct:]]?$/, '')
puts "Package glibc version is #{@libc_version}.".lightblue
else
@libc_version = LIBC_VERSION
end
@libraries = %w[ld libBrokenLocale libSegFault libanl libc libcrypt
libdl libm libmemusage libmvec libnsl libnss_compat libnss_db
libnss_dns libnss_files libnss_hesiod libpcprofile libpthread
libthread_db libresolv librlv librt libthread_db-1.0 libutil]
@libraries -= ['libpthread'] if Gem::Version.new(@libc_version.to_s) > Gem::Version.new('2.35')
@libraries -= ['libc'] if Gem::Version.new(@libc_version.to_s) > Gem::Version.new('2.35') && Kernel.system("patchelf --print-needed #{File.join(CREW_LIB_PREFIX, 'libc.so.6')} | grep -q libC.so.6")
@libraries -= ['libm'] if Gem::Version.new(@libc_version.to_s) > Gem::Version.new('2.35') && Kernel.system("patchelf --print-needed #{File.join(CREW_LIB_PREFIX, 'libm.so.6')} | grep -q libC.so.6")
Dir.chdir CREW_LIB_PREFIX do
puts "System glibc version is #{@libc_version}.".lightblue
puts 'Creating symlinks to system glibc version to prevent breakage.'.lightblue
case ARCH
when 'aarch64', 'armv7l'
FileUtils.ln_sf '/lib/ld-linux-armhf.so.3', 'ld-linux-armhf.so.3'
end
@libraries.each do |lib|
# Reject entries which aren't libraries ending in .so, and which aren't files.
# Reject text files such as libc.so because they points to files like
# libc_nonshared.a, which are not provided by ChromeOS
Dir["{,/usr}/#{ARCH_LIB}/#{lib}.so*"].compact.select { |i| ['shared object', 'symbolic link'].any? { |j| `file #{i}`.chomp.include? j } }.each do |k|
FileUtils.ln_sf k, File.join(CREW_LIB_PREFIX, File.basename(k))
end
end
end
end
return unless Gem::Version.new(@libc_version.to_s) > Gem::Version.new('2.32') && Gem::Version.new(CREW_KERNEL_VERSION.to_s) >= Gem::Version.new('5.10')
puts 'Paring locales to a minimal set.'.lightblue
system 'localedef --list-archive | grep -v -i -e ^en -e ^cs -e ^de -e ^es -e ^fa -e ^fe -e ^it -e ^ja -e ^ru -e ^tr -e ^zh -e ^C| xargs localedef --delete-from-archive',
exception: false
FileUtils.mv "#{CREW_LIB_PREFIX}/locale/locale-archive", "#{CREW_LIB_PREFIX}/locale/locale-archive.tmpl"
unless File.file?('')
downloader "https://raw.githubusercontent.com/bminor/glibc/release/#{@libc_version}/master/intl/locale.alias",
'SKIP', "#{CREW_PREFIX}/share/locale/locale.alias"
end
if CREW_VERBOSE
system 'build-locale-archive'
else
system 'build-locale-archive', %i[out err] => File::NULL
end
FileUtils.rm "#{CREW_LIB_PREFIX}/locale/locale-archive.tmpl"
downloader "https://raw.githubusercontent.com/bminor/glibc/release/#{@libc_version}/master/intl/locale.alias",
'SKIP', "#{CREW_PREFIX}/share/locale/locale.alias"
# minimum set of locales -> #{CREW_LIB_PREFIX}/locale/locale-archive
# We just whitelist certain locales and delete everything else like other distributions do, e.g.
# for dir in locale i18n; do
# find #{CREW_PREFIX}/usr/share/${dir} -mindepth 1 -maxdepth 1 -type d -not \( -name "${KEEPLANG}" -o -name POSIX \) -exec rm -rf {} +
# done
# This is the array of locales to save:
@locales = %w[C cs_CZ de_DE en es_MX fa_IR fr_FR it_IT ja_JP ru_RU tr_TR zh]
@localedirs = %W[#{CREW_PREFIX}/share/locale #{CREW_PREFIX}/share/i18n/locales]
@filelist = File.readlines("#{CREW_META_PATH}/glibc_build237.filelist")
@localedirs.each do |localedir|
Dir.chdir localedir do
Dir['*'].each do |f|
next if @locales.any? { |s| File.basename(f).include?(s) }
FileUtils.rm_f f
@fpath = "#{localedir}/#{f}"
@filelist.reject! { |e| e.include?(@fpath) }
end
end
end
puts 'Updating glibc package filelist...'.lightblue
File.open("#{CREW_META_PATH}/glibc_build237.filelist", 'w+') do |f|
f.puts(@filelist)
if CREW_VERBOSE
system "build-locale-archive --install-langs=#{@locales.join(':')}"
else
system "build-locale-archive --install-langs=#{@locales.join(':')}", %i[out err] => File::NULL
end
FileUtils.rm "#{CREW_LIB_PREFIX}/locale/locale-archive.tmpl"
end
end

View File

@@ -4,7 +4,7 @@ Package.load_package("#{__dir__}/glibc_build237.rb")
class Glibc_dev237 < Package
description 'glibc: everything except what is in glibc_lib'
homepage Glibc_build237.homepage
version '2.37-patchelf1'
version '2.37-patchelf2'
license Glibc_build237.license
compatibility 'x86_64 aarch64 armv7l'
min_glibc version.split('-').first
@@ -13,9 +13,9 @@ class Glibc_dev237 < Package
binary_compression 'tar.zst'
binary_sha256({
aarch64: 'fc071b97e0eaa0e1e9b6bdad4ab378112dbef849453fbf3bc4e10e22260b1841',
armv7l: 'fc071b97e0eaa0e1e9b6bdad4ab378112dbef849453fbf3bc4e10e22260b1841',
x86_64: '72b99a7f86687958639d0935d686260f50afc45e0209ff717bbd42e4ef9d7bfb'
aarch64: 'd30575a011326b56ff235078aeb881c2a3d24619cb1697f7eed9b71bd9a33b42',
armv7l: 'd30575a011326b56ff235078aeb881c2a3d24619cb1697f7eed9b71bd9a33b42',
x86_64: '9689db1bfc8580b61409cc9b23591c1560b3651a2f1474815aab301611866553'
})
depends_on 'glibc_build237' => :build
@@ -24,6 +24,7 @@ class Glibc_dev237 < Package
conflicts_ok
no_shrink
no_source_build
no_strip
no_upstream_update
def self.install

View File

@@ -4,7 +4,7 @@ Package.load_package("#{__dir__}/glibc_build237.rb")
class Glibc_lib237 < Package
description 'glibc libraries'
homepage Glibc_build237.homepage
version '2.37-patchelf1' # Do not use @_ver here, it will break the installer.
version '2.37-patchelf2' # Do not use @_ver here, it will break the installer.
license Glibc_build237.license
compatibility 'x86_64 aarch64 armv7l'
min_glibc version.split('-').first
@@ -13,16 +13,17 @@ class Glibc_lib237 < Package
binary_compression 'tar.zst'
binary_sha256({
aarch64: '7327f9e37705d2b46a2a89300c154e16aa078f93bc3a6ce69932783ce6f56e50',
armv7l: '7327f9e37705d2b46a2a89300c154e16aa078f93bc3a6ce69932783ce6f56e50',
x86_64: '37c91128508324b3f865687061e46df5f650cc634489ec9d1a96b88f5917451a'
aarch64: '5c704c9649dca04ddd8a3b3c3a46a81cdf95a162e07362b64992452876297545',
armv7l: '5c704c9649dca04ddd8a3b3c3a46a81cdf95a162e07362b64992452876297545',
x86_64: 'd83b21de790dbf7e33418ad86dd44fb2af933cc811985f2482c8fad696654220'
})
depends_on 'glibc_build237' => :build
conflicts_ok
no_shrink
no_source_build
# strip breaks libc.so.6
no_strip
no_upstream_update
def self.install
@@ -32,7 +33,7 @@ class Glibc_lib237 < Package
@filelist = File.readlines(@filelist_path, chomp: true).sort
@filelist.each do |filename|
next unless filename.include?('.so') || filename.include?('bin/')
next unless (filename.include?('.so') || filename.include?('bin/')) && File.file?(filename)
@destpath = File.join(CREW_DEST_DIR, filename)
@filename_target = File.realpath(filename)
@@ -41,45 +42,43 @@ class Glibc_lib237 < Package
if ARCH == 'x86_64'
puts 'Skipping creating symlinks from system Glibc libraries...'.orange
return
end
else
# Create symlinks to system glibc libraries.
glibc_libs = %w[libanl.so.1 libc_malloc_debug.so.0 libdl.so.2
libmvec.so.1 libnss_dns.so.2 libnss_files.so.2 libpthread.so.0
libresolv.so.2 librt.so.1 libthread_db.so.1 libutil.so.1]
# Create symlinks to system glibc libraries.
glibc_libs = %w[libanl.so.1 libc_malloc_debug.so.0 libc.so.6 libdl.so.2 libm.so.6
libmvec.so.1 libnss_dns.so.2 libnss_files.so.2 libpthread.so.0
libresolv.so.2 librt.so.1 libthread_db.so.1 libutil.so.1]
glibc_libs.delete_if { |lib| lib == 'libc.so.6' } if (ARCH == 'x86_64') && (Gem::Version.new(LIBC_VERSION) >= Gem::Version.new('2.37'))
glibc_libs.each do |lib|
# Do not replace libraries that have been patched for our glibc libC.so.6.
next if Kernel.system("patchelf --print-needed #{File.join(CREW_LIB_PREFIX, lib)} | grep -q libC.so.6")
glibc_libs.each do |lib|
# Do not replace libraries that have been patched for our glibc libC.so.6.
next if Kernel.system("patchelf --print-needed #{File.join(CREW_LIB_PREFIX, lib)} | grep -q libC.so.6")
puts "Creating symlink of system Glibc's /#{ARCH_LIB}/#{lib} into #{CREW_DEST_LIB_PREFIX}/#{lib}...".orange
FileUtils.ln_sf "/#{ARCH_LIB}/#{lib}", "#{CREW_DEST_LIB_PREFIX}/#{lib}"
puts "Creating symlink of system Glibc's /#{ARCH_LIB}/#{lib} into #{CREW_DEST_LIB_PREFIX}/#{lib}...".orange
FileUtils.ln_sf "/#{ARCH_LIB}/#{lib}", "#{CREW_DEST_LIB_PREFIX}/#{lib}"
end
end
end
def self.postinstall
if (ARCH == 'x86_64') && (LIBC_VERSION.to_f >= 2.35)
# Overwrite our libc.so.6 with the system glibc libc.so.6, and then use patchelf to link it to ours.
FileUtils.cp "/#{ARCH_LIB}/libc.so.6", File.join(CREW_LIB_PREFIX, 'libc.so.6.system') and FileUtils.mv File.join(CREW_LIB_PREFIX, 'libc.so.6.system'), File.join(CREW_LIB_PREFIX, 'libc.so.6') unless Kernel.system "patchelf --print-needed #{File.join(CREW_LIB_PREFIX, 'libc.so.6')} | grep -q libC.so.6"
puts "patchelf is needed. Please run: 'crew install patchelf ; crew postinstall #{name}'".lightred unless File.file?(File.join(CREW_PREFIX, 'bin/patchelf'))
# Link the system libc.so.6 to also require our renamed libC.so.6
# which provides the float128 functions strtof128, strfromf128,
# and __strtof128_nan.
libc_patch_libraries = %w[libc.so.6 libm.so.6 libstdc++.so.6]
libc_patch_libraries.keep_if { |lib| File.file?(File.join(CREW_LIB_PREFIX, lib)) }
libc_patch_libraries.delete_if { |lib| Kernel.system "patchelf --print-needed #{File.join(CREW_LIB_PREFIX, lib)} | grep -q libC.so.6" }
return unless (ARCH == 'x86_64') && (Gem::Version.new(LIBC_VERSION) >= Gem::Version.new('2.37'))
return if libc_patch_libraries.empty?
puts "patchelf is needed. Please run: 'crew install patchelf ; crew postinstall #{name}'".lightred unless File.file?(File.join(CREW_PREFIX, 'bin/patchelf'))
# Link the system libc.so.6 to also require our renamed libC.so.6
# which provides the float128 functions strtof128, strfromf128,
# and __strtof128_nan.
libc_patch_libraries = %w[libc.so.6 libm.so.6 libstdc++.so.6]
libc_patch_libraries.keep_if { |lib| File.file?(File.join(CREW_LIB_PREFIX, lib)) }
libc_patch_libraries.delete_if { |lib| Kernel.system "patchelf --print-needed #{File.join(CREW_LIB_PREFIX, lib)} | grep -q libC.so.6" }
if File.file?(File.join(CREW_LIB_PREFIX, 'libC.so.6'))
Dir.chdir(CREW_LIB_PREFIX) do
libc_patch_libraries.each do |lib|
FileUtils.cp lib, "#{lib}.tmp"
Kernel.system "patchelf --add-needed libC.so.6 #{lib}.tmp" and Kernel.system "patchelf --remove-needed libc.so.6 #{lib}.tmp"
FileUtils.mv "#{lib}.tmp", lib
puts "#{lib} patched for use with Chromebrew's glibc.".lightgreen
end
return if libc_patch_libraries.empty?
if File.file?(File.join(CREW_LIB_PREFIX, 'libC.so.6'))
Dir.chdir(CREW_LIB_PREFIX) do
libc_patch_libraries.each do |lib|
FileUtils.cp lib, "#{lib}.tmp"
Kernel.system "patchelf --add-needed libC.so.6 #{lib}.tmp" and Kernel.system "patchelf --remove-needed libc.so.6 #{lib}.tmp"
FileUtils.mv "#{lib}.tmp", lib
puts "#{lib} patched for use with Chromebrew's glibc.".lightgreen
end
end
end

View File

@@ -1,5 +1,4 @@
require 'buildsystems/ruby'
require 'highline/import'
class Ruby_pry < RUBY
description 'Pry is a runtime developer console and IRB alternative with powerful introspection capabilities.'

View File

@@ -50,7 +50,7 @@ class RemoveCommandTest < Minitest::Test
# Command.remove(@random_essential_pkg, true)
# end
assert_raises(SystemExit) { Command.remove(@random_essential_pkg, true) }
assert_raises(SystemExit) { Command.remove(@random_essential_pkg) }
end
def test_remove_package_with_essential_file