Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
asdf
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Pascal J. Bourguignon
asdf
Commits
d9c775e3
Commit
d9c775e3
authored
Sep 19, 2016
by
Francois-Rene Rideau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update comments and docstrings in package-inferred-system.lisp
parent
4b357e64
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
package-inferred-system.lisp
package-inferred-system.lisp
+16
-2
No files found.
package-inferred-system.lisp
View file @
d9c775e3
...
...
@@ -14,27 +14,36 @@
(
in-package
:asdf/package-inferred-system
)
(
with-upgradability
()
;; The names of the recognized defpackage forms.
(
defparameter
*defpackage-forms*
'
(
defpackage
define-package
))
(
defun
initial-package-inferred-systems-table
()
;; Mark all existing packages are preloaded.
(
let
((
h
(
make-hash-table
:test
'equal
)))
(
dolist
(
p
(
list-all-packages
))
(
dolist
(
n
(
package-names
p
))
(
setf
(
gethash
n
h
)
t
)))
h
))
;; Mapping from package names to systems that provide them.
(
defvar
*package-inferred-systems*
(
initial-package-inferred-systems-table
))
(
defclass
package-inferred-system
(
system
)
())
()
(
:documentation
"Class for primary systems for which secondary systems are automatically
in the one-file, one-file, one-system style: system names are mapped to files under the primary
system's system-source-directory, dependencies are inferred from the first defpackage form in
every such file"
))
;; For backward compatibility only. To be removed in an upcoming release:
;;
DEPRECATED.
For backward compatibility only. To be removed in an upcoming release:
(
defclass
package-system
(
package-inferred-system
)
())
;; Is a given form recognizable as a defpackage form?
(
defun
defpackage-form-p
(
form
)
(
and
(
consp
form
)
(
member
(
car
form
)
*defpackage-forms*
)))
;; Find the first defpackage form in a stream, if any
(
defun
stream-defpackage-form
(
stream
)
(
loop
:for
form
=
(
read
stream
nil
nil
)
:while
form
:when
(
defpackage-form-p
form
)
:return
form
))
...
...
@@ -69,6 +78,7 @@ the DEFPACKAGE-FORM uses it or imports a symbol from it."
:from-end
t
:test
'equal
))
(
defun
package-designator-name
(
package
)
"Normalize a package designator to a string"
(
etypecase
package
(
package
(
package-name
package
))
(
string
package
)
...
...
@@ -88,11 +98,14 @@ otherwise return a default system name computed from PACKAGE-NAME."
system-name
(
string-downcase
package-name
)))
;; Given a file in package-inferred-system style, find its dependencies
(
defun
package-inferred-system-file-dependencies
(
file
&optional
system
)
(
if-let
(
defpackage-form
(
file-defpackage-form
file
))
(
remove
t
(
mapcar
'package-name-system
(
package-dependencies
defpackage-form
)))
(
error
'package-inferred-system-missing-package-error
:system
system
:pathname
file
)))
;; Given package-inferred-system object, check whether its specification matches
;; the provided parameters
(
defun
same-package-inferred-system-p
(
system
name
directory
subpath
around-compile
dependencies
)
(
and
(
eq
(
type-of
system
)
'package-inferred-system
)
(
equal
(
component-name
system
)
name
)
...
...
@@ -107,6 +120,7 @@ otherwise return a default system name computed from PACKAGE-NAME."
(
and
(
slot-boundp
child
'relative-pathname
)
(
equal
(
slot-value
child
'relative-pathname
)
subpath
))))))))
;; sysdef search function to push into *system-definition-search-functions*
(
defun
sysdef-package-inferred-system-search
(
system
)
(
let
((
primary
(
primary-system-name
system
)))
(
unless
(
equal
primary
system
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment