aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Wouter van Kesteren <woutershep@gmail.com> 2012-01-05 19:06:24 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2012-02-16 20:10:39 +0000
commit9777bd7a2393017baf0c3fdf41cfe0d13d9cc66c (patch)
tree926905a5db4ef71ac7efa8a9098c854992bae602
parent1bb56e2ecab69369adbd1851a504a2fd2bdcf8c5 (diff)
downloadpaludis-9777bd7a2393017baf0c3fdf41cfe0d13d9cc66c.tar.gz
paludis-9777bd7a2393017baf0c3fdf41cfe0d13d9cc66c.tar.xz
Fix non-recursive dodoc when $x is a directory
When dodoc is called with a directory there is a chance that it has a size. $ mkdir empty; [[ -s empty ]]; $ echo Exited with: $? Exited with: 0 This means that the case with [[ -s ]]; is taken instead of [[ -d ]]; and that there will be no error set. This commit fixes it by moving the -d check before the -s check.
-rwxr-xr-xpaludis/repositories/e/ebuild/utils/dodoc6
1 files changed, 3 insertions, 3 deletions
diff --git a/paludis/repositories/e/ebuild/utils/dodoc b/paludis/repositories/e/ebuild/utils/dodoc
index 05384aa..c026e6e 100755
--- a/paludis/repositories/e/ebuild/utils/dodoc
+++ b/paludis/repositories/e/ebuild/utils/dodoc
@@ -55,14 +55,14 @@ for x in "$@"; do
cd "${x}"
ls * >/dev/null 2>&1 && dodoc -r *
)
+ elif [[ -d "${x}" ]] ; then
+ echo "${0}: ${x} is a directory but we are not recursing" >&2
+ ret=1
elif [[ -s "${x}" ]]; then
install -m0644 "${x}" "${dir}"
elif [[ ! -e "${x}" ]]; then
echo "${0}: ${x} does not exist" >&2
ret=2
- elif [[ -d "${x}" ]] ; then
- echo "${0}: ${x} is a directory but we are not recursing" >&2
- ret=1
fi
done