Preparations for automatic Languagefile upgrade on new YaCy Version.

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@352 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
allo 20 years ago
parent 664bceced5
commit 129929b396

@ -101,6 +101,13 @@ public class Language_p {
if(translator.translateFiles(sourceDir, destDir, translationFile, "html")){
env.setConfig("htLocaleSelection", lang.substring(0,lang.length()-4));
try{
BufferedWriter bw = new BufferedWriter(new PrintWriter(new FileWriter(new File(destDir, "version"))));
bw.write(env.getConfig("svnRevision", "Error getting Version"));
bw.close();
}catch(IOException e){
//Error
}
return true;
}
}

@ -34,7 +34,7 @@ Your settings are protected by a password.
#(/protection)#
</td></tr>
<tr class="TableCellLight"><td>System version</td><td>
#[version]##(versioncomment)#:: - the latest public version is #[latestVersion]#. Click here to <a href="http://www.yacy.net/yacy/Download.html">download</a> it.#(/versioncomment)#
#[version]# (SVN #[svnRevision]#)#(versioncomment)#:: - the latest public version is #[latestVersion]#. Click here to <a href="http://www.yacy.net/yacy/Download.html">download</a> it.#(/versioncomment)#
</td></tr>
<tr class="TableCellDark"><td>Proxy host</td><td>#[host]#:#[port]#</td></tr>
<tr class="TableCellLight"><td>Port forwarding host</td><td>#(portForwarding)#not used::#[host]#:#[port]# (#(status)#broken::connected#(/status)#)#(/portForwarding)#</td></tr>

@ -78,6 +78,7 @@ public class Status {
prop.put("protection", 1);//protected
// version information
prop.put("svnRevision", env.getConfig("svnRevision", ""));
if ((yacyCore.latestVersion == null) || (yacyCore.latestVersion.length() < 3) || (yacyCore.latestVersion.equals(env.getConfig("version",""))))
prop.put("versioncomment", 0);//no commet
else

@ -153,7 +153,6 @@ public final class yacy {
sb.setConfig("parseableExt", "html,htm,txt,php,shtml,asp");
// if we are running an SVN version, we try to detect the used svn revision now ...
if (vString.equals("@" + "REPL_VERSION" + "@")) {
Properties buildProp = new Properties();
File buildPropFile = null;
try {
@ -163,20 +162,22 @@ public final class yacy {
System.err.println("ERROR: " + buildPropFile.toString() + " not found in settings path");
}
try {
if (buildProp.containsKey("releaseNr")) {
// this normally looks like this: $Revision: 181 $
String svnReleaseNrStr = buildProp.getProperty("releaseNr");
Pattern pattern = Pattern.compile("\\$Revision:\\s(.*)\\s\\$",Pattern.DOTALL+Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(svnReleaseNrStr);
if (matcher.find()) {
String svrReleaseNr = matcher.group(1);
try {
if (buildProp.containsKey("releaseNr")) {
// this normally looks like this: $Revision: 181 $
String svnReleaseNrStr = buildProp.getProperty("releaseNr");
Pattern pattern = Pattern.compile("\\$Revision:\\s(.*)\\s\\$",Pattern.DOTALL+Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(svnReleaseNrStr);
if (matcher.find()) {
String svrReleaseNr = matcher.group(1);
if (vString.equals("@" + "REPL_VERSION" + "@")) {
vString = "SVN " + svrReleaseNr;
}
}
sb.setConfig("svnRevision", svrReleaseNr);
}
} catch (Exception e) {
System.err.println("Unable to determine the currently used SVN revision number.");
}
} catch (Exception e) {
System.err.println("Unable to determine the currently used SVN revision number.");
}
sb.setConfig("version", vString);

Loading…
Cancel
Save