Changeset 15991 in project


Ignore:
Timestamp:
09/20/09 19:48:50 (10 years ago)
Author:
sjamaan
Message:

Add installation script

Location:
release/4/qwiki/trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • release/4/qwiki/trunk/qwiki-search.scm

    r15989 r15991  
    3535
    3636(module qwiki-search
    37         (search-install! search-server-uri wiki-page->estraier-doc)
     37        (create-search-node! search-install! search-server-uri
     38         wiki-page->estraier-doc)
    3839
    3940(import chicken scheme)
     
    5051                 (string=? (alist-ref 'name n) "qwiki"))
    5152               (list-nodes (search-server-uri)))
    52     (add-node (search-server-uri) "qwiki")))
     53    (create-search-node!)))
     54
     55(define (create-search-node!)
     56  (add-node (search-server-uri) "qwiki"))
    5357
    5458;; Convert a wiki page to an estraier document plus attributes
  • release/4/qwiki/trunk/qwiki.scm

    r15989 r15991  
    348348
    349349(define (ensure-latest-sources! #!optional force?)
    350   (if (not (directory-exists? (qwiki-source-path)))
    351       (checkout-sources! (qwiki-source-path))
    352       ;; Not sure if this should be done every freaking time - it's slow!
    353       (if force?
    354           (update-sources! (qwiki-source-path))
    355           (void))))
     350  ;; Not sure if this should be done every freaking time - it's slow!
     351  (if force?
     352      (update-sources! (qwiki-source-path))
     353      (void)))
    356354
    357355;; Spiffy handler for requests that should be routed to the wiki
    358356(define (qwiki-handler continue)
    359357  (parameterize ((qwiki-web-path (root-path)))
    360    (ensure-latest-sources!)
    361    (let ((uri (request-uri (current-request))))
    362      (cond
    363       ((find (lambda (a)
    364                (equal? (uri-path uri) (list '/ (->string (car a)))))
    365              (qwiki-global-action-handlers))
    366        => (lambda (handler)
    367             ((cdr handler) (current-request))))
    368       ((any impossible-filename? (cdr (uri-path uri))) ; assumed to be absolute
    369        (read-request-data (current-request))
    370        (send-status 404 "Not found"))
    371       (else (let* ((action (string->symbol
    372                             (alist-ref 'action (uri-query uri) eq? "show")))
    373                    (handler (alist-ref action
    374                                        (qwiki-page-action-handlers)
    375                                        eq? qwiki-show)))
    376               (handler (normalize-path (relative-uri-path uri))
    377                        (current-request))))))))
     358    (cond
     359     ((not (directory-exists? (qwiki-source-path)))
     360      (send-status 503 "Missing checkout"
     361                   (conc "<p>Checkout not found. Expected it in "
     362                         "<code>" (htmlize (qwiki-source-path)) "</code>.<p>"
     363                         "<p>To fix this, please run qwiki-install or change "
     364                         "the value of <code>qwiki-search-path</code>.</p>")))
     365     (else
     366      (ensure-latest-sources!)
     367      (let ((uri (request-uri (current-request))))
     368        (cond
     369         ((find (lambda (a)
     370                  (equal? (uri-path uri) (list '/ (->string (car a)))))
     371                (qwiki-global-action-handlers))
     372          => (lambda (handler)
     373               ((cdr handler) (current-request))))
     374         ((any impossible-filename? (cdr (uri-path uri))) ; should be absolute
     375          (read-request-data (current-request))
     376          (send-status 404 "Not found"))
     377         (else (let* ((action (string->symbol
     378                               (alist-ref 'action (uri-query uri) eq? "show")))
     379                      (handler (alist-ref action
     380                                          (qwiki-page-action-handlers)
     381                                          eq? qwiki-show)))
     382                 (handler (normalize-path (relative-uri-path uri))
     383                          (current-request))))))))))
    378384
    379385)
  • release/4/qwiki/trunk/qwiki.setup

    r15968 r15991  
    3838        (compile -O -d2 qwiki-post-commit-hook.scm))
    3939
     40       ((dynld-name "qwiki-install") ("qwiki-install.scm" )
     41        (compile -O -d2 qwiki-install.scm))
    4042       )
    4143  (list
     
    5153   (dynld-name "qwiki-nowiki.import")
    5254   (dynld-name "qwiki-post-commit-hook")
     55   (dynld-name "qwiki-install")
    5356   )
    5457  )
     
    7174  '("qwiki-post-commit-hook")
    7275  '((version 0.1)))
     76
     77(install-script
     78  'qwiki-install
     79  '("qwiki-install")
     80  '((version 0.1)))
Note: See TracChangeset for help on using the changeset viewer.