X-Git-Url: http://git.kpe.io/?p=lml.git;a=blobdiff_plain;f=2%2Fdownloads.lisp;fp=2%2Fdownloads.lisp;h=0000000000000000000000000000000000000000;hp=21473d15f8366b8bd585b2efc342ca9b58670975;hb=d69fd6931095af586a7ba72e0586330a436f0803;hpb=ffe053ab486b6e503513cf57f5321c61bd38b9c2 diff --git a/2/downloads.lisp b/2/downloads.lisp deleted file mode 100644 index 21473d1..0000000 --- a/2/downloads.lisp +++ /dev/null @@ -1,174 +0,0 @@ -;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*- -;;;; ************************************************************************* -;;;; FILE IDENTIFICATION -;;;; -;;;; Name: downloads.lisp -;;;; Purpose: Generate downloads page -;;;; Programmer: Kevin M. Rosenberg -;;;; Date Started: Aug 2002 -;;;; -;;;; $Id$ -;;;; -;;;; This file, part of LML2, is Copyright (c) 2000-2003 by Kevin Rosenberg. -;;;; Rights of modification and redistribution are in the LICENSE file. -;;;; -;;;; ************************************************************************* - -(in-package #:lml2) - - -(defstruct dl-data base url name indent signed) - -(defun list-files (files dl-data) - "List files in a directory for downloading" - ;;files.sort() - (mapcar (lambda (f) (print-file f dl-data)) files)) - -(defun strip-dl-base (file base) - (let ((fdir (pathname-directory file)) - (bdir (pathname-directory base))) - (make-pathname - :name (pathname-name file) - :type (pathname-type file) - :directory - (when (> (length fdir) (length bdir)) - (append '(:absolute) - (subseq fdir (length bdir) (length fdir))))))) - -(defun print-file (file dl-data) - (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 (dl-data-base dl-data))) - (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)))) - (lml-format "~A" - (dl-data-url dl-data) dl-name basename) - (lml-princ "") - (lml-format " (~A, ~:D KB)" modtime size) - (when (probe-file sig-path) - (setf (dl-data-signed dl-data) t) - (lml-format " [Signature]" - (dl-data-url dl-data) dl-name)) - (html :br)))) - -(defun display-header (name url) - (lml-princ "