@ -1,4 +1,4 @@
// yacy Version .java
// yacy Release .java
// ----------------
// ----------------
// (C) 2007 by Michael Peter Christen; mc@yacy.net, Frankfurt a. M., Germany
// (C) 2007 by Michael Peter Christen; mc@yacy.net, Frankfurt a. M., Germany
// first published 27.04.2007 on http://yacy.net
// first published 27.04.2007 on http://yacy.net
@ -40,6 +40,7 @@ import java.security.PublicKey;
import java.security.SignatureException ;
import java.security.SignatureException ;
import java.util.ArrayList ;
import java.util.ArrayList ;
import java.util.HashMap ;
import java.util.HashMap ;
import java.util.List ;
import java.util.Map ;
import java.util.Map ;
import java.util.SortedSet ;
import java.util.SortedSet ;
import java.util.TreeSet ;
import java.util.TreeSet ;
@ -70,8 +71,8 @@ public final class yacyRelease extends yacyVersion {
// information about latest release, retrieved from download pages
// information about latest release, retrieved from download pages
// this static information should be overwritten by network-specific locations
// this static information should be overwritten by network-specific locations
// for details see defaults/yacy.network.freeworld.unit
// for details see defaults/yacy.network.freeworld.unit
private static Hash Map< yacyUpdateLocation , DevAndMainVersions > latestReleases = new HashMap < yacyUpdateLocation , DevAndMainVersions > ( ) ;
private static Map< yacyUpdateLocation , DevAndMainVersions > latestReleases = new HashMap < yacyUpdateLocation , DevAndMainVersions > ( ) ;
public final static Array List< yacyUpdateLocation > latestReleaseLocations = new ArrayList < yacyUpdateLocation > ( ) ; // will be initialized with value in defaults/yacy.network.freeworld.unit
public final static List< yacyUpdateLocation > latestReleaseLocations = new ArrayList < yacyUpdateLocation > ( ) ; // will be initialized with value in defaults/yacy.network.freeworld.unit
private DigestURI url ;
private DigestURI url ;
private File releaseFile ;
private File releaseFile ;
@ -359,11 +360,10 @@ public final class yacyRelease extends yacyVersion {
public boolean checkSignature ( ) {
public boolean checkSignature ( ) {
if ( releaseFile ! = null ) {
if ( releaseFile ! = null ) {
try {
try {
CharBuffer signBuffer ;
final CharBuffer signBuffer = new CharBuffer ( getSignatureFile ( ) ) ;
signBuffer = new CharBuffer ( getSignatureFile ( ) ) ;
final byte [ ] signByteBuffer = Base64Order . standardCoder . decode ( signBuffer . toString ( ) . trim ( ) ) ;
byte [ ] signByteBuffer = Base64Order . standardCoder . decode ( signBuffer . toString ( ) . trim ( ) ) ;
final CryptoLib cl = new CryptoLib ( ) ;
CryptoLib cl = new CryptoLib ( ) ;
for ( final yacyUpdateLocation updateLocation : latestReleaseLocations ) {
for ( yacyUpdateLocation updateLocation : latestReleaseLocations ) {
try {
try {
if ( cl . verifySignature ( updateLocation . getPublicKey ( ) ,
if ( cl . verifySignature ( updateLocation . getPublicKey ( ) ,
new FileInputStream ( releaseFile ) , signByteBuffer ) ) {
new FileInputStream ( releaseFile ) , signByteBuffer ) ) {
@ -421,7 +421,7 @@ public final class yacyRelease extends yacyVersion {
}
}
// create yacy.restart file which is used in Windows startscript
// create yacy.restart file which is used in Windows startscript
/ * final File yacyRestart = new File ( sb . getRootPath ( ) , "DATA/yacy.restart" ) ;
/ * final File yacyRestart = new File ( sb . getRootPath ( ) , "DATA/yacy.restart" ) ;
if ( ! yacyRestart . exists ( ) ) {
if ( ! yacyRestart . exists ( ) ) {
try {
try {
yacyRestart . createNewFile ( ) ;
yacyRestart . createNewFile ( ) ;
@ -477,7 +477,7 @@ public final class yacyRelease extends yacyVersion {
* @param releaseFile
* @param releaseFile
* /
* /
public static void deployRelease ( final File releaseFile ) {
public static void deployRelease ( final File releaseFile ) {
if ( yacyBuildProperties . isPkgManager ( ) ) {
if ( yacyBuildProperties . isPkgManager ( ) ) {
return ;
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();
//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();