Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Remko van der Vossen (2c3fc65139b3866dbb316a407cf743a26c0a4871)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Remko van der Vossen <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Remko van der Vossen (2c3fc65139b3866dbb316a407cf743a26c0a4871)
  • Date: Sat, 19 Mar 2016 12:22:55 +0000

GIT changes to master grimoire by Remko van der Vossen <wich AT sourcemage.org>:

graphics-libs/libpng/HISTORY | 8 ++++++
graphics-libs/libpng/UP_TRIGGERS | 52
+++++++++++++++++++++++++++++++++------
2 files changed, 53 insertions(+), 7 deletions(-)

New commits:
commit 2c3fc65139b3866dbb316a407cf743a26c0a4871
Author: Remko van der Vossen <wich AT sourcemage.org>
Commit: Remko van der Vossen <wich AT sourcemage.org>

libpng: refine UP_TRIGGERS for major version upgrades

Three things have been done:

- Find libpng dependencies in lib-tool archives.

Some spells may not have shared object dependencies to libpng, but
still list libpng in their libtool archives. Trying to depend on such
spells during a libpng major version upgrade will fail as libtool
cannot find the older libpng libtool archive.

- Outright dispel libpng dependers in case of major version upgrade.
This allows our cyclic dependency mitigations in various spells'
DEPENDS files to work.

Without this, circular dependencies will cause not yet upgraded
dependers to be linked into casts that result from the cast_self
triggers that therefore fail. Dispelling the dependers enables some
guards in our DEPENDS files that disable certain optional dependencies
to break the circular dependencies, allowing the casts to succeed.

Do note that this may result in loss of functionality as the user may
have had some of these optional dependencies enabled. The
functionality is returned upon the next cast of these spells.

- Allow the user to bail out.

Since the dependers are outright dispelled there is a risk of
completely losing installed spells. This happens when the casting
fails sometime during the cast_self triggers. A possible solution for
this would be that cast_self triggers get added to the cast queue.

Because of this problem the execution of the dispel and recast of all
libpng dependers must not be executed as a surprise to the user. A big
fat warning is displayed and the user is queried whether they wish to
continue with the process. The default answer to this query is no.

diff --git a/graphics-libs/libpng/HISTORY b/graphics-libs/libpng/HISTORY
index db880ba..4733a98 100644
--- a/graphics-libs/libpng/HISTORY
+++ b/graphics-libs/libpng/HISTORY
@@ -1,3 +1,11 @@
+2016-02-25 Remko van der Vossen <wich AT sourcemage.org>
+ * UP_TRIGGERS: Find libpng dependencies in lib-tool archives.
+ Outright dispel libpng dependers in case of major
+ version upgrade. This allows our cyclic dependency
+ mitigations in various spells' DEPENDS files to
+ work.
+ Allow the user to bail out.
+
2016-02-07 Thomas Orgis <sobukus AT sourcemage.org>
* UP_TRIGGERS: Do not require grep -P. It's optional.

diff --git a/graphics-libs/libpng/UP_TRIGGERS
b/graphics-libs/libpng/UP_TRIGGERS
index d0a3ce1..cea76ff 100755
--- a/graphics-libs/libpng/UP_TRIGGERS
+++ b/graphics-libs/libpng/UP_TRIGGERS
@@ -1,18 +1,56 @@
+
if spell_ok $SPELL; then
- local OLD_SPELL_VERSION="$(installed_version $SPELL)"
+ local OLD_SPELL_VERSION="$(installed_version $SPELL)" &&
if [[ "${VERSION%.*}" != "${OLD_SPELL_VERSION%.*}" ]]; then
- message "This is an ABI incompatible update of libpng..."
- message "Determining which spells need to be recast, this may take a
while."
+ message
+ message "${MESSAGE_COLOR}This is an ABI incompatible update of
${SPELL_COLOR}${SPELL}${MESSAGE_COLOR}..." &&
+ message "Determining which spells need to be recast, this may take a
while." &&

- for other_spell in $(gaze installed | cut -d: -f1); do
+ LANG= &&
+ local spells=$(gaze installed | cut -d: -f1) &&
+ local spell_count=$(wc -w <<< "$spells") &&
+ local spell_index=0 &&
+ local recast_list= &&
+ for other_spell in $spells; do
+ ((spell_index++)) &&
+ echo -ne "[${spell_index}/${spell_count} ${other_spell}]\e[K\r" &&
+ if [[ "$other_spell" == "$SPELL" ]]; then
+ continue
+ fi &&
+ if gaze install $other_spell \
+ | file -f - -e apptype -e cdf -e compress -e elf -e encoding -e
soft -e tar \
+ | grep '\<libtool library file\>' \
+ | cut -d: -f1 \
+ | xargs cat 2> /dev/null \
+ | grep -q "^dependency_libs.*${SPELL}[0-9]*\.la"; then
+ list_add recast_list $other_spell &&
+ continue
+ fi &&
if gaze install $other_spell \
- | xargs file -e apptype -e ascii -e compress -e tar \
+ | file -f - -e apptype -e ascii -e cdf -e compress -e encoding -e
soft -e tar \
| grep '\<ELF\>.*\<dynamically linked\>' \
| cut -d: -f1 \
| xargs readelf -d 2> /dev/null \
- | grep -q 'NEEDED)[[:space:]]*Shared library: \[libpng'; then
- up_trigger $other_spell cast_self
+ | grep -q "NEEDED)[[:space:]]*Shared library: \[$SPELL"; then
+ list_add recast_list $other_spell
fi
done
+ if [[ -n "${recast_list}" ]]; then
+ message "
+${SPELL_COLOR}${PROBLEM_COLOR}You are about to upgrade (downgrade)
${SPELL_COLOR}${SPELL}${PROBLEM_COLOR} to a different major version.
+All spells that depend on ${SPELL_COLOR}${SPELL}${PROBLEM_COLOR} will need
to be recast. To prevent cast
+failures due to circular dependencies these spells will be dispelled now
+and recast after ${SPELL_COLOR}${SPELL}${PROBLEM_COLOR} has finished
casting. Note that if you abort the
+cast, or if the cast fails some of these spells may be left dispelled.
+It is highly recommended to upgrade (downgrade)
${SPELL_COLOR}${SPELL}${PROBLEM_COLOR} in a separate
+cast." &&
+ message "${MESSAGE_COLOR}The following spells will be dispelled and
recast:" &&
+ message $(fold -s -w 72 <<< "${SPELL_COLOR}${recast_list}") &&
+ query "${QUERY_COLOR}Do you wish to upgrade (downgrade)
${SPELL_COLOR}${SPELL}${QUERY_COLOR} now?" n &&
+ for other_spell in $recast_list; do
+ dispel $other_spell &&
+ up_trigger $other_spell cast_self
+ done
+ fi
fi
fi



  • [SM-Commit] GIT changes to master grimoire by Remko van der Vossen (2c3fc65139b3866dbb316a407cf743a26c0a4871), Remko van der Vossen, 03/19/2016

Archive powered by MHonArc 2.6.24.

Top of Page