From 3a2bdf9df7d7028e870b6de321c219c76bc2e9a4 Mon Sep 17 00:00:00 2001 From: Cassandra Watergate <55339220+saltedcoffii@users.noreply.github.com> Date: Tue, 13 Apr 2021 20:35:17 -0400 Subject: [PATCH] Move crew (#5613) * move crew and update symlinks * install.sh: fix #5612 * lib/const.rb: bump version --- crew => bin/crew | 19 +++++++++++-------- install.sh | 2 +- lib/const.rb | 2 +- 3 files changed, 13 insertions(+), 10 deletions(-) rename crew => bin/crew (98%) diff --git a/crew b/bin/crew similarity index 98% rename from crew rename to bin/crew index c51d3788c..65b2feca5 100755 --- a/crew +++ b/bin/crew @@ -1,5 +1,5 @@ #!/usr/bin/env ruby -require_relative 'lib/color' +require_relative '../lib/color' # Disallow sudo abort 'Chromebrew should not be run as root.'.lightred if Process.uid == 0 @@ -10,9 +10,8 @@ require 'uri' require 'digest/sha2' require 'json' require 'fileutils' -require 'securerandom' -require_relative 'lib/const' -require_relative 'lib/util' +require_relative '../lib/const' +require_relative '../lib/util' # Add lib to LOAD_PATH $LOAD_PATH.unshift "#{CREW_LIB_PATH}lib" @@ -73,7 +72,7 @@ ENV["XZ_OPT"] = ENV['CREW_XZ_OPT'] || "-7e -T #{CREW_NPROC}" CURL = ENV['CURL'] || 'curl' # Parse arguments using docopt -require_relative 'lib/docopt' +require_relative '../lib/docopt' begin args = Docopt::docopt(DOC) args[''] = args[''].map { |arg| arg.gsub('-','_') } if args[''] @@ -452,6 +451,10 @@ def update system 'git fetch origin master' system 'git reset --hard origin/master' end + + # Update the symlink + FileUtils.symlink "#{CREW_LIB_PATH}/bin/crew", "#{CREW_PREFIX}/bin/crew", force: true, verbose: @fileutils_verbose + puts 'Package lists, crew, and library updated.' #update compatible packages @@ -684,9 +687,9 @@ end def prepare_package (destdir) Dir.chdir destdir do # Avoid /usr/local/share/info/dir{.gz} file conflict: - # The install-info program maintains a directory of installed - # info documents in /usr/share/info/dir for the use of info - # readers. This file must not be included in packages other + # The install-info program maintains a directory of installed + # info documents in /usr/share/info/dir for the use of info + # readers. This file must not be included in packages other # than install-info. # https://www.debian.org/doc/debian-policy/ch-docs.html#info-documents FileUtils.rm "#{CREW_DEST_PREFIX}/share/info/dir" if File.exist?("#{CREW_DEST_PREFIX}/share/info/dir") diff --git a/install.sh b/install.sh index 530457096..22882369e 100755 --- a/install.sh +++ b/install.sh @@ -187,7 +187,7 @@ done sudo ldconfig &> /dev/null || true # create symlink to 'crew' in ${CREW_PREFIX}/bin/ -ln -sfv "../lib/crew/crew" "${CREW_PREFIX}/bin/crew" +ln -sfv "../lib/crew/bin/crew" "${CREW_PREFIX}/bin/" # prepare sparse checkout .rb packages directory and do it cd "${CREW_LIB_PATH}" diff --git a/lib/const.rb b/lib/const.rb index 75179f1e8..2b2f81d12 100644 --- a/lib/const.rb +++ b/lib/const.rb @@ -1,6 +1,6 @@ # Defines common constants used in different parts of crew -CREW_VERSION = '1.8.3' +CREW_VERSION = '1.8.4' ARCH_ACTUAL = `uname -m`.strip # This helps with virtualized builds on aarch64 machines