Netfab,

On Friday, 2023-04-21 14:43:32 +0200, you wrote:

> ...
> I do not see anything particular in your emerge --info.
> What is your eselect version ?
> > $ eselect --version

   $ eselect --version
   eselect 1.4.20

   Copyright (c) 2005-2020 Gentoo Authors.
   Distributed under the terms of the GNU GPL version 2 or later.
   $

> You can get bash debug output by running the following :
> > $ bash -x /usr/bin/eselect profile list 2> /tmp/debug.log

Oops, I didn't know or expect  "eselect" to be a Bash script.  Otherwise
I would have done this already :-)

I've appended the trace output at the end.   This sure revealed the pro-
blem: skimming upward from the call to "die" in line ">196:" one can see
the script trying in line ">>>129:"  to extract lines matching "^x86_64"
from "/var/db/repos/gentoo/profiles/profiles.desc".   However, there are
none.  Skimming farther upward reveals the string "x86_64" being derived
in line ">>>>33:"  from environment variable "ARCH" which  is defined in
my shell initialization scripts:

   export ARCH=$({ arch || uname -m || echo unknown ; } 2> /dev/null)

But the only architectures supported by my "profiles.desc" file are:

   $ gawk '! /^#|^$/ { print $1 }
          ' /var/db/repos/gentoo/profiles/profiles.desc | sort -u
   alpha
   amd64
   amd64-linux
   arm
   arm-linux
   arm64
   arm64-linux
   arm64-macos
   hppa
   ia64
   loong
   m68k
   mips
   ppc
   ppc-macos
   ppc64
   ppc64-linux
   riscv
   riscv-linux
   s390
   sparc
   sparc-solaris
   sparc64-solaris
   x64-cygwin
   x64-macos
   x64-solaris
   x64-winnt
   x86
   x86-linux
   x86-solaris
   x86-winnt
   $

So what is causing this?  Why is environment variable "ARCH" expected to
have a value different from "$(arch)"?  In fact, running

   $ ARCH= eselect profile list
     [1]   default/linux/amd64/17.1 (stable)
     ...
     [35]  default/linux/amd64/17.0/musl/hardened/selinux (exp)
   $

succeeds, which is slightly puzzling, at least for me :-/

But if that's the way it has to be, I can live with it by just setting my
"eselect" alias to "eselect='ARCH= eselect --color=no'", which works.

In any case thanks for your time and effort :-)

Sincerely,
  Rainer

And here's the complete trace output:

   $ PS4='>$LINENO: ' bash -x /usr/bin/eselect profile list
   >20: ESELECT_DATA_PATH=/usr/share/eselect
   >23: ESELECT_DEFAULT_MODULES_PATH=/usr/share/eselect/modules
   >28: ESELECT_MODULES_PATH=("${HOME}/.eselect/modules" 
"${ESELECT_DEFAULT_MODULES_PATH}")
   >31: ESELECT_CORE_PATH=/usr/share/eselect/libs
   >34: ESELECT_DEFAULT_ACTIONS=/usr/share/eselect/libs/default.eselect
   >37: ESELECT_PROGRAM_NAME=eselect
   >38: ESELECT_VERSION=1.4.20
   >41: ESELECT_BINARY_NAME=/usr/bin/eselect
   >42: ESELECT_KILL_TARGET=22018
   >45: EPREFIX=
   >46: EROOT=
   >50: unalias -a
   >51: unset -f rm
   >52: unset CDPATH GLOBIGNORE
   >53: IFS='   
   '
   >55: shopt -s extglob
   >56: shopt -s expand_aliases
   >58: umask +rx
   >61: ((  BASH_VERSINFO[0] == 4 && BASH_VERSINFO[1] >= 1 || BASH_VERSINFO[0] 
> 4  ))
   >63: exec
   >67: source /usr/share/eselect/libs/core.bash
   >69: inherit manip output path-manipulation tests
   >113: local x
   >114: for x in "$@"
   >115: [[ -e /usr/share/eselect/libs/manip.bash ]]
   >117: source /usr/share/eselect/libs/manip.bash
   >114: for x in "$@"
   >115: [[ -e /usr/share/eselect/libs/output.bash ]]
   >117: source /usr/share/eselect/libs/output.bash
   >114: for x in "$@"
   >115: [[ -e /usr/share/eselect/libs/path-manipulation.bash ]]
   >117: source /usr/share/eselect/libs/path-manipulation.bash
   >114: for x in "$@"
   >115: [[ -e /usr/share/eselect/libs/tests.bash ]]
   >117: source /usr/share/eselect/libs/tests.bash
   >73: trap 'echo "exiting" >&2; exit 250' 15
   >111: action=
   >112: for suffix in config update{,r} tool manager reader
   >113: [[ /usr/bin/eselect != \/\u\s\r\/\b\i\n\/\e\s\e\l\e\c\t ]]
   >112: for suffix in config update{,r} tool manager reader
   >113: [[ /usr/bin/eselect != \/\u\s\r\/\b\i\n\/\e\s\e\l\e\c\t ]]
   >112: for suffix in config update{,r} tool manager reader
   >113: [[ /usr/bin/eselect != \/\u\s\r\/\b\i\n\/\e\s\e\l\e\c\t ]]
   >112: for suffix in config update{,r} tool manager reader
   >113: [[ /usr/bin/eselect != \/\u\s\r\/\b\i\n\/\e\s\e\l\e\c\t ]]
   >112: for suffix in config update{,r} tool manager reader
   >113: [[ /usr/bin/eselect != \/\u\s\r\/\b\i\n\/\e\s\e\l\e\c\t ]]
   >112: for suffix in config update{,r} tool manager reader
   >113: [[ /usr/bin/eselect != \/\u\s\r\/\b\i\n\/\e\s\e\l\e\c\t ]]
   >119: unset suffix
   >121: [[ -z '' ]]
   >>122: basename /usr/bin/eselect
   >>22: local path=/usr/bin/eselect suf=
   >>24: [[ -z /usr/bin/eselect ]]
   >>30: path=/usr/bin/eselect
   >>33: path=eselect
   >>36: [[ '' != \e\s\e\l\e\c\t ]]
   >>36: path=eselect
   >>39: echo eselect
   >122: binname=eselect
   >123: for prefix in config update{,r} manage 'read'
   >124: [[ eselect != eselect ]]
   >123: for prefix in config update{,r} manage 'read'
   >124: [[ eselect != eselect ]]
   >123: for prefix in config update{,r} manage 'read'
   >124: [[ eselect != eselect ]]
   >123: for prefix in config update{,r} manage 'read'
   >124: [[ eselect != eselect ]]
   >123: for prefix in config update{,r} manage 'read'
   >124: [[ eselect != eselect ]]
   >130: unset binname prefix
   >134: [[ profile != \p\r\o\f\i\l\e ]]
   >170: [[ -z '' ]]
   >170: [[ 2 -gt 0 ]]
   >171: action=profile
   >172: shift
   >176: [[ -t 1 ]]
   >177: colours yes
   >19: [[ yes != n* ]]
   >>20: tput sgr0
   >20: COLOUR_NORMAL=''
   >>21: tput bold
   >21: COLOUR_BOLD=''
   >>22: tput setaf 4
   >22: COLOUR_HI=''
   >>23: tput setaf 3
   >23: COLOUR_WARN=''
   >>24: tput setaf 1
   >24: COLOUR_ERROR=''
   >>25: tput setaf 2
   >25: COLOUR_LIST_HEADER=''
   >26: COLOUR_LIST_LEFT=''
   >27: COLOUR_LIST_RIGHT=''
   >178: init_columns
   >54: [[ -n '' ]]
   >>54: tput cols
   >54: COLUMNS=80
   >182: unset colour
   >184: [[ -n profile ]]
   >185: is_function es_do_profile
   >>32: type -t es_do_profile
   >32: [[ '' == \f\u\n\c\t\i\o\n ]]
   >189: do_action profile list
   >84: local action=profile modfile= subaction=list
   >85: [[ -z profile ]]
   >86: shift
   >86: shift
   >88: ESELECT_MODULE_NAME=profile
   >89: ESELECT_COMMAND='eselect profile'
   >91: [[ eselect != \e\s\e\l\e\c\t ]]
   >>94: find_module profile
   >>71: local modname=profile modpath
   >>72: for modpath in "${ESELECT_MODULES_PATH[@]}"
   >>73: [[ -f /home/rainer/.eselect/modules/profile.eselect ]]
   >>72: for modpath in "${ESELECT_MODULES_PATH[@]}"
   >>73: [[ -f /usr/share/eselect/modules/profile.eselect ]]
   >>74: echo /usr/share/eselect/modules/profile.eselect
   >>75: return
   >94: modfile=/usr/share/eselect/modules/profile.eselect
   >96: source /usr/share/eselect/libs/default.eselect
   >98: source /usr/share/eselect/modules/profile.eselect
   >100: [[ -z list ]]
   >103: is_function do_list
   >>32: type -t do_list
   >32: [[ function == \f\u\n\c\t\i\o\n ]]
   >105: check_do do_list
   >21: local function=do_list
   >22: shift
   >23: is_function do_list
   >>32: type -t do_list
   >32: [[ function == \f\u\n\c\t\i\o\n ]]
   >24: do_list
   >192: local targets active i target repo repopath status disp
   >194: targets=($(find_targets))
   >>194: find_targets
   >>47: local arch desc repos repo_paths i p
   >>>49: arch
   >>>>45: envvar sys-devel/gcc ARCH
   >>>>149: [[ 2 -eq 2 ]]
   >>>>150: case $(package_manager) in
   >>>>>150: package_manager
   >>>>>21: local pm
   >>>>>22: case ${PACKAGE_MANAGER} in
   >>>>>27: echo portage
   >>>>152: portageq envvar ARCH
   >>>>33: command portageq envvar ARCH
   >>>45: local ret=x86_64
   >>>47: [[ -n '' ]]
   >>>62: [[ -z x86_64 ]]
   >>>142: echo x86_64
   >>49: arch=x86_64
   >>50: [[ -z x86_64 ]]
   >>52: repos=($(get_repos))
   >>>52: get_repos
   >>>33: portageq get_repos /
   >>>33: command portageq get_repos /
   >>>34: sed 's/[[:space:]]\+/\n/g;s/^gentoo$/ &/gm'
   >>>129: command sed 's/[[:space:]]\+/\n/g;s/^gentoo$/ &/gm'
   >>>35: LC_ALL=C
   >>>35: sort
   >>>36: [[ 0 0 0 = \0\ \0\ \0 ]]
   >>53: repo_paths=($(get_repo_path "${repos[@]}"))
   >>>53: get_repo_path gentoo gnu-elpa local melpa melpa-stable
   >>>41: portageq get_repo_path / gentoo gnu-elpa local melpa melpa-stable
   >>>33: command portageq get_repo_path / gentoo gnu-elpa local melpa 
melpa-stable
   >>55: [[ 5 -eq 0 ]]
   >>55: [[ 5 -ne 5 ]]
   >>58: (( i = 0 ))
   >>58: (( i < 5 ))
   >>59: desc=/var/db/repos/gentoo/profiles/profiles.desc
   >>60: [[ -r /var/db/repos/gentoo/profiles/profiles.desc ]]
   >>>62: sed -n -e 
's|^x86_64[[:space:]]\+\([^[:space:]]\+\)[[:space:]]\+\([^[:space:]]\+\).*$|\1::\2|p'
 /var/db/repos/gentoo/profiles/profiles.desc
   >>>129: command sed -n -e 
's|^x86_64[[:space:]]\+\([^[:space:]]\+\)[[:space:]]\+\([^[:space:]]\+\).*$|\1::\2|p'
 /var/db/repos/gentoo/profiles/profiles.desc
   >>58: (( i++  ))
   >>58: (( i < 5 ))
   >>59: desc=/var/lib/layman/gnu-elpa/profiles/profiles.desc
   >>60: [[ -r /var/lib/layman/gnu-elpa/profiles/profiles.desc ]]
   >>60: continue
   >>58: (( i++  ))
   >>58: (( i < 5 ))
   >>59: desc=/var/lib/Local-Overlay/profiles/profiles.desc
   >>60: [[ -r /var/lib/Local-Overlay/profiles/profiles.desc ]]
   >>60: continue
   >>58: (( i++  ))
   >>58: (( i < 5 ))
   >>59: desc=/var/lib/layman/melpa/profiles/profiles.desc
   >>60: [[ -r /var/lib/layman/melpa/profiles/profiles.desc ]]
   >>60: continue
   >>58: (( i++  ))
   >>58: (( i < 5 ))
   >>59: desc=/var/lib/layman/melpa-stable/profiles/profiles.desc
   >>60: [[ -r /var/lib/layman/melpa-stable/profiles/profiles.desc ]]
   >>60: continue
   >>58: (( i++  ))
   >>58: (( i < 5 ))
   >195: [[ 0 -eq 0 ]]
   >196: die -q 'Failed to get a list of valid profiles'
   >33: local item funcname= sourcefile= lineno= n e s=yes
   >36: [[ -n 10 ]]
   >36: exec
   >39: is_function write_error_msg
   >>32: type -t write_error_msg
   >32: [[ function == \f\u\n\c\t\i\o\n ]]
   >40: e=write_error_msg
   >46: [[ -q == \-\q ]]
   >47: s=
   >48: shift
   >51: write_error_msg 'Failed to get a list of valid profiles'
   >60: echo -e '!!! Error: Failed to get a list of valid 
profiles'
   !!! Error: Failed to get a list of valid profiles
   >53: [[ -n '' ]]
   >64: kill 22018
   >65: exit 249
   >>1: echo exiting
   exiting
   >>1: exit 250

Reply via email to