From a8bbc60f5bd996592a5da6c3226a76b6eeb1eb6b Mon Sep 17 00:00:00 2001 From: maxice8 Date: Fri, 2 Nov 2018 07:40:28 -0300 Subject: [PATCH] build-style/gem.sh: guard usage of find on etc and man --- common/build-style/gem.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/common/build-style/gem.sh b/common/build-style/gem.sh index 2cf5f8ab2ca..be59e059498 100644 --- a/common/build-style/gem.sh +++ b/common/build-style/gem.sh @@ -35,9 +35,11 @@ do_install() { find ${DESTDIR}/${_GEMDIR}/extensions \( -name mkmf.log -o -name gem_make.out \) -delete # Place manpages in usr/share/man/man[0-9] - find ${_INSTDIR}/man -type f -name '*.[0-8n]' | while read -r m; do - vman ${m} - done + if [ -d ${_INSTDIR}/man ]; then + find ${_INSTDIR}/man -type f -name '*.[0-8n]' | while read -r m; do + vman ${m} + done + fi rm -rf "${_INSTDIR}/man" @@ -51,10 +53,12 @@ do_install() { rm -rf ${_INSTDIR}/bin # Place conf files in their places - find ${_INSTDIR}/etc -type f | while read -r c; do - vmkdir $(dirname ${c##*${_INSTDIR}}) - mv ${c} "${DESTDIR}/${c##*${_INSTDIR}}" - done + if [ -d ${_INSTDIR}/etc ]; then + find ${_INSTDIR}/etc -type f | while read -r c; do + vmkdir $(dirname ${c}) + mv ${c} "${DESTDIR}/${c##*${_INSTDIR}/etc/}/" + done + fi rm -rf ${_INSTDIR}/etc }