opam: fix resource staging

Closes https://github.com/Homebrew/homebrew-core/issues/31485.

Closes #31502.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
This commit is contained in:
Dominyk Tiller 2018-08-27 00:12:12 +01:00
parent 4053e90b4d
commit 1d8af5f117
No known key found for this signature in database
GPG key ID: FE19AEFCF658C6F6

View file

@ -79,8 +79,9 @@ class Opam < Formula
# already downloaded the necessary files.
resources.each do |r|
r.verify_download_integrity(r.fetch)
original_name = r.cached_download.basename.sub(/^#{Regexp.escape(name)}--/, "")
cp r.cached_download, buildpath/"src_ext/#{original_name}"
oname = r.cached_download.basename.sub(/^#{Regexp.escape(name)}--/, "")
rname = oname.sub(/#{Regexp.escape(r.name)}--/, "#{r.name}-")
cp r.cached_download, buildpath/"src_ext/#{rname}"
end
system "./configure", "--prefix=#{prefix}", "--mandir=#{man}"