summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2012-10-11 14:37:41 (EDT)
committer P. J. McDermott <pjm@nac.net>2012-10-11 14:39:50 (EDT)
commit3879c4c737b5903129b27a149ed5d7a632bbb3b0 (patch)
treeeb19ef38a53ed7b58f3d80d26b54ba1f496fd2c4
parente16054ac6d09feff4595ed8d15c3376ea053fbe0 (diff)
Run mkdir in ob-installdocs only if necessary.
-rw-r--r--src/ob-installdocs.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ob-installdocs.sh b/src/ob-installdocs.sh
index cc3453a..f8abaa6 100644
--- a/src/ob-installdocs.sh
+++ b/src/ob-installdocs.sh
@@ -49,11 +49,17 @@ main()
ob_info "$(ob_get_msg 'installing_docs')" "${pkg}"
ob_get_doc_files | while read src dest; do
if [ -f "${src}" ]; then
- mkdir -p "${data_doc_dir}/${dest%/*}" || \
- ob_error "$(ob_get_msg 'cant_make_doc_dir')"
+ if [ "${dest%/*}" != "${dest}" ]; then
+ mkdir -p "${data_doc_dir}/${dest%/*}" || \
+ ob_error "$(ob_get_msg 'cant_make_doc_dir')"
+ fi
cp -R "${src}" "${data_doc_dir}/${dest}" || \
ob_error "$(ob_get_msg 'cant_cp_doc_file')" "${src}"
elif [ -d "${src}" ]; then
+ if [ "${dest%/*}" != "${dest}" ]; then
+ mkdir -p "${data_doc_dir}/${dest%/*}" || \
+ ob_error "$(ob_get_msg 'cant_make_doc_dir')"
+ fi
cp -R "${src}/." "${data_doc_dir}/${dest}" || \
ob_error "$(ob_get_msg 'cant_cp_doc_file')" "${src}"
fi