added copy for Info.plist for Mac application release updates (this file contains class paths and start parameters)

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7133 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 15 years ago
parent 5ce679a053
commit 32f73d1aaa

@ -481,6 +481,15 @@ public final class yacyRelease extends yacyVersion {
} }
String script = null; String script = null;
String scriptFileName = null; String scriptFileName = null;
if (OS.isMacArchitecture) {
// overwrite Info.plist for Mac Applications (this holds the class paths and can be seen as the start script)
File InfoPlistSource = new File(sb.getDataPath(), "DATA/RELEASE/yacy/addon/YaCy.app/Contents/Info.plist");
File InfoPlistDestination = new File(sb.getAppPath(), "addon/YaCy.app/Contents/Info.plist");
if (InfoPlistSource.exists() && InfoPlistDestination.exists()) {
FileUtils.copy(InfoPlistSource, InfoPlistDestination);
Log.logInfo("UPDATE", "replaced Info.plist");
}
}
if (OS.isWindows) { if (OS.isWindows) {
final File startType = new File(sb.getDataPath(), "DATA/yacy.noconsole".replace("/", File.separator)); final File startType = new File(sb.getDataPath(), "DATA/yacy.noconsole".replace("/", File.separator));
String starterFile = "startYACY_debug.bat"; String starterFile = "startYACY_debug.bat";

@ -39,17 +39,19 @@ import net.yacy.kelondro.logging.Log;
public final class OS { public final class OS {
// constants for system identification // constants for system identification
public static final int systemMacOSC = 0; // 'classic' Mac OS 7.6.1/8.*/9.* public enum System {
public static final int systemMacOSX = 1; // all Mac OS X MacOSC, // 'classic' Mac OS 7.6.1/8.*/9.*
public static final int systemUnix = 2; // all Unix/Linux type systems MacOSX, // all Mac OS X
public static final int systemWindows = 3; // all Windows 95/98/NT/2K/XP Unix, // all Unix/Linux type systems
public static final int systemUnknown = -1; // any other system Windows, // all Windows 95/98/NT/2K/XP
Unknown; // any other system
}
// constants for file type identification (Mac only) // constants for file type identification (Mac only)
public static final String blankTypeString = "____"; public static final String blankTypeString = "____";
// system-identification statics // system-identification statics
public static final int systemOS; public static final System systemOS;
public static final boolean isMacArchitecture; public static final boolean isMacArchitecture;
public static final boolean isUnixFS; public static final boolean isUnixFS;
public static final boolean canExecUnix; public static final boolean canExecUnix;
@ -66,19 +68,19 @@ public final class OS {
// static initialization // static initialization
static { static {
// check operation system type // check operation system type
final Properties sysprop = System.getProperties(); final Properties sysprop = java.lang.System.getProperties();
final String sysname = sysprop.getProperty("os.name","").toLowerCase(); final String sysname = sysprop.getProperty("os.name","").toLowerCase();
if (sysname.startsWith("mac os x")) systemOS = systemMacOSX; if (sysname.startsWith("mac os x")) systemOS = System.MacOSX;
else if (sysname.startsWith("mac os")) systemOS = systemMacOSC; else if (sysname.startsWith("mac os")) systemOS = System.MacOSC;
else if (sysname.startsWith("windows")) systemOS = systemWindows; else if (sysname.startsWith("windows")) systemOS = System.Windows;
else if ((sysname.startsWith("linux")) || (sysname.startsWith("unix"))) systemOS = systemUnix; else if ((sysname.startsWith("linux")) || (sysname.startsWith("unix"))) systemOS = System.Unix;
else systemOS = systemUnknown; else systemOS = System.Unknown;
isMacArchitecture = ((systemOS == systemMacOSC) || (systemOS == systemMacOSX)); isMacArchitecture = ((systemOS == System.MacOSC) || (systemOS == System.MacOSX));
isUnixFS = ((systemOS == systemMacOSX) || (systemOS == systemUnix)); isUnixFS = ((systemOS == System.MacOSX) || (systemOS == System.Unix));
canExecUnix = ((isUnixFS) || (!((systemOS == systemMacOSC) || (systemOS == systemWindows)))); canExecUnix = ((isUnixFS) || (!((systemOS == System.MacOSC) || (systemOS == System.Windows))));
isWindows = (systemOS == systemWindows); isWindows = (systemOS == System.Windows);
isWin32 = (isWindows && System.getProperty("os.arch", "").contains("x86")); isWin32 = (isWindows && java.lang.System.getProperty("os.arch", "").contains("x86"));
// set up maximum path length according to system // set up maximum path length according to system
if (isWindows) maxPathLength = 255; else maxPathLength = 65535; if (isWindows) maxPathLength = 255; else maxPathLength = 65535;
@ -119,11 +121,11 @@ public final class OS {
public static String infoString() { public static String infoString() {
String s = "System="; String s = "System=";
if (systemOS == systemUnknown) s += "unknown"; if (systemOS == System.Unknown) s += "unknown";
else if (systemOS == systemMacOSC) s += "Mac OS Classic"; else if (systemOS == System.MacOSC) s += "Mac OS Classic";
else if (systemOS == systemMacOSX) s += "Mac OS X"; else if (systemOS == System.MacOSX) s += "Mac OS X";
else if (systemOS == systemUnix) s += "Unix/Linux"; else if (systemOS == System.Unix) s += "Unix/Linux";
else if (systemOS == systemWindows) s += "Windows"; else if (systemOS == System.Windows) s += "Windows";
else s += "unknown"; else s += "unknown";
if (isMacArchitecture) s += ", Mac System Architecture"; if (isMacArchitecture) s += ", Mac System Architecture";
if (isUnixFS) s += ", has Unix-like File System"; if (isUnixFS) s += ", has Unix-like File System";
@ -134,11 +136,11 @@ public final class OS {
/** generates a 2-character string containing information about the OS-type*/ /** generates a 2-character string containing information about the OS-type*/
public static String infoKey() { public static String infoKey() {
String s = ""; String s = "";
if (systemOS == systemUnknown) s += "o"; if (systemOS == System.Unknown) s += "o";
else if (systemOS == systemMacOSC) s += "c"; else if (systemOS == System.MacOSC) s += "c";
else if (systemOS == systemMacOSX) s += "x"; else if (systemOS == System.MacOSX) s += "x";
else if (systemOS == systemUnix) s += "u"; else if (systemOS == System.Unix) s += "u";
else if (systemOS == systemWindows) s += "w"; else if (systemOS == System.Windows) s += "w";
else s += "o"; else s += "o";
if (isMacArchitecture) s += "m"; if (isMacArchitecture) s += "m";
if (isUnixFS) s += "f"; if (isUnixFS) s += "f";
@ -196,7 +198,7 @@ public final class OS {
public static void main(final String[] args) { public static void main(final String[] args) {
if (args[0].equals("-m")) { if (args[0].equals("-m")) {
System.out.println("Maximum possible memory: " + Integer.toString(getWin32MaxHeap()) + "m"); java.lang.System.out.println("Maximum possible memory: " + Integer.toString(getWin32MaxHeap()) + "m");
} }
} }

Loading…
Cancel
Save