X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=downloads.cl;h=7b528d4bdde327496463939929a1a03d21395087;hb=3e2b38a582f3b17eb3d80aa828f8f078b0a1f976;hp=917c87f534912afdabb2157b38d12f5aa507a82b;hpb=a724da82a83bef8179f2ae7d0573eaa049665fb1;p=lml.git diff --git a/downloads.cl b/downloads.cl index 917c87f..7b528d4 100644 --- a/downloads.cl +++ b/downloads.cl @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Aug 2002 ;;;; -;;;; $Id: downloads.cl,v 1.3 2002/09/16 03:16:09 kevin Exp $ +;;;; $Id: downloads.cl,v 1.7 2002/09/16 03:43:44 kevin Exp $ ;;;; ;;;; This file, part of LML, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -49,20 +49,17 @@ (make-pathname :name (pathname-name file) :type (pathname-type file)))) (ftp-name (strip-ftp-base file)) - (sig-path - (make-pathname :defaults file - :type - (concatenate 'string - (pathname-type file) ".asc")))) - (with-open-file (strm file :direction :input) - (setq size (round (/ (file-length strm) 1024)))) - (lml-print "~A" *ftp-url* ftp-name basename) - (lml-print "") - (lml-print " (~A, ~:D KB)" modtime size) - (when (probe-file sig-path) - (setq *signed* t) - (lml-print " [Signature]" *ftp-url* ftp-name)) - (br))) + (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-print "~A" *ftp-url* ftp-name basename) + (lml-print "") + (lml-print " (~A, ~:D KB)" modtime size) + (when (probe-file sig-path) + (setq *signed* t) + (lml-print " [Signature]" *ftp-url* ftp-name)) + (br)))) (defun display-header (name url) (lml-print "

Download

") @@ -78,19 +75,22 @@ (defun print-sect-title (title) (lml-print "~A" *section-indent* title *section-indent*)) - + +(defun match-base-name? (name) + (let ((len-base-name (length *base-name*))) + (when (>= (length name) len-base-name) + (dotimes (i len-base-name) + (declare (fixnum i)) + (unless (char= (char *base-name* i) + (char name i)) + (return-from match-base-name? nil))))) + t) + (defun filter-against-base (files) (let ((filtered '())) (dolist (f files) (let ((name (pathname-name f))) - (when - (block search - (dotimes (i (length *base-name*)) - (declare (fixnum i)) - (unless (char= (char *base-name* i) - (char name i)) - (return-from search nil))) - t) + (when (match-base-name? name) (push f filtered)))) (when filtered (sort filtered #'(lambda (a b) (when (and a b)