Repository: conan-io/conan-center-index

Issue:
[package] msys2/20190524: URL to the msys repo is dead
<!-- 
  Please don't forget to update the issue title.
  Include all applicable information to help us reproduce your problem.
-->

### Package and Environment Details (include every applicable attribute)
  * Package Name/Version: **msys2/20161025**
  * Operating System+version: **Windows 10**
  * Compiler+version: **Visual Studio 16**
  * Conan version: **conan 1.22.2**
  * Python version: **Python 3.8.1**


### Conan profile (output of `conan profile show default` or `conan profile show <profile>` if custom profile is in use)
```
[settings]
os=Windows
os_build=Windows
arch=x86_64
arch_build=x86_64
compiler=Visual Studio
compiler.version=16
build_type=Release
[options]
[build_requires]
[env]
```


### Steps to reproduce (Include if Applicable)
I tried to build a QT package, which has an indirect dependency to the msys2 package.
When conan tries to build the package, throws an HTTP connection exception. (See the logs)
Opening the url in the conandata.yml could not be opened either.

### Logs (Include/Attach if Applicable)
<details><summary>Click to expand log</summary>

```
msys2/20161025: Applying build-requirement: 7zip/19.00
msys2/20161025: WARN: Build folder is dirty, removing it: C:\.conan\ddad51\1
msys2/20161025: Copying sources to build folder
msys2/20161025: Building your package in C:\.conan\ddad51\1
msys2/20161025: Generator txt created conanbuildinfo.txt
msys2/20161025: Calling build()
ERROR: Error downloading file http://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20161025.tar.xz: 'HTTPConnectionPool(host='repo.msys2.org', port=80): Max retries exceeded with url: /distrib/x86_64/msys2-base-x86_64-20161025.tar.xz (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x04480820>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))'
Waiting 5 seconds to retry...
msys2/20161025:
msys2/20161025: ERROR: Package '3cbd862cb7a3ea47ed1220dc027f344262d5224f' build failed
msys2/20161025: WARN: Build folder C:\.conan\ddad51\1
ERROR: msys2/20161025: Error in build() method, line 48
        filename = self._download(**self.conan_data["sources"][self.version][arch])
while calling '_download', line 36
        tools.download(url, filename)
        ConanException: Error downloading file http://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20161025.tar.xz: 'HTTPConnectionPool(host='repo.msys2.org', port=80): Max retries exceeded with url: /distrib/x86_64/msys2-base-x86_64-20161025.tar.xz (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x04480D00>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))'
```

</details>



Discussion:
Try https://sourceforge.net/projects/msys2/files/Base/x86_64/msys2-x86_64-20190524.exe

Resolving patch:
diff --git a/recipes/msys2/all/conanfile.py b/recipes/msys2/all/conanfile.py
--- a/recipes/msys2/all/conanfile.py
+++ b/recipes/msys2/all/conanfile.py
@@ -32,9 +32,8 @@ def source(self):
 
     def _download(self, url, sha256):
         from six.moves.urllib.parse import urlparse
-        filename = os.path.basename(urlparse(url).path)
-        tools.download(url, filename)
-        tools.check_sha256(filename, sha256)
+        filename = os.path.basename(urlparse(url[0]).path)
+        tools.download(url=url, filename=filename, sha256=sha256)
         return filename
 
     @property
@@ -43,8 +42,6 @@ def _msys_dir(self):
 
     def build(self):
         arch = 0 if self.settings.arch_build == "x86" else 1  # index in the sources list
-        url = self.conan_data["sources"][self.version][arch]["url"]
-        sha256 = self.conan_data["sources"][self.version][arch]["sha256"]
         filename = self._download(**self.conan_data["sources"][self.version][arch])
         tar_name = filename.replace(".xz", "")
         self.run("7z.exe x {0}".format(filename))
@@ -83,7 +80,6 @@ def package(self):
         shutil.copytree(os.path.join(self.package_folder, "bin", "usr", "share", "licenses"),
                         os.path.join(self.package_folder, "licenses"))
 
-
     def package_info(self):
         msys_root = os.path.join(self.package_folder, "bin")
         msys_bin = os.path.join(msys_root, "usr", "bin")


Test patch: