summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Koch <thomas@koch.ro>2022-07-10 08:23:37 +0000
committerThomas Koch <thomas@koch.ro>2022-07-10 10:14:51 +0000
commit572558244ab21c565f40f476ab6894c3b0f17909 (patch)
tree0abdd758ef37715fb59e143a1066cb102b92412f
parent4503b9e292f2a2f4aa9c5ff9538b7a75231f81c9 (diff)
rm unused build properties PKGMANAGER, RESTARTCMD, DESTDIR
PKGMANAGER is always false, thus the java code wrapped in if statements for this property is dead code and can also be removed. The Debian packaging removed in c4659f0fb01be0f68ce3dcccc1955c8662a5345f did set the PKGMANAGER property to true. When we do distro packages again, we can revisit this commit and redo it with property files instead. RESTARTCMD is only used inside those dead code. DESTDIR is never used even in the build.xml
-rw-r--r--build.xml7
-rw-r--r--htroot/ConfigUpdate_p.java5
-rw-r--r--source/net/yacy/peers/operation/.gitignore1
-rw-r--r--source/net/yacy/peers/operation/yacyBuildProperties.java72
-rw-r--r--source/net/yacy/peers/operation/yacyBuildProperties.java.template19
-rw-r--r--source/net/yacy/peers/operation/yacyRelease.java26
6 files changed, 3 insertions, 127 deletions
diff --git a/build.xml b/build.xml
index 81776f71a..1e21bad53 100644
--- a/build.xml
+++ b/build.xml
@@ -66,11 +66,6 @@
<property name="jquery" location="htroot/jquery/"/>
<property name="portalsearch" location="htroot/portalsearch/"/>
<property name="img-2" location="htroot/yacy/ui/img-2"/>
-
- <!-- variables for installonlinux target-->
- <property name="DESTDIR" value="DESTDIR"/>
- <property name="PKGMANAGER" value="false"/>
- <property name="RESTARTCMD" value="/etc/init.d/yacy restart"/>
<!-- determining if the .git directory exists -->
<condition property="isGit">
@@ -162,8 +157,6 @@
<!-- YaCy root directory -->
<filter token="REPL_YACY_ROOT_DIR" value="${yacyroot}"/>
- <filter token="REPL_PKGMANAGER" value="${PKGMANAGER}"/>
- <filter token="REPL_RESTARTCMD" value="${RESTARTCMD}"/>
<!-- apply replacments -->
<copy file="${src}/net/yacy/peers/operation/yacyBuildProperties.java.template" tofile="${src}/net/yacy/peers/operation/yacyBuildProperties.java" overwrite="true" filtering="true" />
diff --git a/htroot/ConfigUpdate_p.java b/htroot/ConfigUpdate_p.java
index 7a49807fe..9bc35e483 100644
--- a/htroot/ConfigUpdate_p.java
+++ b/htroot/ConfigUpdate_p.java
@@ -53,10 +53,7 @@ public class ConfigUpdate_p {
final Switchboard sb = (Switchboard) env;
// set if this should be visible
- if (yacyBuildProperties.isPkgManager()) {
- prop.put("candeploy", "2");
- return prop;
- } else if (OS.isWindows && sb.appPath.toString().indexOf("Program Files") > -1) {
+ if (OS.isWindows && sb.appPath.toString().indexOf("Program Files") > -1) {
prop.put("candeploy", "3");
return prop;
} else if (OS.canExecUnix || OS.isWindows) {
diff --git a/source/net/yacy/peers/operation/.gitignore b/source/net/yacy/peers/operation/.gitignore
new file mode 100644
index 000000000..ab45c3c2f
--- /dev/null
+++ b/source/net/yacy/peers/operation/.gitignore
@@ -0,0 +1 @@
+yacyBuildProperties.java
diff --git a/source/net/yacy/peers/operation/yacyBuildProperties.java b/source/net/yacy/peers/operation/yacyBuildProperties.java
deleted file mode 100644
index f797543e5..000000000
--- a/source/net/yacy/peers/operation/yacyBuildProperties.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package net.yacy.peers.operation;
-
-import java.util.Locale;
-import java.util.regex.Pattern;
-
-
-/**
- * Properties set when compiling this release/version
- */
-public final class yacyBuildProperties {
- private yacyBuildProperties() {
- }
-
- /**
- * returns the SVN-Revision Number as a String
- */
- public static String getSVNRevision() {
- final String revision = "@REPL_REVISION_NR@";
- if (revision.contains("@") || revision.contains("$")) {
- return "0";
- }
- return revision;
- }
-
- /**
- * returns the version String (e. g. 0.9)
- */
- public static String getVersion() {
- if ("@REPL_VERSION@".contains("@") ) {
- return "0.1";
- }
- return "@REPL_VERSION@";
- }
-
- public static final Pattern versionMatcher = Pattern.compile("\\A(\\d+\\.\\d{1,3})(\\d{0,5})\\z");
-
- /**
- * returns the long version String (e. g. 0.9106712)
- */
- public static String getLongVersion() {
- return String.format(Locale.US, "%.3f%05d", Float.valueOf(getVersion()), Integer.valueOf(getSVNRevision()));
- }
-
- /**
- * returns the date, when this release was build
- */
- public static String getBuildDate() {
- if ("@REPL_DATE@".contains("@")) {
- return "19700101";
- }
- return "@REPL_DATE@";
- }
-
- /**
- * determines, if this release was compiled and installed
- * by a package manager
- */
- 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() {
- if ("@REPL_RESTARTCMD@".contains("@")) {
- return "echo 'error'";
- }
- return "@REPL_RESTARTCMD@";
- }
-} \ No newline at end of file
diff --git a/source/net/yacy/peers/operation/yacyBuildProperties.java.template b/source/net/yacy/peers/operation/yacyBuildProperties.java.template
index 9149ae567..4f6dfd95f 100644
--- a/source/net/yacy/peers/operation/yacyBuildProperties.java.template
+++ b/source/net/yacy/peers/operation/yacyBuildProperties.java.template
@@ -50,23 +50,4 @@ public final class yacyBuildProperties {
}
return "@REPL_DATE@";
}
-
- /**
- * determines, if this release was compiled and installed
- * by a package manager
- */
- 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() {
- if ("@REPL_RESTARTCMD@".contains("@")) {
- return "echo 'error'";
- }
- return "@REPL_RESTARTCMD@";
- }
}
diff --git a/source/net/yacy/peers/operation/yacyRelease.java b/source/net/yacy/peers/operation/yacyRelease.java
index d8a045740..78ad4ce3e 100644
--- a/source/net/yacy/peers/operation/yacyRelease.java
+++ b/source/net/yacy/peers/operation/yacyRelease.java
@@ -108,12 +108,6 @@ public final class yacyRelease extends yacyVersion {
// if false, null is returned
final Switchboard sb = Switchboard.getSwitchboard();
- // check if release was installed by packagemanager
- if (yacyBuildProperties.isPkgManager()) {
- Network.log.info("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"))) {
@@ -445,22 +439,7 @@ public final class yacyRelease extends yacyVersion {
}
}
- if (yacyBuildProperties.isPkgManager()) {
- // start a re-start daemon
- try {
- ConcurrentLog.info("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.getDataPath(), "DATA/RELEASE/restart.sh");
- OS.deployScript(scriptFile, script);
- ConcurrentLog.info("RESTART", "wrote restart-script to " + scriptFile.getAbsolutePath());
- OS.execAsynchronous(scriptFile);
- ConcurrentLog.info("RESTART", "script is running");
- } catch (final IOException e) {
- ConcurrentLog.severe("RESTART", "restart failed", e);
- }
- } else if (OS.canExecUnix) {
+ if (OS.canExecUnix) {
// start a re-start daemon
try {
ConcurrentLog.info("RESTART", "INITIATED");
@@ -492,9 +471,6 @@ public final class yacyRelease extends yacyVersion {
*/
public static boolean deployRelease(final File releaseFile) {
boolean restartTriggered = false;
- if (yacyBuildProperties.isPkgManager()) {
- return restartTriggered;
- }
try {
final Switchboard sb = Switchboard.getSwitchboard();
ConcurrentLog.info("UPDATE", "INITIATED");