summaryrefslogtreecommitdiff
path: root/run.lisp
blob: 8eafd6e0e84a8201615be75b83ff689874ec52b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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)