diff options
author | Treeve Jelbert | 2019-01-09 09:46:56 +0100 |
---|---|---|
committer | Treeve Jelbert | 2019-01-09 10:02:56 +0100 |
commit | 6bad89740b6ca00dd8b3cec4aa7603ab09070cfc (patch) | |
tree | 1301a597ab737d677bf33fd94f41059d75c34e48 /protect_special_libs | |
parent | ea0683be23e0c6c525f95457034ad3fe8ea34970 (diff) |
add protect_special_libs function
Diffstat (limited to 'protect_special_libs')
-rw-r--r-- | protect_special_libs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/protect_special_libs b/protect_special_libs new file mode 100644 index 0000000000..b258c61a9f --- /dev/null +++ b/protect_special_libs @@ -0,0 +1,29 @@ +# some spells install their libraries to /lib and these are linked to by bash. +# these libraries must be preserved while the spell is being upgraded +# these functions should be called during the PRE_INSTALL of such spells +# candidate spells for this would be glibc, ncurses, readline + +lock_resources "libgrimoire" "install" && +PROTECT=$SOURCE_DIRECTORY/$SPELL.old.libs && + +if [[ -z $INSTALL_ROOT ]]; then + protect_special_libs() { + mkdir -p $PROTECT && + local each && + for each in /lib{,64,32}/*; do + if test -f "$each"; then + cp -a "$each" $PROTECT + fi + done && + ldconfig $PROTECT + } +fi + +# some spells, such as glibc may need some special processing between calls to +# these two fucnctions + +do_dispel() { + if spell_ok $SPELL; then + dispel --notriggers --nosustain $SPELL + fi +} |