Skip to content

Commit

Permalink
added "delete Release" to Update Page
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4564 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
lulabad committed Mar 15, 2008
1 parent 3d122c1 commit d1b9f50
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
4 changes: 3 additions & 1 deletion htroot/ConfigUpdate_p.html
@@ -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%#
Expand Down Expand Up @@ -29,14 +30,15 @@ <h2>System Update</h2>
&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>
#{/downloadedreleases}#
</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>
Expand Down
16 changes: 16 additions & 0 deletions htroot/ConfigUpdate_p.java
Expand Up @@ -49,6 +49,12 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
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", "");
Expand All @@ -65,6 +71,16 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
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);
Expand Down

0 comments on commit d1b9f50

Please sign in to comment.