;;;; 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*))
(html
((:html :xmlns "http://www.w3.org/1999/xhtml")
,@body))))
-
(defmacro alink (url desc)
;;;; 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)
+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 <kmr@debian.org> Sat, 12 Jul 2003 11:46:47 -0600
+
cl-lml2 (1.1.4-1) unstable; urgency=low
* Fix readme.lml
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.
;;;; 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)
(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 href=\"~A~A\">~A</a>" *dl-url* dl-name basename)
+ (lml-format "<a href=\"~A~A\">~A</a>"
+ (dl-data-url dl-data) dl-name basename)
(lml-princ "<span class=\"modtime\">")
(lml-format " (~A, <b>~:D <span style=\"font-size:90%;\">KB</span></b>)</span>" modtime size)
(when (probe-file sig-path)
- (setq *signed* t)
- (lml-format " [<a href=\"~A~A.asc\">Signature</a>]" *dl-url* dl-name))
+ (setf (dl-data-signed dl-data) t)
+ (lml-format " [<a href=\"~A~A.asc\">Signature</a>]"
+ (dl-data-url dl-data) dl-name))
(html :br))))
(defun display-header (name url)
(lml-format "<h3>Browse ~A Download Site</h3>" name)
(lml-format "<a style=\"padding-left:20pt;\" href=\"~A\">~A</a>" url url))
-(defun display-footer ()
- (when *signed*
+(defun display-footer (dl-data)
+ (when (dl-data-signed)
(lml-princ "<h3>GPG Public Key</h3>")
(lml-princ "Use this <a href=\"https://www.b9.com/kevin.gpg.asc\">key</a> to verify file signtatures"))
(lml-princ "</div>"))
-(defun print-sect-title (title)
- (lml-format "<h~D>~A</h~D>" *section-indent* title *section-indent*))
+(defun print-sect-title (title dl-data)
+ (lml-format "<h~D>~A</h~D>"
+ (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 "<div style=\"padding-left: 20pt;\">")
- (list-files files)
+ (list-files files dl-data)
(lml-princ "</div>"))))
-(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)))
;;;; *************************************************************************
;;;; 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)
;;;; 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)
(:export
;; data.lisp
- #:*print-spaces*
#:*html-stream*
;; base.lisp
- #:reset-indent
#:html-file-page
#:dtd-prologue
#:lml-format
;;;; 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)
;;;; 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:
;;;; 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.
;;;;
;;;; *************************************************************************
-;;; $Id: utils.lisp,v 1.2 2003/06/28 08:18:21 kevin Exp $\r
+;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-\r
+;;;; *************************************************************************\r
+;;;; FILE IDENTIFICATION\r
;;;;\r
-;;;; General purpose utilities\r
+;;;; Name: utils.lisp\r
+;;;; Purpose: General purpose utilities\r
+;;;; Author: Kevin M. Rosenberg\r
+;;;; Date Started: June 2002\r
+;;;;\r
+;;;; $Id: utils.lisp,v 1.3 2003/07/12 17:54:05 kevin Exp $\r
+;;;;\r
+;;;; This file, part of LML2, is copyrighted and open-source software.\r
+;;;; Rights of modification and redistribution are in the LICENSE file.\r
+;;;;\r
+;;;; *************************************************************************\r
\r
(in-package #:lml2)\r
\r
`(aif ,test-form\r
(progn ,@body)))\r
\r
-(defun keyword-symbol? (x)\r
- "Returns T if object is a symbol in the keyword package"\r
- (and (symbolp x)\r
- (string-equal "keyword" (package-name (symbol-package x)))))\r
-\r
-(defun list-to-spaced-string (list)\r
- (format nil "~{~A~^ ~}" list))\r
-\r
-(defun print-n-chars (char n stream)\r
- (declare (fixnum n)\r
- (optimize (speed 3) (safety 0) (space 0)))\r
- (do ((i 0 (1+ i)))\r
- ((= i n) char)\r
- (declare (fixnum i))\r
- (write-char char stream)))\r
- \r
-(defun indent-spaces (n &optional (stream *standard-output*))\r
- "Indent n*2 spaces to output stream"\r
- (print-n-chars #\space (+ n n) stream))\r
-\r
(defun print-file-contents (file &optional (strm *standard-output*))\r
"Opens a reads a file. Returns the contents as a single string"\r
(when (probe-file file)\r