diff --git a/lib/dunemodules.lib b/lib/dunemodules.lib index c26683a1c478ce1becc1bb8f7f57a04933e29b84..b80652e18aa2898d11dad0a18693d31c80750cbe 100644 --- a/lib/dunemodules.lib +++ b/lib/dunemodules.lib @@ -211,7 +211,13 @@ setup_control_path() { fi done else - DUNE_CONTROL_PATH=$DUNE_CONTROL_PATH:$(pkg-config dune-common --variable=prefix)/lib/dunecontrol + NEW_DUNE_CONTROL_DIR=$(pkg-config dune-common --variable=prefix)/lib/dunecontrol + # There might be old version of DUNE lying around, that do not contain + # lib/dunecontrol, yet. To prevent failur at a later stage of dunecontrol + # we check that the directory really exists. + if test -d "$NEW_DUNE_CONTROL_DIR"; then + DUNE_CONTROL_PATH=$DUNE_CONTROL_PATH:$NEW_DUNE_CONTROL_DIR + fi fi fi # try to read DUNE_CONTROL_PATH from OPTS file