blob: 75bcb20402c40aa80de4c262f2ab7db68a13fd3c [file] [log] [blame]
nickboldt03a6f082019-02-12 15:17:11 -05001#*******************************************************************************
2# Copyright (c) 2007, 2019 IBM Corporation and others.
3# This program and the accompanying materials
4# are made available under the terms of the Eclipse Public License 2.0
5# which accompanies this distribution, and is available at
6# https://www.eclipse.org/legal/epl-2.0/
7#
8# SPDX-License-Identifier: EPL-2.0
9#
10# Contributors:
11# IBM Corporation - initial API and implementation
12#*******************************************************************************
david_williamsb1a981c2007-10-23 19:55:06 +000013
14copyAndRemove ()
15{
16 oldDir=${1}
17 newDir=${2}
18 if [ ! -d ${oldDir} ]
19 then
david_williams29f8bba2007-10-24 01:03:48 +000020 echo "${oldDir} does not exist"
david_williamsb1a981c2007-10-23 19:55:06 +000021 return;
22 fi
david_williams4e08c5c2007-10-23 22:32:49 +000023
david_williamsb1a981c2007-10-23 19:55:06 +000024 echo "oldDir: ${oldDir}"
david_williamsb1a981c2007-10-23 19:55:06 +000025 echo "newDir: ${newDir}"
david_williams4e08c5c2007-10-23 22:32:49 +000026
david_williamsb1a981c2007-10-23 19:55:06 +000027 mkdir -p ${newDir}
david_williams4e08c5c2007-10-23 22:32:49 +000028 rsync --backup --recursive ${oldDir} ${newDir}
david_williamsb1a981c2007-10-23 19:55:06 +000029 if [ "$?" -eq "0" ]
30 then
31 rm -fr ${oldDir}
32 fi
33 return;
34}
david_williams6387d9a2007-10-24 04:18:09 +000035
36copyAndRemoveModule () {
37
38
david_williams7a424092007-10-24 04:27:11 +000039oldBaseDir=${1}
40newBaseDir=${2}
david_williams6387d9a2007-10-24 04:18:09 +000041wtpmodule=${3}
42
43oldDir=${oldBaseDir}/${wtpmodule}
44newDir=${newBaseDir}
45copyAndRemove $oldDir $newDir
46return;
47}