LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-17-2022, 03:35 AM   #1
Barx
Member
 
Registered: Jun 2004
Location: Italy
Distribution: Slack x64 current
Posts: 150

Rep: Reputation: 26
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 ..

Thank you & kind regards

Alessandro
 
Old 03-17-2022, 04:14 AM   #2
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,118

Rep: Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192
sbopkg uses the file /etc/sbopkg/repos.d/40-sbo.repo to identify and to create packages belonging to the 15.0 repository: the file contains this line
Code:
SBo 15.0 "SBo repository for Slackware 15.0" _SBo rsync slackbuilds.org::slackbuilds/15.0 GPG
most probably, if you just edit this line to read
Code:
SBo 15.0 "SBo repository for Slackware 15.0" ponce rsync slackbuilds.org::slackbuilds/15.0 GPG
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.
 
Old 03-17-2022, 06:36 AM   #3
opty
Member
 
Registered: Mar 2021
Posts: 178

Rep: Reputation: Disabled
Download, build and

Code:
upgradepkg oldpackagename%newpackagename
?
 
1 members found this post helpful.
Old 03-17-2022, 11:17 AM   #4
Barx
Member
 
Registered: Jun 2004
Location: Italy
Distribution: Slack x64 current
Posts: 150

Original Poster
Rep: Reputation: 26
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?

Kind regards

Alessandro
 
Old 03-17-2022, 12:13 PM   #5
ctrlaltca
Member
 
Registered: May 2019
Location: Italy
Distribution: Slackware
Posts: 333

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
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
 
Old 03-18-2022, 02:55 AM   #6
Barx
Member
 
Registered: Jun 2004
Location: Italy
Distribution: Slack x64 current
Posts: 150

Original Poster
Rep: Reputation: 26
Quote:
Originally Posted by ctrlaltca View Post
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

Kind regards

Alessandro
 
Old 03-18-2022, 03:21 AM   #7
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,679

Rep: Reputation: 1796Reputation: 1796Reputation: 1796Reputation: 1796Reputation: 1796Reputation: 1796Reputation: 1796Reputation: 1796Reputation: 1796Reputation: 1796Reputation: 1796
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>
 
2 members found this post helpful.
Old 03-18-2022, 04:25 PM   #8
Tonus
Senior Member
 
Registered: Jan 2007
Location: Paris, France
Distribution: Slackware-15.0
Posts: 1,407
Blog Entries: 3

Rep: Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514
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...
 
Old 03-19-2022, 04:53 PM   #9
Ilgar
Senior Member
 
Registered: Jan 2005
Location: Istanbul, Turkey
Distribution: Slackware64 15.0, Slackwarearm 14.2
Posts: 1,157

Rep: Reputation: 237Reputation: 237Reputation: 237
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
 
1 members found this post helpful.
Old 03-21-2022, 11:25 AM   #10
Barx
Member
 
Registered: Jun 2004
Location: Italy
Distribution: Slack x64 current
Posts: 150

Original Poster
Rep: Reputation: 26
Quote:
Originally Posted by Ilgar View Post
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

Thank you

Kind regards

Alessandro
 
Old 03-21-2022, 12:44 PM   #11
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
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.
 
1 members found this post helpful.
Old 03-21-2022, 01:29 PM   #12
Ilgar
Senior Member
 
Registered: Jan 2005
Location: Istanbul, Turkey
Distribution: Slackware64 15.0, Slackwarearm 14.2
Posts: 1,157

Rep: Reputation: 237Reputation: 237Reputation: 237
Quote:
Originally Posted by bassmadrigal View Post
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 ).
 
Old 03-21-2022, 01:43 PM   #13
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by Ilgar View Post
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.
 
Old 03-27-2022, 03:17 PM   #14
BroX
Member
 
Registered: Oct 2003
Location: Sweden
Distribution: Slackware64-current, SlackwareARM-15.0
Posts: 833

Rep: Reputation: 90
Quote:
Originally Posted by bassmadrigal View Post
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?

Cheers, Leon.
 
Old 03-27-2022, 03:36 PM   #15
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Oops, I did pkgtool instead of pkgtools. Correct that in the for loop and it should work fine.

I've edited the script above.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Sbopkg and installed SBo-git packages (Not appears) Gugur Slackware 12 03-18-2022 12:03 AM
[SOLVED] sbopkg SBo-git - 'migrating' from -14.2 to -current in SBo uiopqwerty Slackware 6 05-15-2020 11:48 AM
How do I make sbopkg's bash-completion pick up the SBo-git repository (-current) rather than SBo? Lockywolf Slackware 5 05-07-2020 11:43 AM
upgrade all SBo packages to SBo-git lioh Slackware 5 08-08-2019 06:45 AM
[SOLVED] Rsync: Is it smarter to push, or smarter to pull? bubnoff Linux - Security 6 03-21-2013 02:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration