Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Core Modules
dune-common
Commits
877b59f6
Commit
877b59f6
authored
19 years ago
by
Christian Engwer
Browse files
Options
Downloads
Patches
Plain Diff
fixed issue of multiple invocation of the same module
[[Imported from SVN: r4510]]
parent
a1009597
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/dunecontrol
+29
-29
29 additions, 29 deletions
bin/dunecontrol
with
29 additions
and
29 deletions
bin/dunecontrol
+
29
−
29
View file @
877b59f6
...
...
@@ -29,9 +29,9 @@ CONTROL="dune.module"
parse_control
()
{
if
test
-f
"
$1
"
;
then
export
module
=
$(
echo
$(
grep
Module:
"
$1
"
|
cut
-d
':'
-f2
))
deps
=
$(
echo
$(
grep
Depends:
"
$1
"
|
cut
-d
':'
-f2
))
sugs
=
$(
echo
$(
grep
Suggests:
"
$1
"
|
cut
-d
':'
-f2
))
path
=
$(
dirname
"
$1
"
)
local
deps
=
$(
echo
$(
grep
Depends:
"
$1
"
|
cut
-d
':'
-f2
))
local
sugs
=
$(
echo
$(
grep
Suggests:
"
$1
"
|
cut
-d
':'
-f2
))
local
path
=
$(
dirname
"
$1
"
)
if
test
"x
$module
"
!=
"x"
;
then
export
HAVE_
${
module
}
=
yes
export
PATH_
${
module
}
=
"
$path
"
...
...
@@ -46,7 +46,7 @@ parse_control() {
find_modules
()
{
if
test
-d
"
$1
"
;
then
dir
=
$(
cd
"
$1
"
&&
pwd
)
local
dir
=
$(
cd
"
$1
"
&&
pwd
)
while
read
m
;
do
if
test
"x
$m
"
!=
"x"
;
then
export
module
=
""
...
...
@@ -71,8 +71,8 @@ EOF
# $2 full path of the $CONTROL file
#
eval_control
()
{
command
=
$1
file
=
$2
local
command
=
$1
local
file
=
$2
shift
2
if
test
-f
"
$file
"
;
then
# open subshell
...
...
@@ -83,28 +83,28 @@ eval_control() {
# then the default implementation will be executed
eval
"
$(
grep
-v
-e
'^[[:alnum:]]\+:'
$file
)
"
# execute $command
$command
"
$@
"
$command
)
||
false
fi
}
_build_module
()
{
command
=
$1
module
=
$2
local
command
=
$1
local
module
=
$2
shift
2
if
test
"x
$(
eval echo
\$
BUILD_DONE_
${
command
}
_
${
module
}
)
"
!=
"xyes"
;
then
echo
"--- building
$module
---"
# resolve dependencies
for
dep
in
$(
eval
"echo
\$
DEPS_
$module
"
)
;
do
echo
"---
$module
depends on
$dep
... calling ---"
(
set
-e
;
_build_module
$command
$dep
"
$@
"
)
||
false
_build_module
$command
$dep
done
# resolve suggestions
for
dep
in
$(
eval
"echo
\$
SUGS_
$module
"
)
;
do
echo
-n
"---
$module
suggests
$dep
... "
if
test
"x
$(
eval echo
\$
HAVE_
$dep
)
"
!=
"x"
;
then
echo
"calling ---"
(
set
-e
;
_build_module
$command
$dep
"
$@
"
)
||
false
_build_module
$command
$dep
else
echo
"skipping ---"
fi
...
...
@@ -112,11 +112,11 @@ _build_module() {
# really build this module
echo
"--- calling
$command
for
$module
---"
export
BUILD_DONE_
${
command
}
_
${
module
}
=
yes
path
=
$(
eval
"echo
\$
PATH_
${
module
}
"
)
local
path
=
$(
eval
"echo
\$
PATH_
${
module
}
"
)
(
set
-e
cd
"
$path
"
eval_control
$command
$path
/
$CONTROL
"
$@
"
eval_control
$command
$path
/
$CONTROL
)
||
exit
1
else
echo
"--- skipping
$module
---"
...
...
@@ -124,18 +124,18 @@ _build_module() {
}
build_modules
()
{
command
=
$1
runcommand
=
run_
$command
local
command
=
$1
local
runcommand
=
run_
$command
shift
load_opts
$command
for
m
in
$MODULES
;
do
_build_module
$runcommand
$m
"
$@
"
_build_module
$runcommand
$m
done
}
load_opts
()
{
command
=
$1
COMMAND
=
$(
echo
$command
|
tr
'[:lower:]'
'[:upper:]'
)
local
command
=
$1
local
COMMAND
=
$(
echo
$command
|
tr
'[:lower:]'
'[:upper:]'
)
if
test
"x
$OPTS_FILE
"
!=
"x"
;
then
echo
"----- loading default flags
\$
${
COMMAND
}
_FLAGS from
$OPTS_FILE
-----"
CMD_PARAMS
=
"
$(
.
$OPTS_FILE
;
eval echo
\$
${
COMMAND
}
_FLAGS
)
"
...
...
@@ -204,33 +204,33 @@ run_default_make () {
run_default_all
()
{
load_opts autogen
run_autogen
"
$@
"
run_autogen
load_opts configure
run_configure
"
$@
"
run_configure
load_opts make
run_make
"
$@
"
run_make
}
run_nothing
()
{
run_default_nothing
"
$@
"
run_default_nothing
}
run_exec
()
{
run_default_exec
"
$@
"
run_default_exec
}
run_update
()
{
run_default_update
"
$@
"
run_default_update
}
run_autogen
()
{
run_default_autogen
"
$@
"
run_default_autogen
}
run_configure
()
{
run_default_configure
"
$@
"
run_default_configure
}
run_make
()
{
run_default_make
"
$@
"
run_default_make
}
run_all
()
{
run_default_all
"
$@
"
run_default_all
}
###############################################
...
...
@@ -324,7 +324,7 @@ done
case
"
$command
"
in
update
|
autogen
|
configure
|
make
|
all
|
exec
|
nothing
)
find_modules
.
build_modules
$command
"
$@
"
build_modules
$command
;;
help
)
usage
...
...
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