summaryrefslogtreecommitdiffstats
path: root/protect_special_libs
blob: b258c61a9feaa4a90fb9d6bb2e1271827752d332 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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
}