Fix recursion bug in build_dir_tree
This commit is contained in:
parent
fffbcb9d14
commit
dfdd180b0d
|
@ -155,7 +155,11 @@ build_dir_tree() {
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local DIR="${INSTALL_PREFIX}$1"
|
build_dir_tree_recurse "${INSTALL_PREFIX}$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
build_dir_tree_recurse() {
|
||||||
|
local DIR="$1"
|
||||||
|
|
||||||
# if the directory already exists, return success
|
# if the directory already exists, return success
|
||||||
[ -d "${DIR}" ] && return 0
|
[ -d "${DIR}" ] && return 0
|
||||||
|
@ -173,7 +177,7 @@ build_dir_tree() {
|
||||||
mkdir "${DIR}" >& /dev/null
|
mkdir "${DIR}" >& /dev/null
|
||||||
if [ $? -ne 0 ]
|
if [ $? -ne 0 ]
|
||||||
then
|
then
|
||||||
build_dir_tree $(dirname "${DIR}") || return 1
|
build_dir_tree_recurse $(dirname "${DIR}") || return 1
|
||||||
mkdir "${DIR}"
|
mkdir "${DIR}"
|
||||||
if [ $? -ne 0 ]
|
if [ $? -ne 0 ]
|
||||||
then
|
then
|
||||||
|
|
Loading…
Reference in New Issue