X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=downloads.lisp;h=241dc666ea475dbf3e8ec7caf3bde7ea21a19ab6;hb=7a8e89656838fca36a10f8a882717adc523415d9;hp=d78f776ffcee171a3d52b6804c186a1ba5671f34;hpb=b2e27d22e4901acfffac824ea15679edf14c6ec9;p=lml.git
diff --git a/downloads.lisp b/downloads.lisp
index d78f776..241dc66 100644
--- a/downloads.lisp
+++ b/downloads.lisp
@@ -32,32 +32,32 @@
(defun strip-dl-base (file)
(let ((fdir (pathname-directory file))
- (bdir (pathname-directory *dl-base*)))
+ (bdir (pathname-directory *dl-base*)))
(make-pathname
:name (pathname-name file)
:type (pathname-type file)
- :directory
+ :directory
(when (> (length fdir) (length bdir))
- (append '(:absolute)
- (subseq fdir (length bdir) (length fdir)))))))
-
+ (append '(:absolute)
+ (subseq fdir (length bdir) (length fdir)))))))
+
(defun print-file (file)
(let ((size 0)
- (modtime (date-string (file-write-date file)))
- (basename (namestring
- (make-pathname :name (pathname-name file)
- :type (pathname-type file))))
- (dl-name (strip-dl-base file))
- (sig-path (concatenate 'string (namestring file) ".asc")))
+ (modtime (date-string (file-write-date file)))
+ (basename (namestring
+ (make-pathname :name (pathname-name file)
+ :type (pathname-type file))))
+ (dl-name (strip-dl-base file))
+ (sig-path (concatenate 'string (namestring file) ".asc")))
(when (plusp (length basename))
(with-open-file (strm file :direction :input)
- (setq size (round (/ (file-length strm) 1024))))
+ (setq size (round (/ (file-length strm) 1024))))
(lml-format "~A" *dl-url* dl-name basename)
(lml-princ "")
(lml-format " (~A, ~:D KB)" modtime size)
(when (probe-file sig-path)
- (setq *signed* t)
- (lml-format " [Signature]" *dl-url* dl-name))
+ (setq *signed* t)
+ (lml-format " [Signature]" *dl-url* dl-name))
(br))))
(defun display-header (name url)
@@ -71,7 +71,7 @@
(lml-princ "
")
@@ -107,62 +107,66 @@
(defun display-sections (sects)
(when sects
(let ((title (car sects))
- (value (cadr sects)))
+ (value (cadr sects)))
(if (consp title)
- (dolist (sect sects) (display-sections sect))
- (if (consp value)
- (progn
- (print-sect-title title)
- (incf *section-indent*)
- (display-sections value)
- (decf *section-indent*))
- (display-one-section title value))))))
-
-(defun display-page (pkg-name pkg-base dl-base dl-url sects)
+ (dolist (sect sects) (display-sections sect))
+ (if (consp value)
+ (progn
+ (print-sect-title title)
+ (incf *section-indent*)
+ (display-sections value)
+ (decf *section-indent*))
+ (display-one-section title value))))))
+
+(defun display-page (pkg-name pkg-base dl-base dl-url giturl gitweb sects)
(let ((*section-indent* 3)
- (*dl-base* dl-base)
- (*dl-url* dl-url)
- (*base-name* pkg-base)
- (*signed* nil))
+ (*dl-base* dl-base)
+ (*dl-url* dl-url)
+ (*base-name* pkg-base)
+ (*signed* nil))
(display-header pkg-name dl-url)
(map nil #'display-sections sects)
+ (when giturl
+ (if gitweb
+ (lml-format "
Git Repository
~A" gitweb giturl)
+ (lml-format "
Git Repository
~A" giturl)))
(display-footer)))
-(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
- `(("Manual" ,doc-path)
- ("Source Code"
- (("Unix (.tar.gz)" ,tgz-path)
- ("Windows (.zip)" ,zip-path))))))))
-
-(defun full-dl-page (pkg-name pkg-base dl-base dl-url)
+ (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 giturl gitweb
+ `(("Manual" ,doc-path)
+ ("Source Code"
+ (("Unix (.tar.gz)" ,tgz-path)
+ ("Windows (.zip)" ,zip-path))))))))
+
+(defun full-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))
- (deb-path (merge-pathnames
- (make-pathname :directory '(:relative "linux-debian")
- :type :wild :name :wild)
- base))
- (rpm-path (merge-pathnames
- (make-pathname :directory '(:relative "linux-rpm")
- :type :wild :name :wild)
- base))
- (w32-path (merge-pathnames
- (make-pathname :directory '(:relative "win32")
- :type :wild :name :wild)
- base)))
- (display-page pkg-name pkg-base dl-base dl-url
- `(("Manual" ,doc-path)
- ("Source Code"
- (("Unix (.tar.gz)" ,tgz-path)
- ("Windows (.zip)" ,zip-path)))
- ("Binaries"
- (("Linux Binaries"
- (("Debian Linux" ,deb-path)
- ("RedHat Linux" ,rpm-path)))
- ("Windows Binaries" ,w32-path))))))))
+ (zip-path (make-pathname :defaults base :type "zip" :name :wild))
+ (doc-path (make-pathname :defaults base :type "pdf" :name :wild))
+ (deb-path (merge-pathnames
+ (make-pathname :directory '(:relative "linux-debian")
+ :type :wild :name :wild)
+ base))
+ (rpm-path (merge-pathnames
+ (make-pathname :directory '(:relative "linux-rpm")
+ :type :wild :name :wild)
+ base))
+ (w32-path (merge-pathnames
+ (make-pathname :directory '(:relative "win32")
+ :type :wild :name :wild)
+ base)))
+ (display-page pkg-name pkg-base dl-base dl-url giturl gitweb
+ `(("Manual" ,doc-path)
+ ("Source Code"
+ (("Unix (.tar.gz)" ,tgz-path)
+ ("Windows (.zip)" ,zip-path)))
+ ("Binaries"
+ (("Linux Binaries"
+ (("Debian Linux" ,deb-path)
+ ("RedHat Linux" ,rpm-path)))
+ ("Windows Binaries" ,w32-path))))))))