Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Commit

Permalink
use tools.get
Browse files Browse the repository at this point in the history
this is simpler and automatically removes the downloaded file,
making the final package slimmer by 80MB
  • Loading branch information
ericLemanissier committed Apr 26, 2021
1 parent 2d270f4 commit 264594b
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions recipes/msys2/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,7 @@ def validate(self):
if tools.Version(self.version) >= "20210105" and self.settings.arch != "x86_64":
raise ConanInvalidConfiguration("Only Windows x64 supported")
if tools.Version(self.version) <= "20161025":
raise ConanInvalidConfiguration("msys2 v.20161025 is no longer supported")

def _download(self, url, sha256):
from six.moves.urllib.parse import urlparse
filename = os.path.basename(urlparse(url[0]).path)
tools.download(url=url, filename=filename, sha256=sha256)
return filename
raise ConanInvalidConfiguration("msys2 v.20161025 is no longer supported")

@property
def _keyring_subfolder(self):
Expand Down Expand Up @@ -182,8 +176,7 @@ def source(self):
pass

def _do_source(self):
filename = self._download(**self.conan_data["sources"][self.version][str(self.settings.arch)])
tools.unzip(filename)
tools.get(**self.conan_data["sources"][self.version][str(self.settings.arch)])
self._download_keyring()

def build(self):
Expand Down

0 comments on commit 264594b

Please sign in to comment.