Mike McQuaid 20e4262fb9
unpack_strategy: prioritise extension instead.
Instead of only looking at the extension when invoked as part of
Homebrew's formulae' download strategies instead prioritise the
extension if it actually exists. When it does not, fall back to the
magic detection logic which is likely to be more reliable.

Fixes https://github.com/Homebrew/brew/issues/5895
2019-04-03 10:32:29 +01:00

16 lines
336 B
Ruby

module UnpackStrategy
class Uncompressed
include UnpackStrategy
def extract_nestedly(prioritise_extension: false, **options)
extract(**options)
end
private
def extract_to_dir(unpack_dir, basename:, verbose:)
FileUtils.cp path, unpack_dir/basename, preserve: true, verbose: verbose
end
end
end