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
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
Timo Koch
dune-common
Commits
a84fa043
Commit
a84fa043
authored
18 years ago
by
Christian Engwer
Browse files
Options
Downloads
Patches
Plain Diff
on behalf of sven, I added option '--[COMMAND}-opts=...'
[[Imported from SVN: r4890]]
parent
a94d2586
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
+58
-24
58 additions, 24 deletions
bin/dunecontrol
with
58 additions
and
24 deletions
bin/dunecontrol
+
58
−
24
View file @
a84fa043
...
...
@@ -89,6 +89,8 @@ load_opts() {
if
test
"x
$DUNE_OPTS_FILE
"
!=
"x"
;
then
echo
"----- loading default flags
\$
${
COMMAND
}
_FLAGS from
$DUNE_OPTS_FILE
-----"
CMD_PARAMS
=
"
$(
.
$DUNE_OPTS_FILE
;
eval echo
\$
${
COMMAND
}
_FLAGS
)
"
else
CMD_PARAMS
=
"
$(
eval echo
\$
${
COMMAND
}
_FLAGS
)
"
fi
}
...
...
@@ -97,6 +99,19 @@ load_opts() {
### Commands
###
# check wheteher the parameter is valid command or not
is_command
()
{
eval
'
case "$1" in
'
$(
echo
$COMMANDS
|
sed
-e
's/ / | /g'
)
')
return 0
;;
*)
return 1
;;
esac'
}
# list of all dunecontrol commands
COMMANDS
=
"update autogen configure make all exec svn"
...
...
@@ -236,6 +251,8 @@ usage () {
echo
" and not the modules it depends on"
echo
" --opts=FILE load default options from FILE"
echo
" (see dune-common/doc/example.opts)"
echo
" --[COMMAND]-opts=opts set options for COMMAND"
echo
" (this is mainly usefull for the all COMMAND)"
echo
"Commands:"
printf
"
\`
help'
\t
guess what :-)
\n
"
printf
"
\`
print'
\t
print the list of modules sorted after their dependencies
\n
"
...
...
@@ -255,6 +272,13 @@ fi
trap
onfailure EXIT
# clear command opts
for
i
in
$COMMANDS
;
do
COMMAND
=
$(
echo
$i
|
tr
'[:lower:]'
'[:upper:]'
)
export
${
COMMAND
}
_FLAGS
=
""
done
# parse commandline parameters
while
test
$#
-gt
0
;
do
# get option
option
=
$1
...
...
@@ -265,7 +289,6 @@ while test $# -gt 0; do
# stolen from configure...
# when no option is set, this returns an error code
arg
=
`
expr
"x
$option
"
:
'x[^=]*=\(.*\)'
`
arg
=
$(
eval
"echo
$arg
"
)
set
-e
# switch
...
...
@@ -284,6 +307,17 @@ while test $# -gt 0; do
echo
>
/dev/stderr
exit
1
;
fi
;;
--
*
-opts
=
*
)
optcmd
=
`
expr
"x
$option
="
:
'x--\([^-]*\)-opts=.*'
`
if
is_command
$optcmd
;
then
COMMAND
=
$(
echo
$optcmd
|
tr
'[:lower:]'
'[:upper:]'
)
export
${
COMMAND
}
_FLAGS
=
"
$arg
"
else
usage
echo
"ERROR: unknown option
\"
$option
\"
"
>
/dev/stderr
exit
1
fi
;;
-h
|
--help
)
command
=
help
...
...
@@ -334,26 +368,7 @@ while test $# -gt 0; do
done
# We need to run this via eval in order construct the case for the commands
eval
'
case
"
$command
"
in
'
$(
echo
$COMMANDS
|
sed
-e
's/ / | /g'
)
')
find_modules_in_path
if test "x$MODULE" = "x"; then
sort_modules $MODULES
else
sort_modules $MODULE
fi
if test x$ONLY != x; then
NAMES="$(eval echo \$NAME_$ONLY)"
else
for mod in $MODULES; do
NAMES="$NAMES$(eval echo \$NAME_$mod) "
done
fi
echo "--- going to build $NAMES ---"
build_modules $command
echo "--- done ---"
;;
print
)
find_modules_in_path
if
test
"x
$MODULE
"
=
"x"
;
then
...
...
@@ -389,10 +404,29 @@ case "$command" in
usage
;;
*
)
echo "ERROR: unknown command \"$command\"" > /dev/stderr
usage
exit 1
if
is_command
$command
;
then
find_modules_in_path
if
test
"x
$MODULE
"
=
"x"
;
then
sort_modules
$MODULES
else
sort_modules
$MODULE
fi
if
test
x
$ONLY
!=
x
;
then
NAMES
=
"
$(
eval echo
\$
NAME_
$ONLY
)
"
else
for
mod
in
$MODULES
;
do
NAMES
=
"
$NAMES
$(
eval echo
\$
NAME_
$mod
)
"
done
fi
echo
"--- going to build
$NAMES
---"
build_modules
$command
echo
"--- done ---"
else
usage
echo
"ERROR: unknown command
\"
$command
\"
"
>
/dev/stderr
exit
1
fi
;;
esac
'
esac
trap
- EXIT
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