Extract package into new temporary directory.
This commit is contained in:
parent
ef1ea75c08
commit
a3182a6386
@ -198,19 +198,22 @@ module Homebrew
|
|||||||
.uniq
|
.uniq
|
||||||
|
|
||||||
if packages.count == 1
|
if packages.count == 1
|
||||||
extract_dir = dir/pkg_path.stem
|
Dir.mktmpdir do |extract_dir|
|
||||||
system_command! "pkgutil", args: ["--expand-full", pkg_path, extract_dir]
|
extract_dir = Pathname(extract_dir)
|
||||||
|
FileUtils.rmdir extract_dir
|
||||||
|
|
||||||
package_info_path = extract_dir/"PackageInfo"
|
system_command! "pkgutil", args: ["--expand-full", pkg_path, extract_dir]
|
||||||
if package_info_path.exist?
|
|
||||||
if (version = version_from_package_info(cask, package_info_path))
|
package_info_path = extract_dir/"PackageInfo"
|
||||||
return version
|
if package_info_path.exist?
|
||||||
|
if (version = version_from_package_info(cask, package_info_path))
|
||||||
|
return version
|
||||||
|
end
|
||||||
|
else
|
||||||
|
onoe "#{pkg_path.basename} does not contain a `PackageInfo` file."
|
||||||
|
next
|
||||||
end
|
end
|
||||||
else
|
|
||||||
onoe "#{pkg_path.basename} does not contain a `PackageInfo` file."
|
|
||||||
next
|
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
opoo "Skipping, #{pkg_path.basename} contains multiple packages."
|
opoo "Skipping, #{pkg_path.basename} contains multiple packages."
|
||||||
next
|
next
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user