aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-01 01:46:09 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-01 01:46:09 +0000
commitd3e579dcce4ea81fa4725359ce444c449819798d (patch)
treecb5335c23a640f2f75aa138027c4f646d67c062c
parent174c00f856a0dd6d4a50d9ede23ee0e0a115f23b (diff)
downloadpaludis-d3e579dcce4ea81fa4725359ce444c449819798d.tar.gz
paludis-d3e579dcce4ea81fa4725359ce444c449819798d.tar.xz
Don't explode on empty or unset D
-rw-r--r--ebuild/builtin_merge.bash30
1 files changed, 16 insertions, 14 deletions
diff --git a/ebuild/builtin_merge.bash b/ebuild/builtin_merge.bash
index beb49ed..d0bf124 100644
--- a/ebuild/builtin_merge.bash
+++ b/ebuild/builtin_merge.bash
@@ -19,22 +19,24 @@
builtin_merge()
{
- if [[ -n "${CONFIG_PROTECT}" ]] ; then
- local d f
- for d in ${CONFIG_PROTECT} ; do
- [[ -d "${D}${d}" ]] || continue
- find "${D}${d}" -type f | \
- while read f ; do
- if [[ -e "${ROOT}${f#${D}}" ]] ; then
- echo "CONFIG_PROTECT ${f#${D}}"
- fi
+ if [[ -n "${D}" ]] && [[ -d "${D}" ]] ; then
+ if [[ -n "${CONFIG_PROTECT}" ]] ; then
+ local d f
+ for d in ${CONFIG_PROTECT} ; do
+ [[ -d "${D}${d}" ]] || continue
+ find "${D}${d}" -type f | \
+ while read f ; do
+ if [[ -e "${ROOT}${f#${D}}" ]] ; then
+ echo "CONFIG_PROTECT ${f#${D}}"
+ fi
+ done
done
- done
- fi
+ fi
- install -d "${ROOT}/" || die "couldn't make \${ROOT} (\"${ROOT}\")"
- if [[ -d "${D}" ]] ; then
- cp -vdfpR "${D}/"* "${ROOT}/" || die "builtin_merge failed"
+ install -d "${ROOT}/" || die "couldn't make \${ROOT} (\"${ROOT}\")"
+ if [[ -d "${D}" ]] ; then
+ cp -vdfpR "${D}/"* "${ROOT}/" || die "builtin_merge failed"
+ fi
fi
local dbdir="${ROOT}"/var/db/pkg/"${CATEGORY}/${PF}"