From f89f92ab7f4af56d5948d285e9176a72b2073ba6 Mon Sep 17 00:00:00 2001
From: Mark Hodgkinson <m.hodgkinson@sheffield.ac.uk>
Date: Mon, 30 Apr 2018 08:37:52 +0000
Subject: [PATCH] Merge branch 'GetFilesFix' into 'master'

fixing get_files script to retrieve locally installed files

See merge request atlas/athena!10792

(cherry picked from commit 141422c40df517a0515dab70c63ee7767b580e66 [formerly 1765e50609b8d1a1f61a12fcfa6fcb9aa10eab4b])

21544891 fixing get_files script to retrieve locally installed files
24b01702 changing /bin/sh to /bin/bash on advice of shifter

Former-commit-id: 7e3f8034b5c1ee084ea842cb5d996abb8579f3f2
---
 .../MuonCalib/CscCalib/CscCalibAlgs/cmt/cdb.log            | 0
 Tools/Scripts/share/get_files                              | 7 +++++--
 2 files changed, 5 insertions(+), 2 deletions(-)
 mode change 100644 => 100755 MuonSpectrometer/MuonCalib/CscCalib/CscCalibAlgs/cmt/cdb.log

diff --git a/MuonSpectrometer/MuonCalib/CscCalib/CscCalibAlgs/cmt/cdb.log b/MuonSpectrometer/MuonCalib/CscCalib/CscCalibAlgs/cmt/cdb.log
old mode 100644
new mode 100755
diff --git a/Tools/Scripts/share/get_files b/Tools/Scripts/share/get_files
index 1ccf16a931c4..1aa0c187788e 100755
--- a/Tools/Scripts/share/get_files
+++ b/Tools/Scripts/share/get_files
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 #   get_files [options] [files] [options] [files] ... 
 #
@@ -77,7 +77,10 @@ get_one_file() {
       path_opt=${DATAPATH//:/ }
     elif [ "$opt" == "scripts" ]; then
       # Only keep PATH entries located in the installation areas to find scripts.
-      path_opt=$(echo -e ${PATH//:/'\n'} | fgrep /InstallArea/)
+      path_opt=""
+      for binpath in $(echo -e ${CMAKE_PREFIX_PATH//:/ }); do
+        path_opt="${path_opt}$binpath/bin $binpath/share "
+      done
     elif [ "$opt" == "xmls" ]; then
       path_opt=${XMLPATH//:/ }
     fi
-- 
GitLab