Skip to content
Browse files

Fix handling of pool bases and deployment thereof.

  • Loading branch information...
Shinmera committed Jul 18, 2019
1 parent 408cafc commit e8889febb57c00de01fa35cbecb2dd0da056826c
Showing with 15 additions and 10 deletions.
  1. +14 −9 asset-pool.lisp
  2. +1 −1 deploy.lisp
@@ -6,13 +6,15 @@

(in-package #:org.shirakumo.fraf.trial)

(defmethod coerce-base (base)
(destructuring-bind (base &rest sub) (if (listp base) base (list base))
(if (and *standalone* (not (pathnamep base)))
(merge-pathnames (format NIL "pool/~(~a~)/~{~a/~}" base sub) (deploy:data-directory))
(merge-pathnames (format NIL "data/~{~a/~}" sub) (etypecase base
(symbol (asdf:system-source-directory base))
(pathname base))))))
(defmethod coerce-base ((system symbol))
(pathname-utils:subdirectory (asdf:system-source-directory system) "data"))

(defmethod coerce-base ((pathname pathname))

(defmethod coerce-base ((list cons))
(destructuring-bind (base &rest sub) list
(apply #'pathname-utils:subdirectory (coerce-base base) sub)))

(defvar *pools* (make-hash-table :test 'eql))

@@ -74,10 +76,13 @@
(mapc #'finalize (list-assets pool)))

(defmethod pool-path ((pool pool) (null null))
(coerce-base (base pool)))
(if *standalone*
(pathname-utils:subdirectory (deploy:data-directory) "pool"
(package-name (symbol-package (name pool))) (string-downcase (name pool)))
(coerce-base (base pool))))

(defmethod pool-path ((pool pool) pathname)
(merge-pathnames pathname (coerce-base (base pool))))
(merge-pathnames pathname (pool-path pool NIL)))

(defmethod pool-path ((name symbol) pathname)
(pool-path (find-pool name T) pathname))
@@ -11,7 +11,7 @@
(deploy:status 1 "Copying pool ~a from ~a" (name pool) (base pool))
(pool-path pool NIL)
(pathname-utils:subdirectory directory "pool" (string-downcase (base pool)))
(pathname-utils:subdirectory directory "pool" (package-name (symbol-package (name pool))) (string-downcase (name pool)))
:copy-root NIL))
(setf *standalone* T))

0 comments on commit e8889fe

Please sign in to comment.
You can’t perform that action at this time.