summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2009-10-30 20:53:33 +0100
committerMatthias Benkard <code@mail.matthias.benkard.de>2009-10-30 20:53:33 +0100
commitc0bcd6871d4c7f1af7371aae4fdc24243303a281 (patch)
tree2751488a2d9b1c57c30906b5d2f733633d5397e9
parentddb83b1fb2d305e0c06fc067d82d6bab5458b0fd (diff)
Add run.lisp.
Ignore-this: cafebc56b92360b173d78622c447b172 darcs-hash:97ac9b7c5e16672c01aa1e833eb1c2fa1596b01d
-rwxr-xr-xrun.lisp63
1 files changed, 63 insertions, 0 deletions
diff --git a/run.lisp b/run.lisp
new file mode 100755
index 0000000..8eafd6e
--- /dev/null
+++ b/run.lisp
@@ -0,0 +1,63 @@
+#! /usr/bin/env clisp
+;;;; -*- coding: utf-8; mode: lisp -*-
+;;;; Copyright 2007, Matthias Andreas Benkard.
+
+;;;------------------------------------------------------------------------
+;;; This file is part of The Mulkblog Project.
+;;;
+;;; The Mulkblog Project is free software. You can redistribute it and/or
+;;; modify it under the terms of the Affero General Public License as
+;;; published by Affero, Inc.; either version 1 of the License, or
+;;; (at your option) any later version.
+;;;
+;;; The Mulkblog Project is distributed in the hope that it will be
+;;; useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+;;; of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; Affero General Public License for more details.
+;;;
+;;; You should have received a copy of the Affero General Public
+;;; License in the COPYING file that comes with The Mulkblog Project; if
+;;; not, write to Affero, Inc., 510 Third Street, Suite 225, San
+;;; Francisco, CA 94107 USA.
+;;;------------------------------------------------------------------------
+
+(in-package #:cl-user)
+
+;;; TAKE NOTICE: If you want to run this script from the command line or
+;;; from a web server, be sure to use a core image including the systems
+;;; this script depends upon. The ASDF system definition has mainly
+;;; been written for purposes of debugging, development and
+;;; documentation.
+
+(defclass load-source-simple-op (asdf:operation) ())
+(defmethod asdf:perform ((o load-source-simple-op) (c asdf:component))
+ nil)
+(defmethod asdf:perform ((o load-source-simple-op) (m asdf:module))
+ (dolist (c (asdf:module-components m))
+ (load (asdf:component-pathname c))))
+
+
+#+clisp
+(unless (asdf:find-system :mulk-journal nil)
+ (let ((*package* (find-package :asdf)))
+ (load (merge-pathnames "mulk-journal.asd"
+ system::*current-source-file*))
+ (dolist (x '("s-base64" "s-sysdeps" "s-xml" "s-xml-rpc"))
+ (load (merge-pathnames (make-pathname :directory `(:relative "third-party" ,x) :name x :type "asd")
+ system::*current-source-file*)))))
+
+
+;;; The following does not generally work in a CGI setting because of
+;;; security restrictions. Then again, loading all the dependencies
+;;; individually rather than using a core image would certainly be too
+;;; slow for any serious CGI usage, anyway, so what the heck. Loading
+;;; our own files (no dependencies) using a manually loaded system
+;;; definition (see above) works, which suffices for our needs.
+(dolist (x '("s-base64" "s-sysdeps" "s-xml" "s-xml-rpc"))
+ (asdf:oos 'load-source-simple-op x))
+
+(unless (find-package '#:mulk.journal)
+ (asdf:oos 'load-source-simple-op '#:mulk-journal))
+
+#+clisp
+(script-main)