From f9be73f4a1333f50e00f231e9a8eb3e402fc0c76 Mon Sep 17 00:00:00 2001 From: Michal Svab Date: Fri, 22 May 2015 16:17:26 +0100 Subject: [PATCH] maven_artifact: check whether snapshot is the latest snapshot --- packaging/language/maven_artifact.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packaging/language/maven_artifact.py b/packaging/language/maven_artifact.py index d6dd33166dc..70e3dad2f75 100644 --- a/packaging/language/maven_artifact.py +++ b/packaging/language/maven_artifact.py @@ -309,7 +309,7 @@ def main(): repository_url = dict(default=None), username = dict(default=None), password = dict(default=None), - state = dict(default="present", choices=["present","absent"]), # TODO - Implement a "latest" state + state = dict(default="present", choices=["present","absent"]), # TODO - Implement a "latest" state dest = dict(default=None), ) ) @@ -339,7 +339,10 @@ def main(): if os.path.isdir(dest): dest = dest + "/" + artifact_id + "-" + version + "." + extension if os.path.lexists(dest): - prev_state = "present" + if not artifact.is_snapshot(): + prev_state = "present" + elif downloader.verify_md5(dest, downloader.find_uri_for_artifact(artifact) + '.md5'): + prev_state = "present" else: path = os.path.dirname(dest) if not os.path.exists(path):