diff --git a/lib/inspec/dependencies/resolver.rb b/lib/inspec/dependencies/resolver.rb index 8f8256df6..e722af564 100644 --- a/lib/inspec/dependencies/resolver.rb +++ b/lib/inspec/dependencies/resolver.rb @@ -62,7 +62,7 @@ module Inspec begin dep.resolved_source rescue Inspec::FetcherFailure - Inspec::Log.debug("Failed to fetch #{dep.name}, a falling back to archives if possible") + Inspec::Log.debug("Failed to fetch #{dep.name}, falling back to archives if possible") retry if fallback_to_archive_on_fetch_failure(dep) end end diff --git a/lib/inspec/fetcher/local.rb b/lib/inspec/fetcher/local.rb index 35efb5a81..b9fc142e7 100644 --- a/lib/inspec/fetcher/local.rb +++ b/lib/inspec/fetcher/local.rb @@ -100,6 +100,19 @@ module Inspec::Fetcher end end + def update_from_opts(opts) + changed = false + + old_val = @archive_shasum + new_val = opts[:sha256] + unless old_val == new_val + @archive_shasum = new_val + changed = true + end + + changed + end + def perform_shasum(target) return @archive_shasum if @archive_shasum raise(Inspec::FetcherFailure, "Profile dependency local path '#{target}' does not exist") unless File.exist?(target)