diff --git a/providers/ark.rb b/providers/ark.rb index db0b3b14..996a82ab 100644 --- a/providers/ark.rb +++ b/providers/ark.rb @@ -47,8 +47,13 @@ def parse_app_dir_name url def oracle_downloaded?(download_path, new_resource) if ::File.exists? download_path require 'digest' - downloaded_sha = Digest::SHA256.file(download_path).hexdigest - downloaded_sha == new_resource.checksum + if new_resource.checksum =~ /^[0-9a-f]{32}$/ + downloaded_sha = Digest::MD5.file(download_path).hexdigest + downloaded_sha == new_resource.md5 + else + downloaded_sha = Digest::SHA256.file(download_path).hexdigest + downloaded_sha == new_resource.checksum + end else return false end diff --git a/resources/ark.rb b/resources/ark.rb index 0318aa2d..f022f427 100644 --- a/resources/ark.rb +++ b/resources/ark.rb @@ -21,7 +21,7 @@ attribute :url, :regex => /^(file|https?):\/\/.*(tar.gz|tgz|bin|zip)$/, :default => nil attribute :mirrorlist, :kind_of => Array, :default => nil -attribute :checksum, :regex => /^[a-zA-Z0-9]{40,64}$/, :default => nil +attribute :checksum, :regex => /^[0-9a-f]{32}$|^[a-zA-Z0-9]{40,64}$/, :default => nil attribute :app_home, :kind_of => String, :default => nil attribute :app_home_mode, :kind_of => Integer, :default => 0755 attribute :bin_cmds, :kind_of => Array, :default => nil