migration with svn Numbers

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1623 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
allo 19 years ago
parent 08aea2597d
commit 40199cea1f

@ -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");

@ -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
@ -268,6 +270,7 @@ public final class yacy {
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 {

@ -697,3 +697,5 @@ httpc.nameCacheNoCachingPatterns = .*.dyndns.org, .*.dynalias.org
#externalRedirectors
#squid Redirector compatible
externalRedirector=
svnRevision=0

Loading…
Cancel
Save