Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl-copy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Richard M Kreuter
cmucl-copy
Commits
37c549c6
Commit
37c549c6
authored
8 years ago
by
Raymond Toy
Browse files
Options
Downloads
Patches
Plain Diff
Factor out the common part of pathname-match-p.
parent
c07cad4b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/code/pathname.lisp
+18
-21
18 additions, 21 deletions
src/code/pathname.lisp
with
18 additions
and
21 deletions
src/code/pathname.lisp
+
18
−
21
View file @
37c549c6
...
@@ -1219,7 +1219,22 @@ a host-structure or string."
...
@@ -1219,7 +1219,22 @@ a host-structure or string."
(
:version
(
frob
(
%pathname-version
pathname
)))))))
(
:version
(
frob
(
%pathname-version
pathname
)))))))
(
defun
%%pathname-match-p
(
pathname
wildname
)
(
macrolet
((
frob
(
field
&optional
(
op
'components-match
))
`
(
or
(
null
(
,
field
wildname
))
(
,
op
(
,
field
pathname
)
(
,
field
wildname
)))))
(
and
(
or
(
null
(
%pathname-host
wildname
))
(
eq
(
%pathname-host
wildname
)
(
%pathname-host
pathname
)))
(
frob
%pathname-device
)
(
frob
%pathname-directory
directory-components-match
)
(
frob
%pathname-name
)
(
frob
%pathname-type
)
(
frob
%pathname-version
))))
;; Like PATHNAME-MATCH-P but the pathnames should not be search-lists.
;; Like PATHNAME-MATCH-P but the pathnames should not be search-lists.
;; Primarily intended for TRANSLATE-LOGICAL-PATHNAME and friends,
;; because PATHNAME-MATCH-P calls TRANSLATE-LOGICAL-PATHNAME, causing
;; infinite recursion.
(
defun
%pathname-match-p
(
in-pathname
in-wildname
)
(
defun
%pathname-match-p
(
in-pathname
in-wildname
)
"Pathname matches the wildname template?"
"Pathname matches the wildname template?"
(
declare
(
type
path-designator
in-pathname
)
(
declare
(
type
path-designator
in-pathname
)
...
@@ -1228,16 +1243,7 @@ a host-structure or string."
...
@@ -1228,16 +1243,7 @@ a host-structure or string."
(
type
(
or
string
pathname
)
in-wildname
))
(
type
(
or
string
pathname
)
in-wildname
))
(
with-pathname
(
pathname
in-pathname
)
(
with-pathname
(
pathname
in-pathname
)
(
with-pathname
(
wildname
in-wildname
)
(
with-pathname
(
wildname
in-wildname
)
(
macrolet
((
frob
(
field
&optional
(
op
'components-match
))
(
%%pathname-match-p
pathname
wildname
))))
`
(
or
(
null
(
,
field
wildname
))
(
,
op
(
,
field
pathname
)
(
,
field
wildname
)))))
(
and
(
or
(
null
(
%pathname-host
wildname
))
(
eq
(
%pathname-host
wildname
)
(
%pathname-host
pathname
)))
(
frob
%pathname-device
)
(
frob
%pathname-directory
directory-components-match
)
(
frob
%pathname-name
)
(
frob
%pathname-type
)
(
frob
%pathname-version
))))))
;;; PATHNAME-MATCH-P -- Interface
;;; PATHNAME-MATCH-P -- Interface
;;;
;;;
...
@@ -1251,17 +1257,8 @@ a host-structure or string."
...
@@ -1251,17 +1257,8 @@ a host-structure or string."
(
enumerate-search-list
(
pathname
in-path
)
(
enumerate-search-list
(
pathname
in-path
)
(
with-pathname
(
in-wild
in-wildname
)
(
with-pathname
(
in-wild
in-wildname
)
(
enumerate-search-list
(
wildname
in-wild
)
(
enumerate-search-list
(
wildname
in-wild
)
(
macrolet
((
frob
(
field
&optional
(
op
'components-match
))
(
when
(
%%pathname-match-p
pathname
wildname
)
`
(
or
(
null
(
,
field
wildname
))
(
return-from
pathname-match-p
pathname
)))))))
(
,
op
(
,
field
pathname
)
(
,
field
wildname
)))))
(
when
(
and
(
or
(
null
(
%pathname-host
wildname
))
(
eq
(
%pathname-host
wildname
)
(
%pathname-host
pathname
)))
(
frob
%pathname-device
)
(
frob
%pathname-directory
directory-components-match
)
(
frob
%pathname-name
)
(
frob
%pathname-type
)
(
frob
%pathname-version
))
(
return-from
pathname-match-p
pathname
))))))))
;;; SUBSTITUTE-INTO -- Internal
;;; SUBSTITUTE-INTO -- Internal
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment