From 56101303de2ecd982a094e354a4d4d2eb1547d81 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Sat, 12 Jul 2003 17:54:05 +0000 Subject: [PATCH] r5293: *** empty log message *** --- 2/base.lisp | 16 ++----- 2/data.lisp | 8 ++-- 2/debian/changelog | 8 ++++ 2/debian/copyright | 6 +-- 2/downloads.lisp | 109 ++++++++++++++++++++++++--------------------- 2/files.lisp | 8 ++-- 2/package.lisp | 10 ++--- 2/read-macro.lisp | 8 ++-- 2/stdsite.lisp | 9 ++-- 2/tests.lisp | 5 ++- 2/utils.lisp | 36 ++++++--------- 11 files changed, 105 insertions(+), 118 deletions(-) diff --git a/2/base.lisp b/2/base.lisp index 01b3c76..ee6598e 100644 --- a/2/base.lisp +++ b/2/base.lisp @@ -7,28 +7,21 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Aug 2002 ;;;; -;;;; $Id: base.lisp,v 1.6 2003/06/29 16:21:09 kevin Exp $ +;;;; $Id: base.lisp,v 1.7 2003/07/12 17:54:05 kevin Exp $ ;;;; -;;;; This file, part of LML, is Copyright (c) 2002 by Kevin M. Rosenberg +;;;; This file, part of LML2, is Copyright (c) 2000-2003 by Kevin Rosenberg. +;;;; Rights of modification and redistribution are in the LICENSE file. ;;;; -;;;; LML users are granted the rights to distribute and use this software -;;;; as governed by the terms of the GNU General Public License v2 -;;;; (http://www.gnu.org/licenses/gpl.html) ;;;; ************************************************************************* (in-package #:lml2) -(defun reset-indent () - (setq *indent* 0)) - (defun lml-format (str &rest args) (when (streamp *html-stream*) - (when *print-spaces* (indent-spaces *indent* *html-stream*)) (if args (apply #'format *html-stream* str args) - (write-string str *html-stream*)) - (when *print-spaces* (write-char #\newline *html-stream*)))) + (write-string str *html-stream*)))) (defun lml-princ (s) (princ s *html-stream*)) @@ -74,7 +67,6 @@ (html ((:html :xmlns "http://www.w3.org/1999/xhtml") ,@body)))) - (defmacro alink (url desc) diff --git a/2/data.lisp b/2/data.lisp index 9a286ce..3d4c398 100644 --- a/2/data.lisp +++ b/2/data.lisp @@ -7,13 +7,11 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Aug 2002 ;;;; -;;;; $Id: data.lisp,v 1.2 2003/06/23 20:37:43 kevin Exp $ +;;;; $Id: data.lisp,v 1.3 2003/07/12 17:54:05 kevin Exp $ ;;;; -;;;; This file, part of LML2, is Copyright (c) 2002 by Kevin M. Rosenberg +;;;; This file, part of LML2, is Copyright (c) 2000-2003 by Kevin Rosenberg. +;;;; Rights of modification and redistribution are in the LICENSE file. ;;;; -;;;; LML2 users are granted the rights to distribute and use this software -;;;; as governed by the terms of the GNU General Public License v2 -;;;; (http://www.gnu.org/licenses/gpl.html) ;;;; ************************************************************************* (in-package #:lml2) diff --git a/2/debian/changelog b/2/debian/changelog index 92c18c7..5e50b61 100644 --- a/2/debian/changelog +++ b/2/debian/changelog @@ -1,3 +1,11 @@ +cl-lml2 (1.2.0-1) unstable; urgency=low + + * New upstream: + - use function parameters rather than special variables in downloads.lisp + - Remove old gpl copyright statements from files. License in LLGPL + + -- Kevin M. Rosenberg Sat, 12 Jul 2003 11:46:47 -0600 + cl-lml2 (1.1.4-1) unstable; urgency=low * Fix readme.lml diff --git a/2/debian/copyright b/2/debian/copyright index e78a956..fd7d2ac 100644 --- a/2/debian/copyright +++ b/2/debian/copyright @@ -9,17 +9,17 @@ Debian Maintainer: Kevin M. Rosenberg Upstream Copyright Statement ============================ -LML is written and Copyright (c) 2003 by Kevin M. Rosenberg +LML is written and Copyright (c) 2000-2003 by Kevin M. Rosenberg with portions Copyright (c) 1986-2003 by Franz, Inc. LML is licensed under the terms of the Lisp Lesser GNU Public License, known as the LLGPL. The LLGPL consists of a preamble (see below) and the Lessor GNU Public License 2.1 (LGPL-2.1). Where these -conflict, the preamble takes precedence. CLSQL is referenced in the +conflict, the preamble takes precedence. LML2 is referenced in the preamble as the "LIBRARY." The LGPL-2.1 is stored on a Debian system in the file /usr/share/common-licenses/LGPL-2.1. -LML is distributed in the hope that it will be useful, but WITHOUT +LML2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/2/downloads.lisp b/2/downloads.lisp index 2b977c3..f0e16b6 100644 --- a/2/downloads.lisp +++ b/2/downloads.lisp @@ -7,32 +7,26 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Aug 2002 ;;;; -;;;; $Id: downloads.lisp,v 1.1 2003/06/20 04:12:29 kevin Exp $ +;;;; $Id: downloads.lisp,v 1.2 2003/07/12 17:54:05 kevin Exp $ ;;;; -;;;; This file, part of LML2, is Copyright (c) 2002 by Kevin M. Rosenberg +;;;; This file, part of LML2, is Copyright (c) 2000-2003 by Kevin Rosenberg. +;;;; Rights of modification and redistribution are in the LICENSE file. ;;;; -;;;; LML2 users are granted the rights to distribute and use this software -;;;; as governed by the terms of the GNU General Public License v2 -;;;; (http://www.gnu.org/licenses/gpl.html) ;;;; ************************************************************************* (in-package #:lml2) -(defvar *dl-base*) -(defvar *dl-url*) -(defvar *base-name*) -(defvar *section-indent* 0) -(defvar *signed* nil) +(defstruct dl-data base url name indent signed) -(defun list-files (files) +(defun list-files (files dl-data) "List files in a directory for downloading" ;;files.sort() - (mapcar #'print-file files)) + (mapcar (lambda (f) (print-file f dl-data)) files)) -(defun strip-dl-base (file) +(defun strip-dl-base (file base-name) (let ((fdir (pathname-directory file)) - (bdir (pathname-directory *dl-base*))) + (bdir (pathname-directory base-name))) (make-pathname :name (pathname-name file) :type (pathname-type file) @@ -41,23 +35,25 @@ (append '(:absolute) (subseq fdir (length bdir) (length fdir))))))) -(defun print-file (file) +(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-name (strip-dl-base file (dl-data-name 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-url* dl-name basename) + (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) - (setq *signed* t) - (lml-format " [Signature]" *dl-url* dl-name)) + (setf (dl-data-signed dl-data) t) + (lml-format " [Signature]" + (dl-data-url dl-data) dl-name)) (html :br)))) (defun display-header (name url) @@ -66,67 +62,76 @@ (lml-format "

Browse ~A Download Site

" name) (lml-format "~A" url url)) -(defun display-footer () - (when *signed* +(defun display-footer (dl-data) + (when (dl-data-signed) (lml-princ "

GPG Public Key

") (lml-princ "Use this key to verify file signtatures")) (lml-princ "")) -(defun print-sect-title (title) - (lml-format "~A" *section-indent* title *section-indent*)) +(defun print-sect-title (title dl-data) + (lml-format "~A" + (dl-data-indent dl-data) title (dl-data-indent dl-data))) -(defun match-base-name? (name) - (let ((len-base-name (length *base-name*))) +(defun match-base-name? (name base-name) + (let ((len-base-name (length base-name))) (when (>= (length name) len-base-name) - (string= name *base-name* :end1 len-base-name :end2 len-base-name)))) + (string= name base-name :end1 len-base-name :end2 len-base-name)))) -(defun match-base-name-latest? (name) - (let* ((latest (concatenate 'string *base-name* "-latest")) +(defun match-base-name-latest? (name base-name) + (let* ((latest (concatenate 'string base-name "-latest")) (len-latest (length latest))) (when (>= (length name) len-latest) (string= name latest :end1 len-latest :end2 len-latest)))) -(defun filter-against-base (files) - (delete-if-not #'(lambda (f) (match-base-name? (pathname-name f))) files)) +(defun filter-against-base (files base-name) + (delete-if-not + (lambda (f) (match-base-name? (pathname-name f) base-name)) + files)) -(defun filter-latest (files) - (delete-if #'(lambda (f) (match-base-name-latest? (pathname-name f))) files)) +(defun filter-latest (files base-name) + (delete-if + (lambda (f) (match-base-name-latest? (pathname-name f) base-name)) + files)) (defun sort-pathnames (list) - (sort list #'(lambda (a b) (string< (namestring a) (namestring b))))) + (sort list (lambda (a b) (string< (namestring a) (namestring b))))) -(defun display-one-section (title pat) - (let ((files (sort-pathnames (filter-latest - (filter-against-base (directory pat)))))) +(defun display-one-section (title pat dl-data) + (let ((files (sort-pathnames + (filter-latest + (filter-against-base (directory pat) (dl-data-name dl-data)) + (dl-data-name dl-data))))) (when files - (print-sect-title title) + (print-sect-title title dl-data) (lml-princ "
") - (list-files files) + (list-files files dl-data) (lml-princ "
")))) -(defun display-sections (sects) +(defun display-sections (sects dl-data) (when sects (let ((title (car sects)) (value (cadr sects))) (if (consp title) - (dolist (sect sects) (display-sections sect)) + (dolist (sect sects) + (display-sections sect dl-data)) (if (consp value) (progn (print-sect-title title) - (incf *section-indent*) - (display-sections value) - (decf *section-indent*)) - (display-one-section title value)))))) + (incf (dl-data-indent dl-data)) + (display-sections value dl-data) + (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) - (let ((*section-indent* 3) - (*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) - (display-footer))) + (let ((dl-data (make-dl-data :indent 3 + :base dl-base + :url dl-url + :name pkg-base + :signed nil))) + (display-header pkg-name dl-url dl-data) + (dolist (sect sects) + (display-sections sect dl-data)) + (display-footer dl-data))) (defun std-dl-page (pkg-name pkg-base dl-base dl-url) (let ((base (parse-namestring dl-base))) diff --git a/2/files.lisp b/2/files.lisp index 9045cb4..7efb4e6 100644 --- a/2/files.lisp +++ b/2/files.lisp @@ -2,16 +2,14 @@ ;;;; ************************************************************************* ;;;; FILE IDENTIFICATION ;;;; -;;;; Name: files.cl +;;;; Name: files.lisp ;;;; Purpose: File and directory functions for LML ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Aug 2002 ;;;; -;;;; This file, part of LML2, is Copyright (c) 2002 by Kevin M. Rosenberg +;;;; This file, part of LML2, is Copyright (c) 2000-2003 by Kevin Rosenberg. +;;;; Rights of modification and redistribution are in the LICENSE file. ;;;; -;;;; LML2 users are granted the rights to distribute and use this software -;;;; as governed by the terms of the GNU General Public License v2 -;;;; (http://www.gnu.org/licenses/gpl.html) ;;;; ************************************************************************* (in-package #:lml2) diff --git a/2/package.lisp b/2/package.lisp index d246863..432a059 100644 --- a/2/package.lisp +++ b/2/package.lisp @@ -7,13 +7,11 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: June 2003 ;;;; -;;;; $Id: package.lisp,v 1.4 2003/06/29 16:21:09 kevin Exp $ +;;;; $Id: package.lisp,v 1.5 2003/07/12 17:54:05 kevin Exp $ ;;;; -;;;; This file, part of LML2, is Copyright (c) 2002 by Kevin M. Rosenberg +;;;; This file, part of LML2, is Copyright (c) 2000-2003 by Kevin Rosenberg. +;;;; Rights of modification and redistribution are in the LICENSE file. ;;;; -;;;; LML2 users are granted the rights to distribute and use this software -;;;; as governed by the terms of the GNU General Public License v2 -;;;; (http://www.gnu.org/licenses/gpl.html) ;;;; ************************************************************************* (in-package #:cl-user) @@ -24,11 +22,9 @@ (:export ;; data.lisp - #:*print-spaces* #:*html-stream* ;; base.lisp - #:reset-indent #:html-file-page #:dtd-prologue #:lml-format diff --git a/2/read-macro.lisp b/2/read-macro.lisp index 16dc05d..cea9af9 100644 --- a/2/read-macro.lisp +++ b/2/read-macro.lisp @@ -7,13 +7,11 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Aug 2002 ;;;; -;;;; $Id: read-macro.lisp,v 1.1 2003/06/20 04:12:29 kevin Exp $ +;;;; $Id: read-macro.lisp,v 1.2 2003/07/12 17:54:05 kevin Exp $ ;;;; -;;;; This file, part of LML2, is Copyright (c) 2002 by Kevin M. Rosenberg +;;;; This file, part of LML2, is Copyright (c) 2000-2003 by Kevin Rosenberg. +;;;; Rights of modification and redistribution are in the LICENSE file. ;;;; -;;;; LML2 users are granted the rights to distribute and use this software -;;;; as governed by the terms of the GNU General Public License v2 -;;;; (http://www.gnu.org/licenses/gpl.html) ;;;; ************************************************************************* (in-package #:lml2) diff --git a/2/stdsite.lisp b/2/stdsite.lisp index 1ee29db..259bb80 100644 --- a/2/stdsite.lisp +++ b/2/stdsite.lisp @@ -7,15 +7,14 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Aug 2002 ;;;; -;;;; $Id: stdsite.lisp,v 1.6 2003/06/23 23:58:29 kevin Exp $ +;;;; $Id: stdsite.lisp,v 1.7 2003/07/12 17:54:05 kevin Exp $ ;;;; -;;;; This file, part of LML2, is Copyright (c) 2002 by Kevin M. Rosenberg +;;;; This file, part of LML2, is Copyright (c) 2000-2003 by Kevin Rosenberg. +;;;; Rights of modification and redistribution are in the LICENSE file. ;;;; -;;;; LML2 users are granted the rights to distribute and use this software -;;;; as governed by the terms of the GNU General Public License v2 -;;;; (http://www.gnu.org/licenses/gpl.html) ;;;; ************************************************************************* + ;;; A "standard site" is a format for a certain style of web page. ;;; It is based on the LML2 package. ;;; A stdsite page expects to include the following files: diff --git a/2/tests.lisp b/2/tests.lisp index fca7c27..6116688 100644 --- a/2/tests.lisp +++ b/2/tests.lisp @@ -7,9 +7,10 @@ ;;;; Author: Kevin M. Rosenberg ;;;; Date Started: Apr 2003 ;;;; -;;;; $Id: tests.lisp,v 1.1 2003/06/20 04:12:29 kevin Exp $ +;;;; $Id: tests.lisp,v 1.2 2003/07/12 17:54:05 kevin Exp $ ;;;; -;;;; This file is Copyright (c) 2000-2002 by Kevin M. Rosenberg +;;;; This file, part of LML2, is Copyright (c) 2000-2003 by Kevin Rosenberg. +;;;; Rights of modification and redistribution are in the LICENSE file. ;;;; ;;;; ************************************************************************* diff --git a/2/utils.lisp b/2/utils.lisp index a275a3e..a90b325 100644 --- a/2/utils.lisp +++ b/2/utils.lisp @@ -1,6 +1,18 @@ -;;; $Id: utils.lisp,v 1.2 2003/06/28 08:18:21 kevin Exp $ +;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*- +;;;; ************************************************************************* +;;;; FILE IDENTIFICATION ;;;; -;;;; General purpose utilities +;;;; Name: utils.lisp +;;;; Purpose: General purpose utilities +;;;; Author: Kevin M. Rosenberg +;;;; Date Started: June 2002 +;;;; +;;;; $Id: utils.lisp,v 1.3 2003/07/12 17:54:05 kevin Exp $ +;;;; +;;;; This file, part of LML2, is copyrighted and open-source software. +;;;; Rights of modification and redistribution are in the LICENSE file. +;;;; +;;;; ************************************************************************* (in-package #:lml2) @@ -12,26 +24,6 @@ `(aif ,test-form (progn ,@body))) -(defun keyword-symbol? (x) - "Returns T if object is a symbol in the keyword package" - (and (symbolp x) - (string-equal "keyword" (package-name (symbol-package x))))) - -(defun list-to-spaced-string (list) - (format nil "~{~A~^ ~}" list)) - -(defun print-n-chars (char n stream) - (declare (fixnum n) - (optimize (speed 3) (safety 0) (space 0))) - (do ((i 0 (1+ i))) - ((= i n) char) - (declare (fixnum i)) - (write-char char stream))) - -(defun indent-spaces (n &optional (stream *standard-output*)) - "Indent n*2 spaces to output stream" - (print-n-chars #\space (+ n n) stream)) - (defun print-file-contents (file &optional (strm *standard-output*)) "Opens a reads a file. Returns the contents as a single string" (when (probe-file file) -- 2.34.1