Changeset 12572 in project


Ignore:
Timestamp:
11/22/08 22:07:07 (13 years ago)
Author:
azul
Message:

Move generation of helper-code to a start-update-notify extension.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/3/svnwiki-folksonomy/trunk/svnwiki-folksonomy.scm

    r12533 r12572  
    55(declare (export))
    66(use svnwiki-extensions-support html-stream srfi-40 stream-ext format-modular)
     7
     8(define (archive-start-update-notify env)
     9  (let-from-environment env (path-in path path-out path-out-real program)
     10    ; path-out should always be true, but lets make sure to avoid a crash if
     11    ; some day in some weird situation it isn't.
     12    (when path-out
     13      (let ((dir (svnwiki-make-pathname (list path-out "xsvnwiki-helper" "tags"))))
     14        (unless (directory? dir)
     15          (create-directory dir)))
     16      (write-file-with-tmp
     17        (svnwiki-make-pathname (list "xsvnwiki-helper" "tags") "tags")
     18        "text/javascript"
     19        path-out
     20        (string->stream *tags-script*)))))
    721
    822(define (show-tags-related env)
     
    1630                    (cut vector-ref <> 0)
    1731                    (db-get-tags-page db path-in path))))
    18         ; path-out should always be true, but lets make sure to avoid a crash if
    19         ; some day in some weird situation it isn't.  We only attempt to create
    20         ; the file if we are the post-commit process, since otherwise we may run
    21         ; into permissions issues (the UID for the CGI process may not match the
    22         ; UID of the post-commit, so the CGI should not create pages).
    23         (when (and path-out (string=? program "post-commit"))
    24           (let ((dir (svnwiki-make-pathname (list path-out "xsvnwiki-helper" "tags"))))
    25             (unless (directory? dir)
    26               (create-directory dir)))
    27           (write-file-with-tmp
    28             (svnwiki-make-pathname (list "xsvnwiki-helper" "tags") "tags")
    29             "text/javascript"
    30             path-out
    31             (string->stream *tags-script*)))
    3232        (unless (stream-null? tags)
    3333          (svnwiki-render-bottom-div
     
    267267
    268268(svnwiki-extension-define 'render-bottom-div 'folksonomy show-tags-related)
     269(svnwiki-extension-define 'start-update-notify 'folksonomy archive-start-update-notify)
Note: See TracChangeset for help on using the changeset viewer.