[armedbear-cvs] r11700 - trunk/abcl/src/org/armedbear/lisp
Erik Huelsmann
ehuelsmann at common-lisp.net
Fri Mar 6 20:21:04 UTC 2009
Author: ehuelsmann
Date: Fri Mar 6 20:21:01 2009
New Revision: 11700
Log:
Add OpenBSD and NetBSD platform detection support.
Patch by: Julian Fondren (ayrnieu at gmail dot com)
Modified:
trunk/abcl/src/org/armedbear/lisp/Keyword.java
trunk/abcl/src/org/armedbear/lisp/Lisp.java
trunk/abcl/src/org/armedbear/lisp/ShellCommand.java
trunk/abcl/src/org/armedbear/lisp/Utilities.java
Modified: trunk/abcl/src/org/armedbear/lisp/Keyword.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Keyword.java (original)
+++ trunk/abcl/src/org/armedbear/lisp/Keyword.java Fri Mar 6 20:21:01 2009
@@ -101,12 +101,14 @@
LOCAL = internKeyword("LOCAL"),
LONG = internKeyword("LONG"),
NAME = internKeyword("NAME"),
+ NETBSD = internKeyword("NETBSD"),
NEW_VERSION = internKeyword("NEW"),
NEWEST = internKeyword("NEWEST"),
NICKNAMES = internKeyword("NICKNAMES"),
NONE = internKeyword("NONE"),
NO_ERROR = internKeyword("NO-ERROR"),
OBJECT = internKeyword("OBJECT"),
+ OPENBSD = internKeyword("OPENBSD"),
OPERANDS = internKeyword("OPERANDS"),
OPERATION = internKeyword("OPERATION"),
OUTPUT = internKeyword("OUTPUT"),
Modified: trunk/abcl/src/org/armedbear/lisp/Lisp.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Lisp.java (original)
+++ trunk/abcl/src/org/armedbear/lisp/Lisp.java Fri Mar 6 20:21:01 2009
@@ -2139,6 +2139,26 @@
Keyword.FREEBSD,
Keyword.CDR6));
}
+ else if (osName.startsWith("OpenBSD"))
+ {
+ Symbol.FEATURES.setSymbolValue(list7(Keyword.ARMEDBEAR,
+ Keyword.ABCL,
+ Keyword.COMMON_LISP,
+ Keyword.ANSI_CL,
+ Keyword.UNIX,
+ Keyword.OPENBSD,
+ Keyword.CDR6));
+ }
+ else if (osName.startsWith("NetBSD"))
+ {
+ Symbol.FEATURES.setSymbolValue(list7(Keyword.ARMEDBEAR,
+ Keyword.ABCL,
+ Keyword.COMMON_LISP,
+ Keyword.ANSI_CL,
+ Keyword.UNIX,
+ Keyword.NETBSD,
+ Keyword.CDR6));
+ }
else if (osName.startsWith("Windows"))
{
Symbol.FEATURES.setSymbolValue(list6(Keyword.ARMEDBEAR,
Modified: trunk/abcl/src/org/armedbear/lisp/ShellCommand.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/ShellCommand.java (original)
+++ trunk/abcl/src/org/armedbear/lisp/ShellCommand.java Fri Mar 6 20:21:01 2009
@@ -249,25 +249,31 @@
LispObject third)
throws ConditionThrowable
{
- String command = first.getStringValue();
- String namestring = null;
- Stream outputStream = null;
- if (second != NIL) {
- Pathname pathname = coerceToPathname(second);
- namestring = pathname.getNamestring();
- if (namestring == null) {
- return error(new FileError("Pathname has no namestring: " + pathname.writeToString(),
- pathname));
+ if (!(Utilities.isPlatformUnix || Utilities.isPlatformWindows)) {
+ return error(new LispError("run-shell-command not implemented for "
+ + System.getProperty("os.name")));
+ }
+ else {
+ String command = first.getStringValue();
+ String namestring = null;
+ Stream outputStream = null;
+ if (second != NIL) {
+ Pathname pathname = coerceToPathname(second);
+ namestring = pathname.getNamestring();
+ if (namestring == null) {
+ return error(new FileError("Pathname has no namestring: " + pathname.writeToString(),
+ pathname));
+ }
}
+ if (third != NIL)
+ outputStream = checkStream(third);
+ ShellCommand shellCommand = new ShellCommand(command, namestring,
+ outputStream);
+ shellCommand.run();
+ if (outputStream != null)
+ outputStream._finishOutput();
+ return number(shellCommand.exitValue());
}
- if (third != NIL)
- outputStream = checkStream(third);
- ShellCommand shellCommand = new ShellCommand(command, namestring,
- outputStream);
- shellCommand.run();
- if (outputStream != null)
- outputStream._finishOutput();
- return number(shellCommand.exitValue());
}
};
}
Modified: trunk/abcl/src/org/armedbear/lisp/Utilities.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Utilities.java (original)
+++ trunk/abcl/src/org/armedbear/lisp/Utilities.java Fri Mar 6 20:21:01 2009
@@ -46,7 +46,8 @@
isPlatformUnix = osName.startsWith("Linux") ||
osName.startsWith("Mac OS X") || osName.startsWith("Solaris") ||
osName.startsWith("SunOS") || osName.startsWith("AIX") ||
- osName.startsWith("FreeBSD");
+ osName.startsWith("FreeBSD") || osName.startsWith("OpenBSD") ||
+ osName.startsWith("NetBSD");
isPlatformWindows = osName.startsWith("Windows");
}
More information about the armedbear-cvs
mailing list