summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTreeve Jelbert2019-01-09 09:46:56 +0100
committerTreeve Jelbert2019-01-09 10:02:56 +0100
commit6bad89740b6ca00dd8b3cec4aa7603ab09070cfc (patch)
tree1301a597ab737d677bf33fd94f41059d75c34e48
parentea0683be23e0c6c525f95457034ad3fe8ea34970 (diff)
add protect_special_libs function
-rw-r--r--ChangeLog4
-rw-r--r--protect_special_libs29
2 files changed, 33 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index b814dac710..b2f75ea589 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2019-01-09 Treeve Jelbert <treeve@sourcemage.org>
+ * protect_special_libs: added, function to protect special libraries
+ in such spells as glibc, readlin, ncurses
+
2019-01-08 Pavel Vinogradov <public@sourcemage.org>
* kernel.gpg: added new key, 95CDE47E,
Stephen Hemminger (Microsoft corporate) <sthemmin@microsoft.com>
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
+}