combinedVersionString2PrettyString(..) renamd to combined2prettyVersion(..), new parameter "computerName" added to indentify the source of problems

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2871 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
(no author) 18 years ago
parent 8c6e1531e6
commit 5141fa5942

@ -424,7 +424,7 @@ public class Network {
String peertags = serverCodings.set2string(seed.getPeerTags(), ",", false);
prop.put(STR_TABLE_LIST + conCount + "_dhtreceive_peertags", ((peertags == null) || (peertags.length() == 0)) ? "no tags given" : ("tags = " + peertags));
}
prop.put(STR_TABLE_LIST + conCount + "_version", yacy.combinedVersionString2PrettyString(seed.get(yacySeed.VERSION, "0.1")));
prop.put(STR_TABLE_LIST + conCount + "_version", yacy.combined2prettyVersion(seed.get(yacySeed.VERSION, "0.1"), shortname));
prop.put(STR_TABLE_LIST + conCount + "_lastSeen", lastseen);
prop.put(STR_TABLE_LIST + conCount + "_utc", seed.get(yacySeed.UTC, "-"));
prop.put(STR_TABLE_LIST + conCount + "_uptime", serverDate.intervalToString(60000 * Long.parseLong(seed.get(yacySeed.UPTIME, "0"))));

@ -126,7 +126,7 @@ public class Status {
}
// version information
prop.put("versionpp", yacy.combinedVersionString2PrettyString(env.getConfig("version","0.1")));
prop.put("versionpp", yacy.combined2prettyVersion(env.getConfig("version","0.1")));
double thisVersion = Double.parseDouble(env.getConfig("version","0.1"));
// cut off the SVN Rev in the Version
try {thisVersion = Math.round(thisVersion*1000.0)/1000.0;} catch (NumberFormatException e) {}

@ -218,7 +218,7 @@ public class YPStats_p {
req = sb1.profiles.size();
putprop(prop, sb, "Profiles");
prop.put("versionpp", yacy.combinedVersionString2PrettyString(sb.getConfig("version","0.1")));
prop.put("versionpp", yacy.combined2prettyVersion(sb.getConfig("version","0.1")));
prop.put("links", yacyCore.seedDB.mySeed.get(yacySeed.LCOUNT, "unknown"));
prop.put("words", yacyCore.seedDB.mySeed.get(yacySeed.ICOUNT, "unknown"));

@ -158,11 +158,14 @@ public final class yacy {
* If the major version is &gt;= 0.11 - major version is replaced by "dev" and separated SVN-version by '/', e.g."dev/01818" <br>
* "dev/00000" - If the input does not matcht the regular expression above
*/
public static String combinedVersionString2PrettyString(String ver) {
public static String combined2prettyVersion(String ver) {
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);
if (!matcher.find()) {
serverLog.logWarning("STARTUP", "Wrong format of version-string: '" + ver + "'. Using default pretty string 'dev/00000' instead");
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);
@ -298,7 +301,7 @@ public final class yacy {
}
sb.setConfig("version", Double.toString(version));
sb.setConfig("vString", combinedVersionString2PrettyString(Double.toString(version)));
sb.setConfig("vString", combined2prettyVersion(Double.toString(version)));
sb.setConfig("vdate", vDATE);
sb.setConfig("applicationRoot", homePath);
sb.setConfig("startupTime", Long.toString(startup));

Loading…
Cancel
Save