Add support for git repositories and gitweb
authorKevin Rosenberg <kevin@rosenberg.net>
Thu, 6 Sep 2007 03:02:25 +0000 (21:02 -0600)
committerKevin Rosenberg <kevin@rosenberg.net>
Thu, 6 Sep 2007 03:02:25 +0000 (21:02 -0600)
downloads.lisp

index 21473d15f8366b8bd585b2efc342ca9b58670975..3408a4fc428e654fb9bf34ef9be09f4e893d82a8 100644 (file)
               (decf (dl-data-indent dl-data)))
           (display-one-section title value dl-data))))))
 
-(defun display-page (pkg-name pkg-base dl-base dl-url sects)
+(defun display-page (pkg-name pkg-base dl-base dl-url giturl gitweb sects)
   (let ((dl-data (make-dl-data :indent 3
                                :base dl-base
                                :url dl-url
     (display-header pkg-name dl-url)
     (dolist (sect sects)
       (display-sections sect dl-data))
+    (when giturl
+      (if gitweb
+          (lml-format "<h2>Git Repository</h2><tt><a href=\"~A\">~A</a></tt>" gitweb giturl)
+          (lml-format "<h2>Git Repository</h2><tt>~A</tt>" giturl)))
     (display-footer dl-data)))
 
-(defun std-dl-page (pkg-name pkg-base dl-base dl-url)
+(defun std-dl-page (pkg-name pkg-base dl-base dl-url &optional giturl gitweb)
   (let ((base (parse-namestring dl-base)))
     (let ((tgz-path (make-pathname :defaults base :type "gz" :name :wild))
           (zip-path (make-pathname :defaults base :type "zip" :name :wild))
           (doc-path (make-pathname :defaults base :type "pdf" :name :wild)))
-      (display-page pkg-name pkg-base dl-base dl-url
+      (display-page pkg-name pkg-base dl-base dl-url giturl gitweb
                     `(("Manual" ,doc-path)
                       ("Source Code"
                        (("Unix (.tar.gz)" ,tgz-path)