Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
Preparations for automatic Languagefile upgrade on new YaCy Version.
allo129929b3967c
diff --git a/htroot/Language_p.java b/htroot/Language_p.javaindex a3e84d295..dda5cf7e0 100644--- a/htroot/Language_p.java+++ b/htroot/Language_p.java@@ -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;}}diff --git a/htroot/Status.html b/htroot/Status.htmlindex 68db2bb21..e7eea28ed 100644--- a/htroot/Status.html+++ b/htroot/Status.html@@ -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>diff --git a/htroot/Status.java b/htroot/Status.javaindex e65e5bedc..84e5b0f29 100644--- a/htroot/Status.java+++ b/htroot/Status.java@@ -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 commetelsediff --git a/source/yacy.java b/source/yacy.javaindex 69cdaed4b..2963bb889 100644--- a/source/yacy.java+++ b/source/yacy.java@@ -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);