[Slackbuilds-users] Updates - 20230128.1

B. Watson urchlay at slackware.uk
Mon Jan 30 07:26:19 UTC 2023



Sorry, this got a little more verbose than I intended. I'm writing to
the whole list, so I might be explaining things you already know. Bear
with me...

On Mon, 30 Jan 2023, Duncan Roe wrote:

>> If it's already been sourced, sure, you might end up with duplicates
>> in $PATH or such, but that won't cause any harm. And it'll save a lot
>> of headaches, and make automated mass-rebuilds a lot easier.
>
> Ah well. The thing is, you have to source the profile script *in your terminal
> session*: it's no use the SlackBuild or installpkg doing it because the
> environment of the process running the command is lost on command completion.

You're right that it's useless for google-go-lang.SlackBuild to source
its own profile script. I meant, containerd.SlackBuild should source
it. Then the environment will be set up correctly for the build,
without the user having to take manual steps to set it up.

Just put the line "source /etc/profile.d/go.sh" somewhere near the
top of containerd.SlackBuild, and it no longer depends on the user's
shell environment.

If every build that requires google-go-lang contains that line,
they'll all work right after google-go-lang is installed, no need to
adjust the terminal's environment.

A nice side benefit of this is that the script will fail immediately
if google-go-lang isn't installed.

Back when qt5 was on SBo, I routinely did this in my own scripts that
depended on qt5. I do it in a couple of builds that use Java too,
though those only search for a profile script if JAVA_HOME isn't
already set, and they have to look for multiple possible profile
scripts since we have several JDKs to choose from.


More information about the SlackBuilds-users mailing list