Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
e3-require
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ESS EPICS Environment
wrappers
e3-require
Commits
e38f3603
Commit
e38f3603
authored
3 years ago
by
Simon Rose
Browse files
Options
Downloads
Patches
Plain Diff
Minimise contents of module.dep to only those that the given module actually depends on
parent
e132f2e5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!83
E3-752: Fetch dependencies recursively
Pipeline
#109768
failed
3 years ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
require-ess/tools/driver.makefile
+7
-5
7 additions, 5 deletions
require-ess/tools/driver.makefile
with
7 additions
and
5 deletions
require-ess/tools/driver.makefile
+
7
−
5
View file @
e38f3603
...
...
@@ -443,6 +443,7 @@ select = $(strip $(call -select,$(strip $2),$1,$3))
str-eq
=
$(
if
$(
subst x
$1
,,x
$2
)
,,t
)
_MODULES
:=
_PROCESSED_MODULES
:=
REQ
:=
INSTALLED_MODULES
:=
$(
sort
$(
notdir
$(
shell
ls
-d
$(
E3_SITEMODS_PATH
)
/
*
$(
EPICS_MODULES
)
/
*
)))
...
...
@@ -452,6 +453,7 @@ define fetch_module_versions
ifneq
($$(strip $$(filter $(INSTALLED_MODULES),$$(_lm))),)
$$(_lm)_VERSION
:=
$(
$1_DEP_VERSION$2
)
_MODULES
+=
$$(
_lm
)
REQ
+=
$$(
_lm
)
else
$
$(
warning
Invalid dependency
"
$1_DEP_VERSION$2
"
;
pruning
)
endif
...
...
@@ -460,25 +462,25 @@ $(foreach m,$(patsubst %_DEP_VERSION,%,$(filter %_DEP_VERSION,$(.VARIABLES))),$(
$(
foreach
x,
$(
VAR_EXTENSIONS
)
,
\
$(
foreach m,
$(
patsubst %_DEP_VERSION_
$(
x
)
,%,
$(
filter %_DEP_VERSION_
$(
x
)
,
$(
.VARIABLES
)))
,
$(
eval
$(
call fetch_module_versions,
$m
,_
$(
x
))))
\
)
export
REQ
# Fetches the data from .dep files to be parsed by the above
define
fetch_deps
$(
shell
cat
$(
E3_SITEMODS_PATH
)
/
$1
/
$(
$1_VERSION
)
/lib/
$(
T_A
)
/
$1
.dep |
sed
'1d'
)
endef
# Used to recurse through versions:
updates REQ and
fetches all of the dependencies from the given module
# Used to recurse through versions:
recursively
fetches all of the dependencies from the given module
define
update_dep_versions
m
:=
$$(
firstword
$$(
_MODULES
))
REQ
+=
$$
m
_PROCESSED_MODULES
+=
$$
m
$$m_TBL
:=
$$(
call fetch_deps,
$$
m
)
$$m_DEPS
:=
$$(
call
select
,1,
$$(
$$
m_TBL
)
,1
)
_MODULES
:=
$$(
filter-out
$$(
REQ
)
,
$$(
_MODULES
)
$$(
$$
m_DEPS
))
_MODULES
:=
$$(
filter-out
$$(
_PROCESSED_MODULES
)
,
$$(
_MODULES
)
$$(
$$
m_DEPS
))
$$(foreach mm,$$($$m_DEPS),$$(eval $$(mm)_VERSION
:
= $$(call select
,
2
,
$$($$m_TBL)
,
$$$$(call str-eq
,
$$$$1
,
$$(mm)))))
endef
$(
call
while
,
$$(
_MODULES
)
,
$(
update_dep_versions
))
$(
foreach
m,
$(
REQ
)
,
$(
eval export
$m_VERSION
))
export
REQ
$(
foreach
m,
$(
_PROCESSED_MODULES
)
,
$(
eval export
$m_VERSION
))
debug
::
@
echo
"===================== Pass 3: T_A =
$(
T_A
)
====================="
...
...
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