From 336d47574663d44e9c5e0260f6c1b39af66bb36a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Luiz?= Date: Wed, 4 May 2016 06:29:15 +0100 Subject: [PATCH] =?UTF-8?q?fixed=20not=20resolving=20latest=20to=20snapsho?= =?UTF-8?q?t=20for=20MD5=20check=20when=20the=20file=20ex=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packaging/language/maven_artifact.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packaging/language/maven_artifact.py b/packaging/language/maven_artifact.py index 77edd449afa..c71c98d4ac8 100644 --- a/packaging/language/maven_artifact.py +++ b/packaging/language/maven_artifact.py @@ -195,17 +195,17 @@ class MavenDownloader: return v[0] def find_uri_for_artifact(self, artifact): + if artifact.version == "latest": + artifact.version = self._find_latest_version_available(artifact) + if artifact.is_snapshot(): path = "/%s/maven-metadata.xml" % (artifact.path()) xml = self._request(self.base + path, "Failed to download maven-metadata.xml", lambda r: etree.parse(r)) timestamp = xml.xpath("/metadata/versioning/snapshot/timestamp/text()")[0] buildNumber = xml.xpath("/metadata/versioning/snapshot/buildNumber/text()")[0] return self._uri_for_artifact(artifact, artifact.version.replace("SNAPSHOT", timestamp + "-" + buildNumber)) - else: - if artifact.version == "latest": - artifact.version = self._find_latest_version_available(artifact) - return self._uri_for_artifact(artifact, artifact.version) + return self._uri_for_artifact(artifact, artifact.version) def _uri_for_artifact(self, artifact, version=None): if artifact.is_snapshot() and not version: