aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-07-01 01:27:35 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-07-01 01:27:35 +0000
commit365ee6dc6e215f2a86724bdf6546e7fd55f98d58 (patch)
tree2db76f2971d7d6534c0aaa84ae49937e151e6551
parentb4acccebd42be71af423ca36f8b99699bd7142f5 (diff)
downloadpaludis-365ee6dc6e215f2a86724bdf6546e7fd55f98d58.tar.gz
paludis-365ee6dc6e215f2a86724bdf6546e7fd55f98d58.tar.xz
Add code to recover from sh breaking due to library downgrades.
-rw-r--r--ebuild/builtin_merge.bash11
-rw-r--r--ebuild/builtin_unmerge.bash5
2 files changed, 16 insertions, 0 deletions
diff --git a/ebuild/builtin_merge.bash b/ebuild/builtin_merge.bash
index 8e4ef8a..31f4e6e 100644
--- a/ebuild/builtin_merge.bash
+++ b/ebuild/builtin_merge.bash
@@ -79,9 +79,20 @@ builtin_merge()
fi
fi
+ if ! /bin/sh -c 'echo Good, our shell is still usable' ; then
+ echo "Looks like our shell broke. Trying an ldconfig to fix it..."
+ ldconfig -r ${ROOT}
+ fi
+
if [[ -n "${reinstall}" ]] ; then
unmerge "${ROOT%/}/" "${dbdir}/OLDCONTENTS" \
|| die "unmerge failed"
+
+ if ! /bin/sh -c 'echo Good, our shell is still usable' ; then
+ echo "Looks like our shell broke. Trying an ldconfig to fix it..."
+ ldconfig -r ${ROOT}
+ fi
+
rm -f "${dbdir}/OLDCONTENTS"
fi
diff --git a/ebuild/builtin_unmerge.bash b/ebuild/builtin_unmerge.bash
index 063969a..607513d 100644
--- a/ebuild/builtin_unmerge.bash
+++ b/ebuild/builtin_unmerge.bash
@@ -56,6 +56,11 @@ builtin_unmerge()
unmerge "${ROOT}/" "${dbdir}/CONTENTS" \
|| die "unmerge failed"
+ if ! /bin/sh -c 'echo Good, our shell is still usable' ; then
+ echo "Looks like our shell broke. Trying an ldconfig to fix it..."
+ ldconfig -r ${ROOT}
+ fi
+
rm -fr "${dbdir}"
}