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
67dc2930
Commit
67dc2930
authored
18 years ago
by
Christian Engwer
Browse files
Options
Downloads
Patches
Plain Diff
improved error checking in dunecontrol
[[Imported from SVN: r4527]]
parent
9edd6876
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/dunecontrol
+48
-14
48 additions, 14 deletions
bin/dunecontrol
with
48 additions
and
14 deletions
bin/dunecontrol
+
48
−
14
View file @
67dc2930
...
...
@@ -33,10 +33,16 @@ parse_control() {
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
"
export
DEPS_
${
module
}
=
"
$deps
"
export
SUGS_
${
module
}
=
"
$sugs
"
if
checkonly_modname
"
$module
"
;
then
export
HAVE_
${
module
}
=
yes
export
PATH_
${
module
}
=
"
$path
"
export
DEPS_
${
module
}
=
"
$deps
"
export
SUGS_
${
module
}
=
"
$sugs
"
else
echo
"ERROR:
$CONTROL
files
$1
contain an invalid Module entry"
fi
else
echo
"ERROR:
$CONTROL
files
$1
does not contain a Module entry"
fi
else
echo
"ERROR: could not read file
$1
"
...
...
@@ -85,6 +91,9 @@ eval_control() {
# execute $command
$command
)
||
false
else
echo
"ERROR: could not find
$file
"
exit
1
fi
}
...
...
@@ -92,15 +101,24 @@ _build_module() {
local command
=
$1
local
module
=
$2
shift
2
check_modname
$module
if
test
"x
$(
eval echo
\$
BUILD_DONE_
${
command
}
_
${
module
}
)
"
!=
"xyes"
;
then
echo
"--- building
$module
---"
# resolve dependencies
for
dep
in
$(
eval
"echo
\$
DEPS_
$module
"
)
;
do
check_modname
$dep
echo
"---
$module
depends on
$dep
... calling ---"
_build_module
$command
$dep
if
test
"x
$(
eval echo
\$
HAVE_
$dep
)
"
!=
"x"
;
then
echo
"calling ---"
_build_module
$command
$dep
else
echo
"ERROR: could not find module
$dep
"
exit
1
fi
done
# resolve suggestions
for
dep
in
$(
eval
"echo
\$
SUGS_
$module
"
)
;
do
check_modname
$dep
echo
-n
"---
$module
suggests
$dep
... "
if
test
"x
$(
eval echo
\$
HAVE_
$dep
)
"
!=
"x"
;
then
echo
"calling ---"
...
...
@@ -136,15 +154,31 @@ build_modules() {
build_single_module
()
{
module
=
$1
command
=
$2
for
m
in
$MODULES
;
do
if
test
"x
$m
"
=
"x
$module
"
;
then
load_opts
$command
_build_module run_
$command
$MODULE
return
fi
done
usage
echo
"ERROR: could not find module
$module
"
local
runcommand
=
run_
$command
load_opts
$command
check_modname
$module
if
test
"x
$(
eval echo
\$
HAVE_
$module
)
"
!=
"x"
;
then
_build_module
$runcommand
$module
else
echo
"ERROR: could not find module
$dep
"
echo
available modules are:
echo
$MODULES
exit
1
fi
}
check_modname
()
{
if
!
echo
"
$1
"
|
grep
-q
'^[a-zA-Z0-9_]\+$'
;
then
echo
"ERROR: invalid module name
$1
"
exit
1
fi
}
checkonly_modname
()
{
if
!
echo
"
$1
"
|
grep
-q
'^[a-zA-Z0-9_]\+$'
;
then
return
1
fi
return
0
}
load_opts
()
{
...
...
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