I created
for my own convenience an
activate-011-slapt-get to have the symlinks done automatically and to also not have to remember where I put the module. I put activate-011-slapt-get into /usr/local/bin like with all my scripts.
It is only meant to be run by root and run by root only:
Code: Select all
root@porteus:/usr/local/bin# ls -l activate-011-slapt-get
-rwxr--r-- 1 root root 1758 2022-09-30 04:39 activate-011-slapt-get
If you use the code
make sure to adjust the path to where your own 011-slapt-get-0.11.6-x86_64-2gv.xzm sits in your system.
For reference I use the
fake path of /MYMODULESPATH/ - in all caps so that it's
easier to spot what you need to edit.
The code itself is not the most elegant one, but it works.

And it has a minimum of sanity checks.
CAVE! Do not change the ownership or permissions. My script has not the ability to ask for the root password. It needs only be executable by root and root.root needs to be the owner and group of it.
CAVE2! It uses colour codes that are by default not part of your system.
When such codes not exist in your system your version of the script just doesn't display colours.
Examples are ${bld}${yel} for bold + yellow or
${off} for switching the colour and bold off. I cannot post the code of the file I use for that here since it uses escape sequences and that won't work as [
code
]
(tput is a better alternative but many of my scripts are based on years old code and I just use the same basic method as back then and me is too lazy to edit dozens of scripts into using tput - and you have to debug the new versions if there is now an error added by mistake or not)
Code: Select all
#!/bin/sh
VERSION="0.3" # added parameter -i aka --info
MYNAME="activate-011-slapt-get"
echo -e "${bld}${yel}$MYNAME$off V$yel$VERSION${off}"
actifile="/MYMODULESPATH/011-slapt-get-0.11.6-x86_64-2gv.xzm"
if [ -f "$actifile" ] ; then
# file exists
file "$actifile" | grep "Squashfs filesystem" 2>&1 >/dev/null
declare -i returnval=$?
if [ $returnval -eq 0 ] ; then
# and is of file type "Squashfs filesystem"
if [ $# -eq 1 ]; then
# one parameter given, check if its -i or --info
if [ "$1" = "-i" -o "$1" = "--info" ]; then
echo "Parameter -i aka --info given, show only info about module to be loaded when starting this script without any parameter:"
/bin/ls -oatr --time-style=long-iso "$actifile"|cut -c 19-
du -m "$actifile"
exit 0
else
echo -e ${red}"Error- Unknown parameter, only '-i' or '--info' is supported! Abort!"${off}not
exit 3
fi
elif [ $# -gt 1 ]; then
echo -e ${red}"Error- Only one valid parameter '-i' or '--info'! Abort!"${off}
exit 3
else
echo activate "$actifile"
activate "$actifile"
fi
else
echo -e ${red}"Error- File to activate
$actifile
is not of file type 'Squashfs filesystem'. Abort!"${off}
exit 2
fi
else
echo -e ${red}"Error- File to activate
$actifile
not found. Abort!"${off}
exit 1
fi
echo cd /var/lib/pkgtools/packages
cd /var/lib/pkgtools/packages
ln -vs gtk3-classic* gtk+3-3.24.33-x86_64-1
ln -vs boost-stripped* boost-1.78.0-x86_64-1
ln -vs llvm-stripped* llvm-13.0.0-x86_64-1
# v0.2 added sanity check file "$actifile" | grep "Squashfs filesystem"
# v0.3 added parameter -i / --info
this is what it looks like when executed:
Code: Select all
root@porteus:/usr/local/bin# activate-011-slapt-get
activate-011-slapt-get V0.3
activate /MYMODULESPATH/011-slapt-get-0.11.6-x86_64-2gv.xzm
Updating shared library links: /sbin/ldconfig
cd /var/lib/pkgtools/packages
'gtk+3-3.24.33-x86_64-1' -> 'gtk3-classic-3.24.33-x86_64-2ncm'
'boost-1.78.0-x86_64-1' -> 'boost-stripped-1.78.0-x86_64-2_slack15.0'
'llvm-13.0.0-x86_64-1' -> 'llvm-stripped-13.0.0-x86_64-2'
and this is the result of using
instead of running
Code: Select all
activate /MYMODULESPATH/011-slapt-get-0.11.6-x86_64-2gv.xzm
:
Code: Select all
root@porteus:/# cd /var/lib/pkgtools/packages
root@porteus:/var/lib/pkgtools/packages# ls -o gtk+3-3.24.33-x86_64-1 boost-1.78.0-x86_64-1 llvm-13.0.0-x86_64-1
lrwxrwxrwx 1 root 40 2022-09-30 04:40 boost-1.78.0-x86_64-1 -> boost-stripped-1.78.0-x86_64-2_slack15.0
lrwxrwxrwx 1 root 32 2022-09-30 04:40 gtk+3-3.24.33-x86_64-1 -> gtk3-classic-3.24.33-x86_64-2ncm
lrwxrwxrwx 1 root 29 2022-09-30 04:40 llvm-13.0.0-x86_64-1 -> llvm-stripped-13.0.0-x86_64-2
