Handle cases when source_url is not a hash (#6060)

This commit is contained in:
satmandu
2021-08-11 16:18:07 -04:00
committed by GitHub
parent 899e87608f
commit fdc33d33fc
2 changed files with 5 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
# Defines common constants used in different parts of crew
CREW_VERSION = '1.16.2'
CREW_VERSION = '1.16.3'
ARCH_ACTUAL = `uname -m`.strip
# This helps with virtualized builds on aarch64 machines

View File

@@ -41,8 +41,8 @@ class Package
if !@build_from_source and @binary_url and @binary_url.has_key?(architecture)
return @binary_url[architecture]
else
if @source_url.has_key?(architecture)
return @source_url[architecture]
if @source_url.respond_to?(:has_key?)
return @source_url.has_key?(architecture) ? @source_url[architecture] : nil
else
return @source_url
end
@@ -61,8 +61,8 @@ class Package
if !@build_from_source and @binary_sha256 and @binary_sha256.has_key?(architecture)
return @binary_sha256[architecture]
else
if @source_sha256.has_key?(architecture)
return @source_sha256[architecture]
if @source_sha256.respond_to?(:has_key?)
return @source_sha256.has_key?(architecture) ? @source_sha256[architecture] : nil
else
return @source_sha256
end