improvments to debianpackage:

* autoupdate completely disabled, display hint
* restart-button in interface works!

* moved all build-Variables to yacyBuildProperties
* fixed some warnings


git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6195 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
f1ori 16 years ago
parent fc1dc38b55
commit 8931c8d6b4

@ -178,7 +178,7 @@ ifdef(`ArchLinux', `
')dnl
ARGS="$JAVA_ARGS -classpath $CLASSPATH yacy"
define(`START_YACY_WITH_START_STOP_DAEMON',`
start-stop-daemon --start --background --make-pidfile --chuid $USER\
/sbin/start-stop-daemon --start --background --make-pidfile --chuid $USER\
--pidfile $PID_FILE --chdir $YACY_HOME --startas $JAVA\
--nicelevel $NICE_VAL\
-- $ARGS

@ -57,7 +57,8 @@
<property name="defaults" location="defaults"/>
<!-- variables for installonlinux target-->
<property name="DESTDIR" value="DESTDIR"/>
<property name="pkgmanager" value="false"/>
<property name="PKGMANAGER" value="false"/>
<property name="RESTARTCMD" value="/etc/init.d/yacy restart"/>
<!-- determining if the .svn directory exists -->
<condition property="svnEntriesFileExists">
@ -146,11 +147,10 @@
<!-- YaCy root directory -->
<filter token="REPL_YACY_ROOT_DIR" value="${yacyroot}"/>
<filter token="REPL_PKGMANAGER" value="${pkgmanager}"/>
<filter token="REPL_PKGMANAGER" value="${PKGMANAGER}"/>
<filter token="REPL_RESTARTCMD" value="${RESTARTCMD}"/>
<!-- deleting old file -->
<delete file="${build}/yacy.java" failonerror="false"/>
<copy file="${src}/yacy.java" tofile="${build}/yacy.java" overwrite="true" filtering="true" />
<!-- apply replacments -->
<delete file="${build}/de/anomic/yacy/yacyBuildProperties.java" failonerror="false"/>
<copy file="${src}/de/anomic/yacy/yacyBuildProperties.java" tofile="${build}/de/anomic/yacy/yacyBuildProperties.java" overwrite="true" filtering="true" />
@ -197,11 +197,12 @@
<pathelement location="${lib}/xerces.jar" />
</path>
<!-- compiling yacy.java -->
<!-- compiling yacyBuildProperties.java -->
<javac srcdir="${build}" destdir="${build}" sourcepath="${src}"
includes="yacy.java,de/anomic/yacy/yacyBuildProperties.java"
includes="de/anomic/yacy/yacyBuildProperties.java"
source="${javacSource}" target="${javacTarget}">
<classpath refid="project.class.path" />
<!--<compilerarg value="-Xlint"/>-->
</javac>
<delete file="${build}/BuildProperties.java" />
@ -211,6 +212,7 @@
debug="true" debuglevel="lines,vars,source"
source="${javacSource}" target="${javacTarget}">
<classpath refid="project.class.path" />
<!--<compilerarg value="-Xlint"/>-->
</javac>
<!-- compiling htroot, htroot/yacy and htroot/htdocsdefault -->
@ -218,7 +220,9 @@
excludes="processing/**"
classpathref="project.class.path"
debug="true" debuglevel="lines,vars,source"
source="${javacSource}" target="${javacTarget}"/>
source="${javacSource}" target="${javacTarget}">
<!--<compilerarg value="-Xlint"/>-->
</javac>
</target>
<target name="compileHtdocsWWW" depends="compileMain" description="Compiling and zipping userspecific servlets">
@ -240,7 +244,6 @@
</target>
<target name="all" depends="compileMain">
<delete file="${build}/yacy.java" />
</target>
<target name="copyMain4Dist" depends="compileMain">
@ -591,7 +594,7 @@
<!-- make clean -->
<target name="clean" description="make clean">
<delete dir="${release_main}" failonerror="false"/>
<delete file="${build}/yacy.java" failonerror="false"/>
<delete file="${build}/de/anomic/yacy/yacyBuildProperties.java" failonerror="false"/>
<delete file="yacy.jar" failonerror="false"/>
<delete file="yacy.exe" failonerror="false"/>
<delete file="${lib}/svnRevNr.jar" failonerror="false"/>
@ -624,7 +627,6 @@
<include name="yacy.stopwords"/>
<include name="yacy.parser"/>
<include name="httpd.mime"/>
<include name="build.properties"/>
</fileset>
</copy>

2
debian/changelog vendored

@ -1,4 +1,4 @@
yacy (0.91svn6172) unstable; urgency=low
yacy (*auto-svn-version*) unstable; urgency=low
* SVN Update

2
debian/control vendored

@ -7,7 +7,7 @@ Standards-Version: 3.7.2
Package: yacy
Architecture: all
Depends: java-virtual-machine, java2-runtime, sudo
Depends: java-virtual-machine, java2-runtime, sudo, debconf
Description: P2P Web Search Engine
YaCy is a Java-based peer-2-peer search engine.
It provoids a personal websearch engine, which is

2
debian/rules vendored

@ -19,7 +19,7 @@ build: build-stamp
build-stamp: configure-stamp
# build yacy
ant build-jar
ant build-jar -DPKGMANAGER=true
m4 -DDebian addon/yacyInit.m4 >debian/yacy.init
clean:

@ -110,8 +110,11 @@
</dl>
</fieldset>
::
You installed YaCy with a package manage. To update YaCy, use the packager manager:<p>
Debian: apt-get update yacy
::
#(/candeploy)#
#%env/templates/footer.template%#
</body>
</html>
</html>

@ -35,6 +35,7 @@ import de.anomic.plasma.plasmaSwitchboard;
import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;
import de.anomic.server.serverSystem;
import de.anomic.yacy.yacyBuildProperties;
import de.anomic.yacy.yacyURL;
import de.anomic.yacy.yacyRelease;
import de.anomic.yacy.yacyVersion;
@ -46,6 +47,19 @@ public class ConfigUpdate_p {
final serverObjects prop = new serverObjects();
final plasmaSwitchboard sb = (plasmaSwitchboard) env;
// set if this should be visible
if (yacyBuildProperties.isPkgManager()) {
prop.put("candeploy", "2");
return prop;
} else if (serverSystem.canExecUnix || serverSystem.isWindows) {
// we can deploy a new system with (i.e.)
// cd DATA/RELEASE;tar xfz $1;cp -Rf yacy/* ../../;rm -Rf yacy
prop.put("candeploy", "1");
} else {
prop.put("candeploy", "0");
}
prop.put("candeploy_configCommit", "0");
prop.put("candeploy_autoUpdate", "0");
@ -107,7 +121,7 @@ public class ConfigUpdate_p {
sb.getLog().logInfo("AUTO-UPDATE: downloading more recent release " + updateVersion.getUrl());
final File downloaded = updateVersion.downloadRelease();
prop.putHTML("candeploy_autoUpdate_downloadedRelease", updateVersion.getName());
final boolean devenvironment = yacyVersion.combined2prettyVersion(sb.getConfig("version","0.1")).startsWith("dev");
final boolean devenvironment = new File(sb.getRootPath(), ".svn").exists();
if (devenvironment) {
sb.getLog().logInfo("AUTO-UPDATE: omiting update because this is a development environment");
prop.put("candeploy_autoUpdate", "3");
@ -133,20 +147,11 @@ public class ConfigUpdate_p {
}
}
// set if this should be visible
if (serverSystem.canExecUnix || serverSystem.isWindows) {
// we can deploy a new system with (i.e.)
// cd DATA/RELEASE;tar xfz $1;cp -Rf yacy/* ../../;rm -Rf yacy
prop.put("candeploy", "1");
} else {
prop.put("candeploy", "0");
}
// version information
final String versionstring = yacyVersion.combined2prettyVersion(sb.getConfig("version","0.1"));
final String versionstring = yacyBuildProperties.getVersion() + "/" + yacyBuildProperties.getSVNRevision();
prop.putHTML("candeploy_versionpp", versionstring);
final boolean devenvironment = versionstring.startsWith("dev");
double thisVersion = Double.parseDouble(sb.getConfig("version","0.1"));
final boolean devenvironment = new File(sb.getRootPath(), ".svn").exists();
double thisVersion = Double.parseDouble(yacyBuildProperties.getVersion());
// cut off the SVN Rev in the Version
try {thisVersion = Math.round(thisVersion*1000.0)/1000.0;} catch (final NumberFormatException e) {}

@ -44,6 +44,7 @@ import de.anomic.server.serverObjects;
import de.anomic.server.serverProcessor;
import de.anomic.server.serverSwitch;
import de.anomic.tools.Formatter;
import de.anomic.yacy.yacyBuildProperties;
import de.anomic.yacy.yacySeed;
import de.anomic.yacy.yacyVersion;
@ -138,13 +139,10 @@ public class Status {
// version information
final String versionstring = yacyVersion.combined2prettyVersion(sb.getConfig("version","0.1"));
//final String versionstring = yacyVersion.combined2prettyVersion(sb.getConfig("version","0.1"));
final String versionstring = yacyBuildProperties.getVersion() + "/" + yacyBuildProperties.getSVNRevision();
prop.put("versionpp", versionstring);
double thisVersion = Double.parseDouble(sb.getConfig("version","0.1"));
// cut off the SVN Rev in the Version
try {thisVersion = Math.round(thisVersion*1000.0)/1000.0;} catch (final NumberFormatException e) {}
// place some more hints
if ((adminaccess) && (sb.getThread(plasmaSwitchboardConstants.CRAWLJOB_LOCAL_CRAWL).getJobCount() == 0) && (sb.getThread(plasmaSwitchboardConstants.INDEXER).getJobCount() == 0)) {
prop.put("hintCrawlStart", "1");

@ -67,7 +67,7 @@ public class Steering {
}
if (post.containsKey("update")) {
final boolean devenvironment = yacyVersion.combined2prettyVersion(sb.getConfig("version","0.1")).startsWith("dev");
final boolean devenvironment = new File(sb.getRootPath(), ".svn").exists();
final String releaseFileName = post.get("releaseinstall", "");
final File releaseFile = new File(sb.getRootPath(), "DATA/RELEASE/".replace("/", File.separator) + releaseFileName);
if ((!devenvironment) && (releaseFile.length() > 0) && (releaseFile.exists())) {

@ -45,6 +45,7 @@ import de.anomic.plasma.plasmaSwitchboard;
import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;
import de.anomic.tools.nxTools;
import de.anomic.yacy.yacyBuildProperties;
import de.anomic.yacy.yacyVersion;
public class Threaddump_p {
@ -62,7 +63,7 @@ public class Threaddump_p {
prop.put("dump", "1");
// Thread dump
final Date dt = new Date();
final String versionstring = yacyVersion.combined2prettyVersion(sb.getConfig("version","0.1"));
final String versionstring = yacyBuildProperties.getVersion() + "/" + yacyBuildProperties.getSVNRevision();
bufferappend(buffer, plain, "************* Start Thread Dump " + dt + " *******************");
bufferappend(buffer, plain, "");

@ -150,7 +150,7 @@ public class User{
sb.userDB.adminLogout(userDB.getLoginToken(requestHeader.getHeaderCookies()));
}
//XXX: This should not be needed anymore, because of isLoggedout
if(! ((String) requestHeader.get(httpRequestHeader.AUTHORIZATION, "xxxxxx")).equals("xxxxxx")){
if(! (requestHeader.get(httpRequestHeader.AUTHORIZATION, "xxxxxx")).equals("xxxxxx")){
prop.put("AUTHENTICATE","admin log-in");
}
}

@ -62,7 +62,7 @@ public class ViewImage {
String urlString = post.get("url", "");
final String urlLicense = post.get("code", "");
final boolean auth = ((String) header.get(httpHeader.CONNECTION_PROP_CLIENTIP, "")).equals("localhost") || sb.verifyAuthentication(header, true); // handle access rights
final boolean auth = (header.get(httpHeader.CONNECTION_PROP_CLIENTIP, "")).equals("localhost") || sb.verifyAuthentication(header, true); // handle access rights
yacyURL url = null;
if ((urlString.length() > 0) && (auth)) try {

@ -56,7 +56,7 @@ public class ViewProfile {
final boolean authenticated = sb.adminAuthenticated(header) >= 2;
final int display = ((post == null) || (!authenticated)) ? 0 : post.getInt("display", 0);
prop.put("display", display);
final String hash = (post == null) ? null : (String) post.get("hash");
final String hash = (post == null) ? null : post.get("hash");
if ((hash == null) || (sb.peers == null)) {
// wrong access

@ -3,6 +3,7 @@
import de.anomic.http.httpRequestHeader;
import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;
import de.anomic.yacy.yacyBuildProperties;
public class version {
@ -10,9 +11,9 @@ public class version {
// return variable that accumulates replacements
final serverObjects prop = new serverObjects();
prop.put("version", env.getConfig("version", "0.0"));
prop.put("svnRev", env.getConfig("svnRevision", "0"));
prop.put("buildDate", env.getConfig("vdate", "19700101"));
prop.put("versionstring", yacyBuildProperties.getLongVersion());
prop.put("svnRev", yacyBuildProperties.getSVNRevision());
prop.put("buildDate", yacyBuildProperties.getBuildDate());
// return rewrite properties
return prop;
}

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<version>
<number>#[version]#</number>
<number>#[versionstring]#</number>
<svnRevision>#[svnRev]#</svnRevision>
<buildDate>#[buildDate]#</buildDate>
</version>

@ -39,7 +39,7 @@ public class opensearchdescription {
String promoteSearchPageGreeting = env.getConfig(plasmaSwitchboardConstants.GREETING, "");
if (env.getConfigBool(plasmaSwitchboardConstants.GREETING_NETWORK_NAME, false)) promoteSearchPageGreeting = env.getConfig("network.unit.description", "");
String thisaddress = (String) header.get("Host", "localhost");
String thisaddress = header.get("Host", "localhost");
if (thisaddress.indexOf(":") == -1) thisaddress += ":" + serverCore.getPortNr(env.getConfig("port", "8080"));
int compareyacy = 0;

@ -62,7 +62,7 @@ public class welcome {
prop.put("hostip", "Unknown Host Exception");
}
prop.put("port", serverCore.getPortNr(env.getConfig("port","8080")));
prop.put("clientip", (String) header.get(httpHeader.CONNECTION_PROP_CLIENTIP, ""));
prop.put("clientip", header.get(httpHeader.CONNECTION_PROP_CLIENTIP, ""));
final String peertype = (sb.peers.mySeed() == null) ? yacySeed.PEERTYPE_JUNIOR : sb.peers.mySeed().get(yacySeed.PEERTYPE, yacySeed.PEERTYPE_VIRGIN);
final boolean senior = (peertype.equals(yacySeed.PEERTYPE_SENIOR)) || (peertype.equals(yacySeed.PEERTYPE_PRINCIPAL));

@ -72,8 +72,8 @@ public final class hello {
final String countStr = post.get("count", "0");
int count = 0;
try {count = (countStr == null) ? 0 : Integer.parseInt(countStr);} catch (final NumberFormatException e) {count = 0;}
// final Date remoteTime = yacyCore.parseUniversalDate((String) post.get(MYTIME)); // read remote time
final String clientip = (String) header.get(httpHeader.CONNECTION_PROP_CLIENTIP, "<unknown>"); // read an artificial header addendum
// final Date remoteTime = yacyCore.parseUniversalDate(post.get(MYTIME)); // read remote time
final String clientip = header.get(httpHeader.CONNECTION_PROP_CLIENTIP, "<unknown>"); // read an artificial header addendum
final InetAddress ias = serverDomains.dnsResolve(clientip);
if (ias == null) {
prop.put("message", "cannot resolve your IP from your reported location " + clientip);
@ -97,7 +97,7 @@ public final class hello {
// if ((properTest != null) && (! properTest.substring(0,1).equals("IP"))) { return null; }
// we easily know the caller's IP:
final String userAgent = (String) header.get(httpHeader.USER_AGENT, "<unknown>");
final String userAgent = header.get(httpHeader.USER_AGENT, "<unknown>");
final String reportedip = remoteSeed.getIP();
final String reportedPeerType = remoteSeed.get(yacySeed.PEERTYPE, yacySeed.PEERTYPE_JUNIOR);
final float clientversion = remoteSeed.getVersion();

@ -602,7 +602,7 @@ public class yacysearch {
prop.put("depth", "0");
// adding some additional properties needed for the rss feed
String hostName = (String) header.get("Host", "localhost");
String hostName = header.get("Host", "localhost");
if (hostName.indexOf(":") == -1) hostName += ":" + serverCore.getPortNr(env.getConfig("port", "8080"));
prop.put("searchBaseURL", "http://" + hostName + "/yacysearch.html");
prop.put("rssYacyImageURL", "http://" + hostName + "/env/grafics/yacy.gif");

@ -62,7 +62,7 @@ public class yacysearchitem {
final String eventID = post.get("eventID", "");
final boolean authenticated = sb.adminAuthenticated(header) >= 2;
final int item = post.getInt("item", -1);
final boolean auth = ((String) header.get(httpHeader.CONNECTION_PROP_CLIENTIP, "")).equals("localhost") || sb.verifyAuthentication(header, true);
final boolean auth = (header.get(httpHeader.CONNECTION_PROP_CLIENTIP, "")).equals("localhost") || sb.verifyAuthentication(header, true);
final int display = (post == null) ? 0 : post.getInt("display", 0);
// default settings for blank item

@ -95,6 +95,7 @@ import de.anomic.server.serverCore;
import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;
import de.anomic.server.servletProperties;
import de.anomic.yacy.yacyBuildProperties;
import de.anomic.yacy.yacyURL;
import de.anomic.yacy.logging.Log;
import de.anomic.ymage.ymageMatrix;
@ -785,7 +786,7 @@ public final class httpdFileHandler {
return;
}
// add the application version, the uptime and the client name to every rewrite table
templatePatterns.put(servletProperties.PEER_STAT_VERSION, switchboard.getConfig("version", ""));
templatePatterns.put(servletProperties.PEER_STAT_VERSION, yacyBuildProperties.getVersion());
templatePatterns.put(servletProperties.PEER_STAT_UPTIME, ((System.currentTimeMillis() - serverCore.startupTime) / 1000) / 60); // uptime in minutes
templatePatterns.putHTML(servletProperties.PEER_STAT_CLIENTNAME, switchboard.getConfig("peerName", "anomic"));
templatePatterns.putHTML(servletProperties.PEER_STAT_CLIENTID, ((plasmaSwitchboard) switchboard).peers.myID());

@ -1557,7 +1557,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch<IndexingStack.
// there is a version that is more recent. Load it and re-start with it
log.logInfo("AUTO-UPDATE: downloading more recent release " + updateVersion.getUrl());
final File downloaded = updateVersion.downloadRelease();
final boolean devenvironment = yacyVersion.combined2prettyVersion(sb.getConfig("version","0.1")).startsWith("dev");
final boolean devenvironment = new File(this.getRootPath(), ".svn").exists();
if (devenvironment) {
log.logInfo("AUTO-UPDATE: omiting update because this is a development environment");
} else if ((downloaded == null) || (!downloaded.exists()) || (downloaded.length() == 0)) {
@ -1948,13 +1948,13 @@ public final class plasmaSwitchboard extends serverAbstractSwitch<IndexingStack.
public int adminAuthenticated(final httpRequestHeader requestHeader) {
// authorization for localhost, only if flag is set to grant localhost access as admin
final String clientIP = (String) requestHeader.get(httpHeader.CONNECTION_PROP_CLIENTIP, "");
final String clientIP = requestHeader.get(httpHeader.CONNECTION_PROP_CLIENTIP, "");
final String refererHost = requestHeader.refererHost();
final boolean accessFromLocalhost = serverCore.isLocalhost(clientIP) && (refererHost.length() == 0 || serverCore.isLocalhost(refererHost));
if (getConfigBool("adminAccountForLocalhost", false) && accessFromLocalhost) return 3; // soft-authenticated for localhost
// get the authorization string from the header
final String authorization = ((String) requestHeader.get(httpRequestHeader.AUTHORIZATION, "xxxxxx")).trim().substring(6);
final String authorization = (requestHeader.get(httpRequestHeader.AUTHORIZATION, "xxxxxx")).trim().substring(6);
// security check against too long authorization strings
if (authorization.length() > 256) return 0;
@ -1964,7 +1964,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch<IndexingStack.
if (accessFromLocalhost && (adminAccountBase64MD5.equals(authorization))) return 3; // soft-authenticated for localhost
// authorization by hit in userDB
if (userDB.hasAdminRight((String) requestHeader.get(httpRequestHeader.AUTHORIZATION, "xxxxxx"), requestHeader.getHeaderCookies())) return 4; //return, because 4=max
if (userDB.hasAdminRight(requestHeader.get(httpRequestHeader.AUTHORIZATION, "xxxxxx"), requestHeader.getHeaderCookies())) return 4; //return, because 4=max
// authorization with admin keyword in configuration
return httpd.staticAdminAuthenticated(authorization, this);

@ -1,4 +1,8 @@
package de.anomic.yacy;
import java.util.Locale;
import de.anomic.yacy.yacyBuildProperties;
/**
* Properties set when compiling this release/version
*/
@ -6,12 +10,32 @@ public class yacyBuildProperties {
private yacyBuildProperties() {
}
public static String getSVNVersion() {
/**
* returns the SVN-Revision Number as a String
*/
public static String getSVNRevision() {
return "@REPL_REVISION_NR@";
}
/**
* returns the version String (e. g. 0.9)
*/
public static String getVersion() {
return "@VERSION@";
return "@REPL_VERSION@";
}
/**
* returns the long version String (e. g. 0.9106712)
*/
public static String getLongVersion() {
return String.format(Locale.US, "%.3f%05d", Double.valueOf(getVersion()), Integer.valueOf(getSVNRevision()));
}
/**
* returns the date, when this release was build
*/
public static String getBuildDate() {
return "@REPL_DATE@";
}
/**
@ -21,4 +45,12 @@ public class yacyBuildProperties {
public static boolean isPkgManager() {
return "@REPL_PKGMANAGER@".equals("true");
}
/**
* returns command to use to restart the YaCy daemon,
* when YaCy was installed with a packagemanger
*/
public static String getRestartCmd() {
return "@REPL_RESTARTCMD@";
}
}

@ -60,6 +60,7 @@ import de.anomic.tools.CryptoLib;
import de.anomic.tools.SignatureOutputStream;
import de.anomic.tools.tarTools;
import de.anomic.yacy.logging.Log;
import de.anomic.yacy.yacyBuildProperties;
public final class yacyRelease extends yacyVersion {
@ -99,6 +100,12 @@ public final class yacyRelease extends yacyVersion {
// if false, null is returned
final plasmaSwitchboard sb = plasmaSwitchboard.getSwitchboard();
// check if release was installed by packagemanager
if (yacyBuildProperties.isPkgManager()) {
yacyCore.log.logInfo("rulebasedUpdateInfo: package manager is used for update");
return null;
}
// check if update process allows update retrieve
final String process = sb.getConfig("update.process", "manual");
if ((!manual) && (!process.equals("auto"))) {
@ -423,7 +430,22 @@ public final class yacyRelease extends yacyVersion {
}
if (serverSystem.canExecUnix) {
if (yacyBuildProperties.isPkgManager()) {
// start a re-start daemon
try {
Log.logInfo("RESTART", "INITIATED");
final String script =
"#!/bin/sh" + serverCore.LF_STRING +
yacyBuildProperties.getRestartCmd() + " >/var/lib/yacy/RELEASE/log" + serverCore.LF_STRING;
final File scriptFile = new File(sb.getRootPath(), "DATA/RELEASE/restart.sh");
serverSystem.deployScript(scriptFile, script);
Log.logInfo("RESTART", "wrote restart-script to " + scriptFile.getAbsolutePath());
serverSystem.execAsynchronous(scriptFile);
Log.logInfo("RESTART", "script is running");
} catch (final IOException e) {
Log.logSevere("RESTART", "restart failed", e);
}
} else if (serverSystem.canExecUnix) {
// start a re-start daemon
try {
Log.logInfo("RESTART", "INITIATED");
@ -452,6 +474,9 @@ public final class yacyRelease extends yacyVersion {
* @param releaseFile
*/
public static void deployRelease(final File releaseFile) {
if(yacyBuildProperties.isPkgManager()) {
return;
}
//byte[] script = ("cd " + plasmaSwitchboard.getSwitchboard().getRootPath() + ";while [ -e ../yacy.running ]; do sleep 1;done;tar xfz " + release + ";cp -Rf yacy/* ../../;rm -Rf yacy;cd ../../;startYACY.sh").getBytes();
try {
final plasmaSwitchboard sb = plasmaSwitchboard.getSwitchboard();

@ -88,12 +88,11 @@ public class yacyVersion implements Comparator<yacyVersion>, Comparable<yacyVers
if (thisVersion == null) {
final plasmaSwitchboard sb = plasmaSwitchboard.getSwitchboard();
if (sb == null) return null;
final boolean full = new File(sb.getRootPath(), "libx").exists();
thisVersion = new yacyVersion(
"yacy" + ((full) ? "" : "_emb") +
"_v" + sb.getConfig("version", "0.1") + "_" +
sb.getConfig("vdate", "19700101") + "_" +
sb.getConfig("svnRevision", "0") + ".tar.gz");
"yacy" +
"_v" + yacyBuildProperties.getVersion() + "_" +
yacyBuildProperties.getBuildDate() + "_" +
yacyBuildProperties.getSVNRevision() + ".tar.gz");
}
return thisVersion;
}
@ -203,4 +202,4 @@ public class yacyVersion implements Comparator<yacyVersion>, Comparable<yacyVers
return name;
}
}
}

@ -78,6 +78,7 @@ import de.anomic.yacy.yacyClient;
import de.anomic.yacy.yacySeedDB;
import de.anomic.yacy.Tray;
import de.anomic.yacy.yacyURL;
import de.anomic.yacy.yacyBuildProperties;
import de.anomic.yacy.yacyRelease;
import de.anomic.yacy.yacyVersion;
import de.anomic.yacy.logging.Log;
@ -121,11 +122,11 @@ import de.anomic.yacy.logging.Log;
public final class yacy {
// static objects
public static final String vString = "@REPL_VERSION@";
public static final String vString = yacyBuildProperties.getVersion();
public static double version = 0.1;
public static boolean pro = false;
public static final String vDATE = "@REPL_DATE@";
public static final String vDATE = yacyBuildProperties.getBuildDate();
public static final String copyright = "[ YaCy v" + vString + ", build " + vDATE + " by Michael Christen / www.yacy.net ]";
public static final String hline = "-------------------------------------------------------------------------------";
@ -155,9 +156,6 @@ public final class yacy {
* @param startupFree free memory at startup time, to be used later for statistics
*/
private static void startup(final File homePath, final long startupMemFree, final long startupMemTotal) {
int oldRev=0;
int newRev=0;
try {
// start up
System.out.println(copyright);
@ -232,41 +230,15 @@ public final class yacy {
sb.setConfig("htTemplatePath", "htroot/env/templates");
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 ...
final Properties buildProp = new Properties();
final File buildPropFile = new File(homePath,"build.properties");
try {
buildProp.load(new FileInputStream(buildPropFile));
} catch (final Exception e) {
Log.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$
final String svnReleaseNrStr = buildProp.getProperty("releaseNr");
final Pattern pattern = Pattern.compile("\\$Revision:\\s(.*)\\s\\$",Pattern.DOTALL+Pattern.CASE_INSENSITIVE);
final Matcher matcher = pattern.matcher(svnReleaseNrStr);
if (matcher.find()) {
final String svrReleaseNr = matcher.group(1);
try {
try {version = Double.parseDouble(vString);} catch (final NumberFormatException e) {version = (float) 0.1;}
version = yacyVersion.versvn2combinedVersion(version, Integer.parseInt(svrReleaseNr));
} catch (final NumberFormatException e) {}
sb.setConfig("svnRevision", svrReleaseNr);
}
}
newRev=Integer.parseInt(sb.getConfig("svnRevision", "0"));
} catch (final Exception e) {
System.err.println("Unable to determine the currently used SVN revision number.");
}
int oldRev = Integer.parseInt(sb.getConfig("svnRevision", "0"));
sb.setConfig("svnRevision", yacyBuildProperties.getSVNRevision());
int newRev = Integer.parseInt(yacyBuildProperties.getSVNRevision());
sb.setConfig("version", Double.toString(version));
sb.setConfig("vString", yacyVersion.combined2prettyVersion(Double.toString(version)));
sb.setConfig("vdate", (vDATE.startsWith("@")) ? DateFormatter.formatShortDay() : vDATE);
// TODO: remove!
//sb.setConfig("version", Double.toString(version));
//sb.setConfig("vString", yacyVersion.combined2prettyVersion(Double.toString(version)));
//sb.setConfig("vdate", (vDATE.startsWith("@")) ? DateFormatter.formatShortDay() : vDATE);
sb.setConfig("applicationRoot", homePath.toString());
Log.logConfig("STARTUP", "YACY Version: " + version + ", Built " + sb.getConfig("vdate", "00000000"));
yacyVersion.latestRelease = version;
// read environment

Loading…
Cancel
Save