From b21fd7adb5f9b2624ab4f4eb677d0c734b9738be Mon Sep 17 00:00:00 2001
From: Dirk Zimoch <dirk.zimoch@psi.ch>
Date: Fri, 4 Dec 2015 10:53:28 +0100
Subject: [PATCH] iocsh considers now only require versions with existing host
 architecture library

---
 iocsh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/iocsh b/iocsh
index ad7d6f3b..927fb65d 100755
--- a/iocsh
+++ b/iocsh
@@ -322,8 +322,8 @@ then
     LIBPOSTFIX=.so
     if [ -d $EPICS_MODULES/${REQUIRE:=require} ]
     then # new module pool model
-        REQUIRE_LIB=$EPICS_MODULES/$REQUIRE/${REQUIRE_VERSION:=$(cd $EPICS_MODULES/$REQUIRE; ls -1rvd *.*.* | head -n 1)}/R$BASE/lib/$EPICS_HOST_ARCH/$LIBPREFIX$REQUIRE$LIBPOSTFIX
-        REQUIRE_DBD=$EPICS_MODULES/$REQUIRE/$REQUIRE_VERSION/R$BASE/dbd/$REQUIRE.dbd
+        REQUIRE_LIB=$(ls -1rv $EPICS_MODULES/$REQUIRE/${REQUIRE_VERSION:-*.*.*}/R$BASE/lib/$EPICS_HOST_ARCH/$LIBPREFIX$REQUIRE$LIBPOSTFIX | head -n 1)
+        REQUIRE_DBD=${REQUIRE_LIB%/lib/*}/dbd/$REQUIRE.dbd
     else # old driver pool model
         REQUIRE=misc${REQUIRE_VERSION:+-}$REQUIRE_VERSION
         REQUIRE_LIB=$INSTBASE/iocBoot/R$BASE/$EPICS_HOST_ARCH/$LIBPREFIX$REQUIRE$LIBPOSTFIX
-- 
GitLab