Smarter way to switch back from sbopkg SBo-git to 15.0
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Smarter way to switch back from sbopkg SBo-git to 15.0
Hi all, I open a new thread because I think that this may be useful for other people.
I was a Slackware-current user, I was using sbopkg with Ponce's SBo-git , and I have lot a packages installed with name ending in 1ponce (of course)
Now I'd like to abandon -current and remain with 15.0, I have upgraded sbopkg to version 0.38.2 and set it with 15.0 repo... but when I search for package upgrades sbopkg finds no upgrades, because it searches for package names ending in _SBo and doesn't matches 1ponce I think.
So, which the best and smarter way to do this change? If there's no alternative I'll uninstall all 1ponce packages and reinstall them from sbopkg manually; but I'm looking for a way to do automagically this change ..
the existing packages will be recognized (and the new packages will be created with that $TAG).
note that this is a workaround only for how sbopkg handles the repositories tags: this obviously doesn't take in account changes that might have happened in the base packages from your version of current and 15.0 and that, in some cases, you might still have to rebuild packages and dependencies.
Thank you for your replies; I'll try with another question: do there's a way to create a queue with all actual _ponce packages so sbopkg can build (and maybe install) all packages without searching manually for each one?
I was trying to get to the same result and this is what i used:
Code:
# get a list of installed packages with the ponce suffix
PACKAGES_TO_UPDATE=$(ls -1 /var/log/packages/ | grep ponce | sed -n -e 's/-[0-9\.]\+-x86_64-[0-9]\+ponce$//p' | xargs)
# ensure the list is valid
echo ${PACKAGES_TO_UPDATE}
# generate the needed sbopkg queues using sqg
sqg -p "${PACKAGES_TO_UPDATE}"
I was trying to get to the same result and this is what i used:
Code:
# get a list of installed packages with the ponce suffix
PACKAGES_TO_UPDATE=$(ls -1 /var/log/packages/ | grep ponce | sed -n -e 's/-[0-9\.]\+-x86_64-[0-9]\+ponce$//p' | xargs)
# ensure the list is valid
echo ${PACKAGES_TO_UPDATE}
# generate the needed sbopkg queues using sqg
sqg -p "${PACKAGES_TO_UPDATE}"
Then load the queues in sbopkg and process them
Great!! Thank you! I think there's no way to upgrade _ponce to _SBo packages from sbopkg, but this is not a problem.. when I have the queue ready I'll uninstall manually all _ponce packages then I'll proceed with build and install from the queue
if you use sbopkg 0.38.2, try sbopkg -p to list all packages installed and then use sqg -i "<all-those-packages>" -o <outputputqueue> to generate queue files for all those packages and write it as outputqueue.sqf. Later, you can build all of them using sqg -i <outputqueue>
This time for 15.0 I did a fresh install and started taking notes. From the beginning (before any third party packages upgrade) I have built a queue file using ls (-rt), grep (SBo), rev and cut. I now just need to exclude from additions the already installed packages and I will get a script to rebuild my packages in the right order.
In addition to that I might create a few scripts (adding users/groups for instance) or mod SlackBuilds (to source some profile.d scripts) and I will get an almost automated reinstall path...
Here is my approach to the problem: Instead of rebuilding all the ponce packages, I want to update from the SBo official repo as new updates arrive. I used the method and scripts below with success, but I advise caution:
Strategy:
0. It's a good idea to backup the directory /var/log/packages before you begin.
1. For each <packagename>ponce file in /var/log/packages, create a copy named <packagename>_SBo, and keep a list of these in a file under /tmp. Script 1 below does that.
2. Run sbopkg as usual to check for updates. The "fake" packages above should fool sbopkg and they will be included in the update check. Do not start the build & install process yet.
3. In a separate terminal run Script 2 below to remove the "fake" package files from /var/log/packages.
4. Continue with the build/install procedure in sbopkg as usual.
Result: Your "ponce" packages will be updated to "_SBo" packages.
Script 1:
Code:
#!/bin/bash
if [ -f /tmp/flist.txt ]; then
rm /tmp/flist.txt
fi
cd /var/log/packages
for f in *ponce; do
bname=${f::-5}
echo ${bname}_SBo >> /tmp/flist.txt
cp $f ${bname}_SBo
done
Script 2:
Code:
#!/bin/bash
cd /var/log/packages
while read -r f; do
rm $f
done < /tmp/flist.txt
Here is my approach to the problem: Instead of rebuilding all the ponce packages, I want to update from the SBo official repo as new updates arrive. I used the method and scripts below with success, but I advise caution:
Strategy:
0. It's a good idea to backup the directory /var/log/packages before you begin.
1. For each <packagename>ponce file in /var/log/packages, create a copy named <packagename>_SBo, and keep a list of these in a file under /tmp. Script 1 below does that.
2. Run sbopkg as usual to check for updates. The "fake" packages above should fool sbopkg and they will be included in the update check. Do not start the build & install process yet.
3. In a separate terminal run Script 2 below to remove the "fake" package files from /var/log/packages.
4. Continue with the build/install procedure in sbopkg as usual.
Result: Your "ponce" packages will be updated to "_SBo" packages.
Really nice! Little tricky but really neat .. and should be used every time until all packages are updated, but IMHO is the best approach
Rather than rebuilding everything, you should be able to just rename the files in the package database. Save this as something like pkg-tag-rename.sh and then run it as root.
Code:
OLDTAG=ponce
NEWTAG=_SBo
for i in /var/lib/pkgtools/{packages,scripts}/*$OLDTAG; do
NEWPKG=$(echo "$i" | sed "s|$OLDTAG$|$NEWTAG|")
mv "$i" "$NEWPKG"
done
This will allow them to show up with sbopkg and then you can upgrade as new updates become available.
(It might not be a bad idea to back up /var/lib/pkgtools/{packages,scripts}/, just in case )
EDIT: corrected script to use pkgtools instead of pkgtool. That's what I get for making the script on my 14.2 machine which still uses the old /var/log/packages/
Last edited by bassmadrigal; 03-27-2022 at 03:35 PM.
Rather than rebuilding everything, you should be able to just rename the files in the package database. Save this as something like pkg-tag-rename.sh and then run it as root.
Code:
OLDTAG=ponce
NEWTAG=_SBo
for i in /var/lib/pkgtool/{packages,scripts}/*$OLDTAG; do
NEWPKG=$(echo "$i" | sed "s|$OLDTAG$|$NEWTAG|")
mv "$i" "$NEWPKG"
done
This will allow them to show up with sbopkg and then you can upgrade as new updates become available.
(It might not be a bad idea to back up /var/lib/pkgtool/{packages,scripts}/, just in case )
I also thought about this approach, but I was worried about damaging the consistency of records elsewhere. There are a couple of other slackpkg-like installer scripts people are using, I think, and (not having used them ever,) I don't know if they rely on other logs. But as long as one sticks to sbopkg, a total rename like above should also be safe (the devs would know better, of course ).
I also thought about this approach, but I was worried about damaging the consistency of records elsewhere. There are a couple of other slackpkg-like installer scripts people are using, I think, and (not having used them ever,) I don't know if they rely on other logs. But as long as one sticks to sbopkg, a total rename like above should also be safe (the devs would know better, of course ).
Yeah, if other SBo interacting tools manage their own package database, this probably wouldn't work, but that doesn't seem to follow the KISS rule that I imagine most would try and keep.
Rather than rebuilding everything, you should be able to just rename the files in the package database. Save this as something like pkg-tag-rename.sh and then run it as root.
I tried your script on a RPi (arm), but got the following:
Code:
# sh /tmp/pkg-tag-rename.sh
mv: cannot stat '/var/lib/pkgtool/packages/*ponce': No such file or directory
mv: cannot stat '/var/lib/pkgtool/scripts/*ponce': No such file or directory
And there sure are plenty *ponce packages installed:
Code:
# ls -l /var/lib/pkgtools/packages/|grep ponce
-rw-r--r-- 1 root root 1543 Jan 12 2019 OpenAL-1.18.0-arm-1ponce
-rw-r--r-- 1 root root 131041 Oct 28 2019 apache-ant-1.9.14-noarch-1ponce
-rw-r--r-- 1 root root 10308 Jan 22 01:07 avahi-0.8-arm-5ponce
-rw-r--r-- 1 root root 1007 Nov 2 2020 chromaprint-1.4.3-arm-1ponce
-rw-r--r-- 1 root root 912 Jun 10 2019 crossguid-20160705-arm-1ponce
-rw-r--r-- 1 root root 763 Jun 10 2019 deb2tgz-0.2-noarch-1ponce
-rw-r--r-- 1 root root 1171 Feb 23 21:25 faad2-2.9.2-arm-2ponce
-rw-r--r-- 1 root root 37303 Oct 6 2020 flatbuffers-1.12.0-arm-1ponce
-rw-r--r-- 1 root root 1268 Oct 15 14:55 fmt-7.1.3-arm-1ponce
-rw-r--r-- 1 root root 893 Jun 10 2019 libass-0.14.0-arm-1ponce
-rw-r--r-- 1 root root 1297 May 20 2020 libcec-4.0.4-arm-1ponce
-rw-r--r-- 1 root root 1108 Jun 14 2019 libdaemon-0.14-arm-1ponce
-rw-r--r-- 1 root root 1251 Feb 23 21:29 libmicrohttpd-0.9.70-arm-2ponce
-rw-r--r-- 1 root root 1364 Sep 27 14:48 libmms-0.6.4-arm-2ponce
-rw-r--r-- 1 root root 1267 Feb 23 21:31 libmpd-11.8.17-arm-2ponce
-rw-r--r-- 1 root root 1371 Feb 23 21:36 libnfs-5.0.1-arm-1ponce
-rw-r--r-- 1 root root 1203 Feb 23 21:38 libshout-2.4.5-arm-3ponce
-rw-r--r-- 1 root root 1609 Jun 15 2019 platform-2.1.0-arm-1ponce
-rw-r--r-- 1 root root 69475 Jun 14 2019 rapidjson-1.1.0-arm-2ponce
-rw-r--r-- 1 root root 1372 Mar 18 2021 rtmpdump-20210219_f1b83c1-arm-1ponce
-rw-r--r-- 1 root root 1469 Jan 24 2020 soxr-0.1.3-arm-1ponce
-rw-r--r-- 1 root root 758 Jun 11 2019 tinyxml-2.6.2-arm-2ponce
-rw-r--r-- 1 root root 1209 Jun 19 2020 twolame-0.4.0-arm-1ponce
-rw-r--r-- 1 root root 3391 Apr 9 2020 xrdp-0.9.12-arm-1ponce
-rw-r--r-- 1 root root 1067 Sep 6 2018 yajl-2.1.0-arm-2ponce
-rw-r--r-- 1 root root 5421 Feb 23 21:43 zziplib-0.13.71-arm-2ponce
Any modifications I could make to the script to correctly identify those files?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.