Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

* workaround for non-working build property replacements

f1orid5e51cfd09d2
diff --git a/source/de/anomic/yacy/yacyBuildProperties.java b/source/de/anomic/yacy/yacyBuildProperties.java
index cf08d3941..e0be04f52 100644
--- a/source/de/anomic/yacy/yacyBuildProperties.java
+++ b/source/de/anomic/yacy/yacyBuildProperties.java
@@ -14,6 +14,9 @@ public class yacyBuildProperties {
* returns the SVN-Revision Number as a String
*/
public static String getSVNRevision() {
+ if ("@REPL_REVISION_NR@".contains("@")) {
+ return "0";
+ }
return "@REPL_REVISION_NR@";
}
@@ -21,6 +24,9 @@ public class yacyBuildProperties {
* returns the version String (e. g. 0.9)
*/
public static String getVersion() {
+ if ("@REPL_VERSION@".contains("@")) {
+ return "0.1";
+ }
return "@REPL_VERSION@";
}
@@ -35,6 +41,9 @@ public class yacyBuildProperties {
* returns the date, when this release was build
*/
public static String getBuildDate() {
+ if ("@REPL_DATE@".contains("@")) {
+ return "19700101";
+ }
return "@REPL_DATE@";
}
@@ -51,6 +60,9 @@ public class yacyBuildProperties {
* when YaCy was installed with a packagemanger
*/
public static String getRestartCmd() {
+ if ("@REPL_RESTARTCMD@".contains("@")) {
+ return "echo 'error'";
+ }
return "@REPL_RESTARTCMD@";
}
}
diff --git a/source/yacy.java b/source/yacy.java
index f279173de..84384b164 100644
--- a/source/yacy.java
+++ b/source/yacy.java
@@ -230,9 +230,14 @@ public final class yacy {
sb.setConfig("htTemplatePath", "htroot/env/templates");
sb.setConfig("parseableExt", "html,htm,txt,php,shtml,asp");
- int oldRev = Integer.parseInt(sb.getConfig("svnRevision", "0"));
- sb.setConfig("svnRevision", yacyBuildProperties.getSVNRevision());
+ int oldRev;
+ try {
+ oldRev = Integer.parseInt(sb.getConfig("svnRevision", "0"));
+ } catch (NumberFormatException e) {
+ oldRev = 0;
+ }
int newRev = Integer.parseInt(yacyBuildProperties.getSVNRevision());
+ sb.setConfig("svnRevision", yacyBuildProperties.getSVNRevision());
// TODO: remove!
//sb.setConfig("version", Double.toString(version));