Commit b4a88ea9 authored by supechicken's avatar supechicken Committed by GitHub

crew: Replace '-' with '_' in crew install <pkgName> (#5050)

* Replace '-' with '_' in crew

* Bump version
Co-authored-by: default avatarsupechicken666 <68530202+supechicken666@users.noreply.github.com>
parent b587a0b7
...@@ -949,7 +949,7 @@ end ...@@ -949,7 +949,7 @@ end
def build_command (args) def build_command (args)
args["<name>"].each do |name| args["<name>"].each do |name|
@pkgName = name @pkgName = name.gsub('-', '_')
search @pkgName search @pkgName
print_current_package @opt_verbose print_current_package @opt_verbose
resolve_dependencies_and_build resolve_dependencies_and_build
...@@ -958,7 +958,7 @@ end ...@@ -958,7 +958,7 @@ end
def download_command (args) def download_command (args)
args["<name>"].each do |name| args["<name>"].each do |name|
@pkgName = name @pkgName = name.gsub('-', '_')
search @pkgName search @pkgName
print_current_package @opt_verbose print_current_package @opt_verbose
download download
...@@ -977,7 +977,7 @@ end ...@@ -977,7 +977,7 @@ end
def files_command (args) def files_command (args)
args["<name>"].each do |name| args["<name>"].each do |name|
@pkgName = name @pkgName = name.gsub('-', '_')
search @pkgName search @pkgName
print_current_package print_current_package
files name files name
...@@ -995,7 +995,7 @@ end ...@@ -995,7 +995,7 @@ end
def install_command (args) def install_command (args)
args["<name>"].each do |name| args["<name>"].each do |name|
@pkgName = name @pkgName = name.gsub('-', '_')
search @pkgName search @pkgName
print_current_package true print_current_package true
@pkg.build_from_source = true if @opt_src or @opt_recursive @pkg.build_from_source = true if @opt_src or @opt_recursive
...@@ -1017,18 +1017,19 @@ end ...@@ -1017,18 +1017,19 @@ end
def postinstall_command (args) def postinstall_command (args)
args["<name>"].each do |name| args["<name>"].each do |name|
search name, true @pkgName = name.gsub('-', '_')
if @device[:installed_packages].any? do |elem| elem[:name] == name end search @pkgName, true
if @device[:installed_packages].any? do |elem| elem[:name] == @pkgName end
@pkg.postinstall @pkg.postinstall
else else
puts "Package #{name} is not installed. :(".lightred puts "Package #{@pkgName} is not installed. :(".lightred
end end
end end
end end
def reinstall_command (args) def reinstall_command (args)
args["<name>"].each do |name| args["<name>"].each do |name|
@pkgName = name @pkgName = name.gsub('-', '_')
search @pkgName search @pkgName
print_current_package print_current_package
@pkg.build_from_source = true if @opt_src or @opt_recursive @pkg.build_from_source = true if @opt_src or @opt_recursive
...@@ -1042,13 +1043,13 @@ end ...@@ -1042,13 +1043,13 @@ end
def remove_command (args) def remove_command (args)
args["<name>"].each do |name| args["<name>"].each do |name|
remove name remove name.gsub('-', '_')
end end
end end
def search_command (args) def search_command (args)
args["<name>"].each do |name| args["<name>"].each do |name|
regexp_search name regexp_search name.gsub('-', '_')
end.empty? and begin end.empty? and begin
list_packages list_packages
end end
...@@ -1060,7 +1061,7 @@ end ...@@ -1060,7 +1061,7 @@ end
def upgrade_command (args) def upgrade_command (args)
args["<name>"].each do |name| args["<name>"].each do |name|
@pkgName = name @pkgName = name.gsub('-', '_')
search @pkgName search @pkgName
print_current_package print_current_package
@pkg.build_from_source = true if @opt_src @pkg.build_from_source = true if @opt_src
......
# Defines common constants used in different parts of crew # Defines common constants used in different parts of crew
CREW_VERSION = '1.7.2' CREW_VERSION = '1.7.3'
ARCH_ACTUAL = `uname -m`.strip ARCH_ACTUAL = `uname -m`.strip
# This helps with virtualized builds on aarch64 machines # This helps with virtualized builds on aarch64 machines
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment