Customizable repo's system definition pathnames, for e.g. contrib modules.
Mon May 18 06:28:42 PDT 2009 Maciej Pasternacki <maciej@pasternacki.net>
* Customizable repo's system definition pathnames, for e.g. contrib modules.
diff -rN -u old-cl-librarian/src/package.lisp new-cl-librarian/src/package.lisp
--- old-cl-librarian/src/package.lisp 2014-04-23 20:48:25.000000000 -0700
+++ new-cl-librarian/src/package.lisp 2014-04-23 20:48:26.000000000 -0700
@@ -9,7 +9,7 @@
#:get-file #:get-file-using-protocol
#:find-library #:deflibrary #:undeflibrary
#:repo #:darcs-repo #:svn-repo #:cvs-repo #:git-repo #:hg-repo #:tarball-repo
- #:repo-systems-pathname
+ #:system-pathnames
#:use-shelf #:unuse-shelf #:*used-shelves* #:search-system-in-shelves
#:*asdf-install-fallback* #:*shelves-dir* #:*git-command* #:*hg-command*
#:*svn-command* #:*cvs-command* #:*darcs-command*
diff -rN -u old-cl-librarian/src/repo.lisp new-cl-librarian/src/repo.lisp
--- old-cl-librarian/src/repo.lisp 2014-04-23 20:48:25.000000000 -0700
+++ new-cl-librarian/src/repo.lisp 2014-04-23 20:48:26.000000000 -0700
@@ -16,7 +16,9 @@
((type :allocation :class :initform "Dummy" :initarg :%type :reader %type)
(name :accessor name)
(after-download-hook :initarg :after-download-hook :accessor after-download-hook :initform nil)
- (patch :initarg :patch :accessor patch :initform nil))
+ (patch :initarg :patch :accessor patch :initform nil)
+ (system-pathnames :initarg :system-pathnames :accessor system-pathnames
+ :initform (list (make-pathname :name :wild :type "asd"))))
(:documentation "A source of a single library."))
(defmethod shared-initialize
@@ -58,13 +60,6 @@
(defun repo-name-as-string (repo)
(string-downcase (symbol-name (name repo))))
-(defgeneric repo-systems-pathname (repo)
- (:documentation "Return wild pathname of ASDF system definition files, relative to repo's directory.")
- (:method ((repo t))
- (error "Not implemented."))
- (:method ((repo repo))
- (make-pathname :name :wild :type "asd")))
-
;;; Sample concrete repo class (those will finally go into separate file)
(defclass darcs-repo (repo)
@@ -136,6 +131,7 @@
(defclass tarball-repo (repo)
((type :allocation :class :initform "Tarball" :initarg :%type :reader %type)
(source :initarg :source :reader source))
+ (:default-initargs :system-pathnames (list (make-pathname :directory '(:relative :wild) :name :wild :type "asd")))
(:documentation "Pseudo-repo that downloads package from tarball."))
(defun string-ends-with (str ending)
@@ -157,9 +153,6 @@
tarball)))) ; FIXME: namestring, .tar.bz2, ...
target-dir)
-(defmethod repo-systems-pathname ((repo tarball-repo))
- (make-pathname :directory '(:relative :wild) :name :wild :type "asd"))
-
;;; Define libraries in terms of repositories
(defun %deflibrary (new-repo)
diff -rN -u old-cl-librarian/src/shelves.lisp new-cl-librarian/src/shelves.lisp
--- old-cl-librarian/src/shelves.lisp 2014-04-23 20:48:25.000000000 -0700
+++ new-cl-librarian/src/shelves.lisp 2014-04-23 20:48:26.000000000 -0700
@@ -187,10 +187,13 @@
(setf *used-shelves*
(delete shelf *used-shelves*))))
-(defun shelf&repo-systems-pathname (shelf repo)
- (merge-pathnames (repo-systems-pathname repo)
- (merge-directory-pathname (repo-name-as-string repo)
- (shelf-subdir shelf "site"))))
+(defun shelf&repo-systems (shelf repo)
+ (mapcan #'(lambda (pathname)
+ (directory
+ (merge-pathnames pathname
+ (merge-directory-pathname (repo-name-as-string repo)
+ (shelf-subdir shelf "site")))))
+ (system-pathnames repo)))
(defun search-system-in-shelves (system &aux (system-name (asdf::coerce-name system)))
"Search for ASDF system SYSTEM in used shelves.
@@ -202,8 +205,7 @@
(and (string= (pathname-name pathname)
system-name)
pathname))
- (directory
- (shelf&repo-systems-pathname shelf repo))))
+ (shelf&repo-systems shelf repo)))
(shelf-contents shelf)))
*used-shelves*))