added "delete Release" to Update Page

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4564 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
lulabad 17 years ago
parent 3d122c125c
commit d1b9f50b94

@ -1,5 +1,6 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
#(forwardToSteering)#::<meta http-equiv="REFRESH" content="0; url=/Steering.html?update=1&releaseinstall=#[release]#">#(/forwardToSteering)#
<head>
<title>YaCy '#[clientname]#': System Update</title>
#%env/templates/metas.template%#
@ -29,7 +30,7 @@
&nbsp;&nbsp;<input type="submit" name="checkRelease" value="Check for new Release" />
</form></dd>
<dt><br />Downloaded Releases</dt>
<dd><form action="Steering.html" method="get">
<dd><form action="ConfigUpdate_p.html" method="get">
&nbsp;<select name="releaseinstall">
#{downloadedreleases}#
<option #(selected)#::selected#(/selected)# value="#[file]#">#[name]#</option>
@ -37,6 +38,7 @@
</select>
#(deployenabled)#::no&nbsp;automated installation on development environments::
&nbsp;&nbsp;<input type="submit" name="update" value="Install Release" />
&nbsp;&nbsp;<input type="submit" name="deleteRelease" value="Delete Release" />
#(/deployenabled)#
</form></dd>
<dt><br />Automatic Update</dt>

@ -49,6 +49,12 @@ public class ConfigUpdate_p {
prop.put("candeploy_autoUpdate", "0");
if (post != null) {
if (post.containsKey("update")) {
prop.put("forwardToSteering", "1");
prop.put("forwardToSteering_release",post.get("releaseinstall", ""));
return prop;
}
if (post.containsKey("downloadRelease")) {
// download a release
String release = post.get("releasedownload", "");
@ -65,6 +71,16 @@ public class ConfigUpdate_p {
if (post.containsKey("checkRelease")) {
yacyVersion.allReleases(true);
}
if (post.containsKey("deleteRelease")) {
String release = post.get("releaseinstall", "");
if(release.length() > 0) {
try {
new File(sb.releasePath, release).delete();
} catch (NullPointerException e) {
sb.getLog().logSevere("AUTO-UPDATE: could not delete release " + release + ": " + e.getMessage());
}
}
}
if (post.containsKey("autoUpdate")) {
yacyVersion updateVersion = yacyVersion.rulebasedUpdateInfo(true);

Loading…
Cancel
Save