Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master sorcery by Thomas Orgis (155d8c0362a10f3fe67a8fc9ff0924ab45415fff)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Thomas Orgis <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master sorcery by Thomas Orgis (155d8c0362a10f3fe67a8fc9ff0924ab45415fff)
  • Date: Fri, 26 Feb 2021 11:26:31 +0000

GIT changes to master sorcery by Thomas Orgis <sobukus AT sourcemage.org>:

var/lib/sorcery/modules/libmisc | 36 +++++++++++++++---------------------
1 file changed, 15 insertions(+), 21 deletions(-)

New commits:
commit 155d8c0362a10f3fe67a8fc9ff0924ab45415fff
Author: Thomas Orgis <sobukus AT sourcemage.org>
Commit: Thomas Orgis <sobukus AT sourcemage.org>

Revert "libmisc: Implement one-shot specfile selection"

This reverts commit 615b00c28da7e62b0b31098b0229b0f9a04de0d2.

This broke things by not setting specdir appropriately, causing
later attempts to fix that. Those attempts break for differing
arch selections as they are not all in the same path depth.

We shall never guess specdir after the fact. Use the values
we know!

diff --git a/var/lib/sorcery/modules/libmisc b/var/lib/sorcery/modules/libmisc
index b2bc2c0..cbc09cd 100755
--- a/var/lib/sorcery/modules/libmisc
+++ b/var/lib/sorcery/modules/libmisc
@@ -1485,29 +1485,23 @@ set_architecture() {
: ${arch:=${TARGET:-$ARCHITECTURE}}

# Find the specfile to use
- SPECFILE=$(find -L "${ARCH_SPECS[@]}" \( -name "$arch" -o -name null \) \
- -perm -400 -type f 2>/dev/null |
- awk '! /[/]null$/ { exit } END { print }')
- case "$SPECFILE" in
- */null)
- message "${PROBLEM_COLOR}Cannot find arch spec for $arch!"
- message "Reverting to null!"
- message "Please run sorcery afterwards and pick another
architecture!$DEFAULT_COLOR"
- echo
- sleep 2
- esac
+ for specdir in ${ARCH_SPECS[@]} ; do
+ SPECFILE=$(find -L ${specdir} -perm -400 -type f -name "$arch"
2>/dev/null | sed q)
+ [ $SPECFILE ] && break
+ done
+ if [[ ! $SPECFILE ]] ; then
+ message "${PROBLEM_COLOR}Cannot find arch spec for $arch!"
+ message "Reverting to null!"
+ message "Please run sorcery afterwards and pick another
architecture!$DEFAULT_COLOR"
+ echo
+ sleep 2
+ SPECFILE=$(find -L ${specdir} -perm -400 -type f -name "null"
2>/dev/null | sed q)
+ fi
debug "libmisc" "set_architecture: SPECFILE=$SPECFILE"

- # turn the path into an array, removing the spec dir prefix
- SMGL_COMPAT_ARCHS=($(awk -F/ -vdirs="^${ARCH_SPECS[*]}/" -vf="$SPECFILE" '
- BEGIN {
- sub(/[/]* +/, "/|^", dirs) # convert to regex
- match(f, dirs)
- f = substr(f, RLENGTH) # remove prefix
- gsub(/[/]+/, " ", f) # split
- print f
- }'))
- debug "libmisc" "set_architecture:
SMGL_COMPAT_ARCHS[${#SMGL_COMPAT_ARCHS[@]}]=(${SMGL_COMPAT_ARCHS[*]})"
+ # turn the path into an array, but remove $specdir from the start first
+ unset SMGL_COMPAT_ARCHS
+ explode "${SPECFILE#$specdir/}" '/' SMGL_COMPAT_ARCHS

# Reverse the array so that the most specific arch is first
ARCHITECTURE=($(awk 'BEGIN { while (--ARGC > 0) print ARGV[ARGC] }' \



  • [SM-Commit] GIT changes to master sorcery by Thomas Orgis (155d8c0362a10f3fe67a8fc9ff0924ab45415fff), Thomas Orgis, 02/26/2021

Archive powered by MHonArc 2.6.24.

Top of Page