diff options
Diffstat (limited to 'pkgs/development/lisp-modules/quicklisp-to-nix/ql-to-nix.lisp')
-rw-r--r-- | pkgs/development/lisp-modules/quicklisp-to-nix/ql-to-nix.lisp | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/pkgs/development/lisp-modules/quicklisp-to-nix/ql-to-nix.lisp b/pkgs/development/lisp-modules/quicklisp-to-nix/ql-to-nix.lisp index 18cf6d097a21..141fb0f34ebb 100644 --- a/pkgs/development/lisp-modules/quicklisp-to-nix/ql-to-nix.lisp +++ b/pkgs/development/lisp-modules/quicklisp-to-nix/ql-to-nix.lisp @@ -36,19 +36,27 @@ (map 'list 'identity (md5:md5sum-file path)))))))) (defun escape-filename (s) - (format nil "~{~a~}" - (loop - for x in (map 'list 'identity s) - collect - (case x - (#\/ "_slash_") - (#\\ "_backslash_") - (#\_ "__") - (t x))))) + (format + nil "~a~{~a~}" + (if (cl-ppcre:scan "^[a-zA-Z_]" s) "" "_") + (loop + for x in (map 'list 'identity s) + collect + (case x + (#\/ "_slash_") + (#\\ "_backslash_") + (#\_ "__") + (#\. "_dot_") + (t x))))) (defun system-data (system) (let* - ((asdf-system (asdf:find-system system)) + ((asdf-system + (or + (ignore-errors (asdf:find-system system)) + (progn + (ql:quickload system) + (asdf:find-system system)))) (ql-system (ql-dist:find-system system)) (ql-release (ql-dist:release ql-system)) (ql-sibling-systems (ql-dist:provided-systems ql-release)) @@ -73,7 +81,8 @@ :test 'equal) ql-sibling-names :test 'equal)) - (deps (mapcar (lambda (x) (list :name x)) dependencies)) + (deps (mapcar (lambda (x) (list :name x :filename (escape-filename x))) + dependencies)) (description (asdf:system-description asdf-system)) (release-name (ql-dist:short-description ql-release)) (version (cl-ppcre:regex-replace-all |