Bug 428991 - prefix.sh does not work on the Fish shell
Summary: prefix.sh does not work on the Fish shell
Status: RESOLVED INTENTIONAL
Alias: None
Product: extra-cmake-modules
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: ecm-bugs-null@kde.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-11 21:52 UTC by Bart Ribbers
Modified: 2020-11-12 09:13 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bart Ribbers 2020-11-11 21:52:40 UTC
SUMMARY

> source ~/.local/kde/build/neochat/prefix.sh
~/.local/kde/build/neochat/prefix.sh (line 6): ${ is not a valid variable in fish.
export XDG_DATA_DIRS=/home/bart/.local/kde/usr/share:${XDG_DATA_DIRS:-/usr/local/share/:/usr/share/}
                                                      ^
from sourcing file ~/.local/kde/build/neochat/prefix.sh
source: Error while reading file '/home/bart/.local/kde/build/neochat/prefix.sh'


I tried to source the prefix.sh installed when using kdesrc-build, but it failed on Fish. I can manually run set fish_user_paths <path to kde/usr/bin> $fish_user_paths so I can at least run the binaries directly, but prefix.sh of course does more than that.

STEPS TO REPRODUCE
1. Install the Fish shell
2. Change your shell by just running "fish"
3. Try to source the prefix.sh

OBSERVED RESULT
Sourcing fails with an error that ${ is not a valid variable

EXPECTED RESULT
Sourcing to "just work" ™


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Alpine Linux edge with the Fish shell
(available in About System)
KDE Plasma Version: 5.20.2
KDE Frameworks Version: 5.75.0
Qt Version: 5.15.1
Comment 1 Christophe Marin 2020-11-12 07:23:38 UTC
The script is intended to work with POSIX compliant shells. fish is not on of these.
Comment 2 Bart Ribbers 2020-11-12 08:17:22 UTC
I realise that but I was wondering if it would be possible to also generate a Fish compatible script. Or, if it's even possible in case of sourcing, add a shebang that points to a POSIX compatible shell so it'll work out of the box.
Comment 3 Christophe Marin 2020-11-12 09:11:37 UTC
prefix.sh is not an executable script. That's why it does not have executable permissions.

It's meant to be source'd by contributors who want to test their changes without installing.
Comment 4 Bart Ribbers 2020-11-12 09:13:46 UTC
I know, that's why I said "if it's even possible in case of sourcing". I'm guessing a shebang doesn't help in case of sourcing?