From e3dce61619372a2d7eb57c8c239c17f363cc99f6 Mon Sep 17 00:00:00 2001 From: BJ Hargrave Date: Sat, 7 Sep 2013 11:13:55 -0400 Subject: [PATCH] Revert "#381 Removed showing the latest version when there" Issue #381 was targeted for milestone 2.3. I am not sure why commit 8ed7e5d was made to master for 2.2. That commit breaks the OSGi build. A better solution to #381 needs to be considered for 2.3. This reverts commit 8ed7e5df7967d104c57ebfb4bca6b304ab6574f3. --- biz.aQute.bndlib/src/aQute/lib/deployer/FileRepo.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/biz.aQute.bndlib/src/aQute/lib/deployer/FileRepo.java b/biz.aQute.bndlib/src/aQute/lib/deployer/FileRepo.java index 1e94835067..57b6b37945 100644 --- a/biz.aQute.bndlib/src/aQute/lib/deployer/FileRepo.java +++ b/biz.aQute.bndlib/src/aQute/lib/deployer/FileRepo.java @@ -447,6 +447,7 @@ public List list(String regex) throws Exception { public SortedSet versions(String bsn) throws Exception { init(); + boolean haslatest = false; File dir = new File(root, bsn); if (dir.isDirectory()) { String versions[] = dir.list(); @@ -455,10 +456,14 @@ public SortedSet versions(String bsn) throws Exception { Matcher m = REPO_FILE.matcher(v); if (m.matches()) { String version = m.group(2); - if (!version.equals("latest")) + if (version.equals("latest")) + haslatest = true; + else list.add(new Version(version)); } } + if ( list.isEmpty() && haslatest) + list.add( new Version(MAX_MAJOR,0,0)); return new SortedList(list); } return SortedList.empty();