Skip to content

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

migration with svn Numbers

allo40199cea1f18
diff --git a/source/migration.java b/source/migration.java
index bc181628f..b2cfb94b9 100644
--- a/source/migration.java
+++ b/source/migration.java
@@ -58,6 +58,12 @@ public class migration {
migrateSwitchConfigSettings(sb);
migrateWorkFiles(sb);
}
+ public static void migrate(plasmaSwitchboard sb, int fromRev, int toRev){
+ if(fromRev < toRev){
+ serverLog.logInfo("MIGRATION", "Migrating from "+String.valueOf(fromRev)+ " to "+String.valueOf(toRev));
+ migrate(sb);
+ }
+ }
public static void migrateWorkFiles(plasmaSwitchboard sb){
File file=new File(sb.getRootPath(), "DATA/SETTINGS/wiki.db");
diff --git a/source/yacy.java b/source/yacy.java
index bea57e5c2..38c02dc81 100644
--- a/source/yacy.java
+++ b/source/yacy.java
@@ -184,6 +184,8 @@ public final class yacy {
private static void startup(String homePath, long startupMemFree, long startupMemTotal) {
long startup = System.currentTimeMillis();
String restart = "false";
+ int oldRev=0;
+ int newRev=0;
try {
// start up
@@ -267,7 +269,8 @@ public final class yacy {
} catch (Exception e) {
serverLog.logWarning("STARTUP", buildPropFile.toString() + " not found in settings path");
}
-
+
+ oldRev=Integer.parseInt(sb.getConfig("svnRevision", "0"));
try {
if (buildProp.containsKey("releaseNr")) {
// this normally looks like this: $Revision$
@@ -283,6 +286,7 @@ public final class yacy {
sb.setConfig("svnRevision", svrReleaseNr);
}
}
+ newRev=Integer.parseInt(sb.getConfig("svnRevision", "0"));
} catch (Exception e) {
System.err.println("Unable to determine the currently used SVN revision number.");
}
@@ -353,7 +357,7 @@ public final class yacy {
serverFileUtils.copy(new File(htRootPath, "htdocsdefault/dir.html"), new File(shareDefaultPath, "dir.html"));
//} catch (IOException e) {}
- migration.migrate(sb);
+ migration.migrate(sb, oldRev, newRev);
// start main threads
try {
diff --git a/yacy.init b/yacy.init
index 9b488d9d9..6aef05c16 100644
--- a/yacy.init
+++ b/yacy.init
@@ -697,3 +697,5 @@ httpc.nameCacheNoCachingPatterns = .*.dyndns.org, .*.dynalias.org
#externalRedirectors
#squid Redirector compatible
externalRedirector=
+
+svnRevision=0