Skip to content
Snippets Groups Projects
Commit 93a5102d authored by Markus Blatt's avatar Markus Blatt
Browse files

Check added whether any modules were found and whether all modules we
depend on are found.

Fixes Flyspray 195

[[Imported from SVN: r4787]]
parent 5d75befc
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,29 @@ canonicalpath(){
(cd $(dirname $(canonicalname $1)) && pwd)
}
modulesexist(){
allfound=0
for dep in $1; do
found=0
for module in $2; do
if [ "$dep" = "$module" ]; then
found=1
break
fi
done
if [ "$found" = "0" ]; then
echo "ERROR:">/dev/stderr
echo "Module with name $dep was not found" > /dev/stderr
echo "Did you forget to specify it's location" > /dev/stderr
echo "in the DUNE_CONTROL_PATH variable?"> /dev/stderr
echo >/dev/stderr
allfound=1
fi
done
return $allfound
}
echo
echo == Dune project/module generator ==
echo
......@@ -42,6 +65,15 @@ if [ "$MODULES" = "" ]; then
find_modules_in_path
fi
if [ "$MODULES" = "" ]; then
echo "ERROR">/dev/stderr
echo "No dune modules were found!">/dev/stderr
echo "Did you forget to specify the places where ">/dev/stderr
echo "you installed your modules in the ">/dev/stderr
echo "DUNE_CONTROL_PATH environment variable?" >/dev/stderr
exit 1;
fi
# get the real module names
SRC_MODULES=""
for i in $MODULES; do
......@@ -70,13 +102,22 @@ while [ "$DATACORRECT" != "y" -a "$DATACORRECT" != "Y" ]; do
done
MODULE="$PROJECT"
DEP_OK=1
while [ "$DEPOK" != 0 ]; do
DEPENDENCIES=""
echo "2) Which modules should this module depend on?"
echo " Following modules are found:"
for i in $ALL_MODULES; do echo " $i"; done
for i in $ALL_MODULES; do echo -n " $i"; done
echo ""
while [ -z "$DEPENDENCIES" ]; do
read -p " Enter space separated list: " DEPENDENCIES
done
set +e
modulesexist "$DEPENDENCIES" "$ALL_MODULES"
DEPOK=$?
set -e
done
VERSION=""
while [ -z $VERSION ]; do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment