mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-08 23:18:10 -05:00
Fix crew upload, update update_checker (#12256)
* Adjust update checks to handle gitlab urls Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Update waf url Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Fix allowing crew commands to be invoked from inside crew without a subshell. Signed-off-by: Satadru Pramanik <satadru@gmail.com> --------- Signed-off-by: Satadru Pramanik <satadru@gmail.com> Co-authored-by: Satadru Pramanik <satadru@gmail.com>
This commit is contained in:
committed by
GitHub
parent
3364e6cd9b
commit
6da088e536
13
bin/crew
13
bin/crew
@@ -1709,6 +1709,7 @@ def build_command(args)
|
||||
end
|
||||
end
|
||||
abort "#{CREW_LOCAL_BUILD_DIR} is not writable.".lightred unless File.writable?(CREW_LOCAL_BUILD_DIR)
|
||||
args = { '<name>' => args.split } if args.is_a? String
|
||||
args['<name>'].each do |name|
|
||||
# If a package file is explicitly passed, then use that package file, whereever it is.
|
||||
if name.include?('.rb') && File.file?(name)
|
||||
@@ -1742,6 +1743,7 @@ def build_command(args)
|
||||
end
|
||||
|
||||
def check_command(args)
|
||||
args = { '<name>' => args.split } if args.is_a? String
|
||||
args['<name>'].each do |name|
|
||||
Command.check(name, @opt_force)
|
||||
end
|
||||
@@ -1754,6 +1756,7 @@ def const_command(args)
|
||||
end
|
||||
|
||||
def deps_command(args)
|
||||
args = { '<name>' => args.split } if args.is_a? String
|
||||
args['<name>'].each do |name|
|
||||
@pkg_name = name
|
||||
search @pkg_name
|
||||
@@ -1771,6 +1774,7 @@ def deps_command(args)
|
||||
end
|
||||
|
||||
def download_command(args)
|
||||
args = { '<name>' => args.split } if args.is_a? String
|
||||
args['<name>'].each do |name|
|
||||
@pkg_name = name
|
||||
search @pkg_name
|
||||
@@ -1805,6 +1809,7 @@ def download_command(args)
|
||||
end
|
||||
|
||||
def files_command(args)
|
||||
args = { '<name>' => args.split } if args.is_a? String
|
||||
args['<name>'].each do |name|
|
||||
search name
|
||||
Command.files(@pkg)
|
||||
@@ -1816,6 +1821,7 @@ def help_command(args)
|
||||
end
|
||||
|
||||
def install_command(args)
|
||||
args = { '<name>' => args.split } if args.is_a? String
|
||||
args['<name>'].each do |name|
|
||||
@pkg_name = name
|
||||
# Exit early if package is already installed. This prevents the
|
||||
@@ -1844,6 +1850,7 @@ def list_command(args)
|
||||
end
|
||||
|
||||
def postinstall_command(args)
|
||||
args = { '<name>' => args.split } if args.is_a? String
|
||||
args['<name>'].each do |name|
|
||||
@pkg_name = name
|
||||
search @pkg_name, silent: true
|
||||
@@ -1860,6 +1867,7 @@ def prop_command(args)
|
||||
end
|
||||
|
||||
def reinstall_command(args)
|
||||
args = { '<name>' => args.split } if args.is_a? String
|
||||
args['<name>'].each do |name|
|
||||
@pkg_name = name
|
||||
next unless Command.check(name, @opt_force)
|
||||
@@ -1879,6 +1887,7 @@ def reinstall_command(args)
|
||||
end
|
||||
|
||||
def remove_command(args)
|
||||
args = { '<name>' => args.split } if args.is_a? String
|
||||
args['<name>'].each do |name|
|
||||
search name
|
||||
Command.remove(@pkg, verbose: CREW_VERBOSE, force: @opt_force)
|
||||
@@ -1886,6 +1895,7 @@ def remove_command(args)
|
||||
end
|
||||
|
||||
def search_command(args)
|
||||
args = { '<name>' => args.split } if args.is_a? String
|
||||
args['<name>'].each do |name|
|
||||
Command.search(name, CREW_VERBOSE)
|
||||
end
|
||||
@@ -1903,6 +1913,7 @@ def upgrade_command(args) = upgrade(*args['<name>'], build_from_source: @opt_sou
|
||||
|
||||
def update_package_file_command(args)
|
||||
return if CREW_BUILD_NO_PACKAGE_FILE_HASH_UPDATES
|
||||
args = { '<name>' => args.split } if args.is_a? String
|
||||
args['<name>'].each do |name|
|
||||
search name
|
||||
update_package_file(name, @pkg.version, @pkg.binary_compression)
|
||||
@@ -1912,6 +1923,7 @@ end
|
||||
def upload_command(args)
|
||||
gitlab_token = ENV.fetch('GITLAB_TOKEN', nil)
|
||||
gitlab_token_username = ENV.fetch('GITLAB_TOKEN_USERNAME', nil)
|
||||
args = { '<name>' => args.split } if args.is_a? String
|
||||
upload if args['<name>'].empty?
|
||||
args['<name>'].each do |name|
|
||||
search name
|
||||
@@ -1921,6 +1933,7 @@ end
|
||||
|
||||
def upstream_command(args)
|
||||
# Pass the whole argument input to tools/version.rb, stripping out any file extensions that occur as a result of using a wildcard argument in a directory where it matches files.
|
||||
args = { '<name>' => args.split } if args.is_a? String
|
||||
Dir.chdir CREW_PACKAGES_PATH do
|
||||
system "../tools/version.rb #{args['<name>'].join(' ').gsub('.rb', '')} #{@short_verbose}"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user