mirror of
https://github.com/yacy/yacy_search_server.git
synced 2025-07-23 09:24:39 -04:00
*) made combined2prettyversion less restrictive and made it again easier to read
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3187 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
@ -162,13 +162,17 @@ public final class yacy {
|
||||
return combined2prettyVersion(ver, "");
|
||||
}
|
||||
public static String combined2prettyVersion(String ver, String computerName) {
|
||||
final Matcher matcher = Pattern.compile("\\A(\\d+\\.\\d{3})(\\d{4}|\\d{5})\\z").matcher(ver);
|
||||
final Matcher matcher = Pattern.compile("\\A(\\d+\\.\\d{1,3})(\\d{0,5})\\z").matcher(ver);
|
||||
|
||||
if (!matcher.find()) {
|
||||
serverLog.logWarning("STARTUP", "Peer '"+computerName+"': wrong format of version-string: '" + ver + "'. Using default string 'dev/00000' instead");
|
||||
return "dev/00000";
|
||||
}
|
||||
return (Double.parseDouble(matcher.group(1)) < 0.11 ? "dev" : matcher.group(1)) + "/" + matcher.group(2);
|
||||
}
|
||||
|
||||
String mainversion = (Double.parseDouble(matcher.group(1)) < 0.11 ? "dev" : matcher.group(1));
|
||||
String revision = matcher.group(2);
|
||||
for(int i=revision.length();i<5;++i) revision += "0";
|
||||
return mainversion+"/"+revision;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user