From 13f607afa94a0a227f7815016b2a9e64a9f4f7d6 Mon Sep 17 00:00:00 2001
From: kaloyane <kaloyane>
Date: Wed, 5 Oct 2011 07:49:30 +0000
Subject: [PATCH] bugfix: keep the contents of the datastore_server/ext-lib
 folder between upgrades

SVN: 23193
---
 installation/resource/installer/bin/common-functions.sh | 6 +++---
 openbis/dist/admin/common-functions.sh                  | 8 ++++----
 screening/dist/admin/common-functions.sh                | 6 +++---
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/installation/resource/installer/bin/common-functions.sh b/installation/resource/installer/bin/common-functions.sh
index 8b4e3cffb08..c5c1c8440a4 100644
--- a/installation/resource/installer/bin/common-functions.sh
+++ b/installation/resource/installer/bin/common-functions.sh
@@ -31,12 +31,12 @@ executeScriptHooks()
 }
 
 #
-# Copies a file (first parameter) to a destination (second parameter). 
-# Does nothing if file does not exist.
+# Copies a file/folder (first parameter) to a destination (second parameter). 
+# Does nothing if file/folder does not exist.
 #
 copyIfExists() 
 {
-  if [ -f "$1" ]; then
+  if [ -e "$1" ]; then
       cp -R "$1" "$2"
   fi
 }
diff --git a/openbis/dist/admin/common-functions.sh b/openbis/dist/admin/common-functions.sh
index c300cecaed4..c5c1c8440a4 100644
--- a/openbis/dist/admin/common-functions.sh
+++ b/openbis/dist/admin/common-functions.sh
@@ -31,13 +31,13 @@ executeScriptHooks()
 }
 
 #
-# Copies a file (first parameter) to a destination (second parameter). 
-# Does nothing if file does not exist.
+# Copies a file/folder (first parameter) to a destination (second parameter). 
+# Does nothing if file/folder does not exist.
 #
 copyIfExists() 
 {
-  if [ -f "$1" ]; then
-      cp "$1" "$2"
+  if [ -e "$1" ]; then
+      cp -R "$1" "$2"
   fi
 }
 
diff --git a/screening/dist/admin/common-functions.sh b/screening/dist/admin/common-functions.sh
index 8b4e3cffb08..c5c1c8440a4 100644
--- a/screening/dist/admin/common-functions.sh
+++ b/screening/dist/admin/common-functions.sh
@@ -31,12 +31,12 @@ executeScriptHooks()
 }
 
 #
-# Copies a file (first parameter) to a destination (second parameter). 
-# Does nothing if file does not exist.
+# Copies a file/folder (first parameter) to a destination (second parameter). 
+# Does nothing if file/folder does not exist.
 #
 copyIfExists() 
 {
-  if [ -f "$1" ]; then
+  if [ -e "$1" ]; then
       cp -R "$1" "$2"
   fi
 }
-- 
GitLab