LinuxQuestions.org
Review your favorite Linux distribution.
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 02-16-2018, 11:19 AM   #1
dederon
Member
 
Registered: Oct 2013
Posts: 108

Rep: Reputation: 56
[ANN] sbog: "sbopkg -c" on steroids


sbog is a a command line program for listing slackbuild.org upgrades. from a user pov sbog works similar to sbopkg - both programs will print the same upgrade list.

sbog is written in Go. It is hosted on bitbucket.org.

motivation
i was unhappy with some aspects of the "sbopkg -c" command, especially the performance. sbog addresses this issues:
  • sbog is sufficiently fast
  • sbog can be run as non-root user
  • sbog prints the upgrades in a simple way, easy to parse for other scripts/programs
usage
Code:
sbog upgrades <sborepo> <pkgtooldb>
<sborepo> is your local slackbuild.org repository, kept up to date with sbopkg. <pkgtooldb> points to your pkgtool database.
enter "sbog help" for more information.

example:
Code:
user@host:~# sbog upgrades /var/lib/sbopkg/SBo/ /var/log/packages/
scid_vs_pc   scid_vs_pc-4.18.1-i486-1_SBo   scid_vs_pc-4.14-i486-1_SBo
feh   feh-2.14-i486-1_SBo   feh-2.23.1-i586-1_SBo
lame   lame-3.99.5-i486-1_SBo   lame-3.99.5-i586-2_SBo
libupnp   libupnp-1.6.22-i586-1_SBo   libupnp-1.8.3-i586-1_SBo
...
the first column is the base name of the package, second column the installed version, third column the repository version.

prettify the output of sbog
the default output of the upgrades command is hard to read, but as it is easy to parse we can improve it:
Code:
user@host:~# sbog upgrades /var/lib/sbopkg/SBo/ /var/log/packages/ | column -t
feh         feh-2.14-i486-1_SBo               feh-2.23.1-i586-1_SBo
scid_vs_pc  scid_vs_pc-4.18.1-i486-1_SBo      scid_vs_pc-4.14-i486-1_SBo
lame        lame-3.99.5-i486-1_SBo            lame-3.99.5-i586-2_SBo
libupnp     libupnp-1.6.22-i586-1_SBo         libupnp-1.8.3-i586-1_SBo
...
if you prefer a list similar to sbopkg:
Code:
user@host:~# sbog upgrades /var/lib/sbopkg/SBo/ /var/log/packages/ | awk '{print $1 "\n\tinstalled: " $2 "\n\tnew:       " $3 }'
scid_vs_pc
        installed: scid_vs_pc-4.18.1-i486-1_SBo
        new:       scid_vs_pc-4.14-i486-1_SBo
feh
        installed: feh-2.14-i486-1_SBo
        new:       feh-2.23.1-i586-1_SBo
lame
        installed: lame-3.99.5-i486-1_SBo
        new:       lame-3.99.5-i586-2_SBo
...
for convenience i made a shortcut "sbou" by putting this code into my shell startup script:
Code:
sbou() {
        sbog upgrades /var/lib/sbopkg/SBo/ /var/log/packages/ | awk '{print $1 "\n\tinstalled: " $2 "\n\tnew:       " $3 }'
}
benchmarks
on my 32-bit slackware-current system there are about 1000 installed packages. 70 of these packages are slackbuild based. i use the slackbuild.org "master" branch.
for the benchmarks every command is run twice:
  • 1st run: before running the command the hd cache is cleared by using the command "sudo sh -c 'sync && echo 3 > /proc/sys/vm/drop_caches'". it's like running the program for the first time after boot.
  • 2nd run: all hd data is in cache now.
elapsed time:
Code:
            sbopkg -c     sbog upgrades
1st run       38 s             10 s
2nd run       16 s            0.6 s
supported slackbuild.org branches
sbog was tested with the slackbuild.org "master" and "14.2" branch.

sbog has no support for following slackbuild scripts: development/p4v, libraries/p4api, multimedia/google-talkplugin, multimedia/huludesktop, network/viber, python/p4python, system/aide, network/dianara (patch for dianara awaits merge into master).
the reason is that these scripts do nasty things and sbog is not able to parse the package version from the script (parsing the package version from a slackbuild is a clumsy and hacky business. a slackbuild repository does not contain a package database.).

sbog will work with other slackbuild.org branches, but it's more likely to run into issues. saying that, almost all slackbuilds are still fine, errors are the exception.

installation
the current version is 0.2.

binary download
you can download executables from the project download page. make sure to check the sha512 sums after downloading:
Code:
40e56b671320a96f6a22dff4125fabe557e740b90e7c61be358ec87a78ec62e794e8354a2c745d2123380d2551c21e9c87e15014922bf7864b9a84dddc9686d2  sbog-0.2-x86
1674454a8ae01125698f450515a17e6bf9d69fe94f6d237e4a3a6ff3d6a8e4e0702562c4f70b3adac3ccc35ee260dbe2e42b004cbaf5e06a737ad6b07af999bc  sbog-0.2-x86_64
f883ff83c3102d8ba408bc699d4e0f87d4a8ead3836388546a53d940ab435a33c030c83bb486eff0591014bcb1f807b5eb1a28f28da5fa4dc5ff91a440284795  sbog-x86
a766e8b43da9d45b80d7dab5fedb9917879ab1f0c5d8458d54b5650971a1ce80e3c8be036396402592b8defe153ddaa5c6a1416a0cdeecf600ed291ff92db00e  sbog-x86_64
installation from source
important note: don't use the go command that comes with slackware (gcc-go package), but install go by using the google-go-lang slackbuild. this is the default go compiler and produces the best code.

installation procedure:
Code:
# set the go sandbox, go code lives here
export GOPATH=<path to go sandbox>
	
# go executables are installed to this place
export PATH=$GOPATH/bin:$PATH
	
# download the source, compile and install
go get bitbucket.org/trueslack/sbog
	
# sbog is now usable
sbog help
open issues
dealing with package name changes is not implemented yet.

Last edited by dederon; 02-24-2018 at 03:11 AM. Reason: 0.2 release
 
Old 02-16-2018, 01:05 PM   #2
a4z
Senior Member
 
Registered: Feb 2009
Posts: 1,727

Rep: Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742
looks very interesting, great!
 
Old 02-16-2018, 02:27 PM   #3
55020
Senior Member
 
Registered: Sep 2009
Location: Yorks. W.R. 167397
Distribution: Slackware
Posts: 1,307
Blog Entries: 4

Rep: Reputation: Disabled
Quote:
Originally Posted by dederon View Post
these scripts do nasty things and sbog is not able to parse the package version from the script
Get it from the .info
 
Old 02-16-2018, 03:00 PM   #4
dederon
Member
 
Registered: Oct 2013
Posts: 108

Original Poster
Rep: Reputation: 56
thanks for your feedback!

Quote:
Originally Posted by a4z View Post
looks very interesting, great!
glad you like it! if you try sbog tell me how it works.

Quote:
Originally Posted by 55020 View Post
Get it from the .info
yes, i know. sbopkg uses the info files as a fallback. but i don't.

1st i don't trust these files (actually i don't like the fact that the version info is stored in two places - the script and the info file). 2nd the info file is missing the build version. 3rd is that i want sbog to use the slackbuild only.

saying that, i would welcome some kind of package database on slackbuilds.org, this would make sbog superfluous. getting the current version of a package should be simple for a client, but sbog (and sbopkg) has to rely on the build scripts. you better not look at the code to find out how i extract the version and build info. it's awful.
 
1 members found this post helpful.
Old 02-16-2018, 03:36 PM   #5
solarfields
Senior Member
 
Registered: Feb 2006
Location: slackalaxy.com
Distribution: Slackware, CRUX
Posts: 1,449

Rep: Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997
Quote:
1st i don't trust these files
how do you resolve dependencies?
 
Old 02-16-2018, 03:52 PM   #6
55020
Senior Member
 
Registered: Sep 2009
Location: Yorks. W.R. 167397
Distribution: Slackware
Posts: 1,307
Blog Entries: 4

Rep: Reputation: Disabled
Quote:
Originally Posted by dederon View Post
1st i don't trust these files (actually i don't like the fact that the version info is stored in two places - the script and the info file).
Yes, I'm familiar with the concept of Single Source of Truth. The SSOT for the version is the .info file, not the SlackBuild.

VERSION and DOWNLOAD and MD5SUM are, essentially, indivisible. If you change one, you have to change all three. DOWNLOAD and MD5SUM are in the .info file only, therefore the definition of VERSION in the .info file *has* to be the one that prevails.

The code in the SlackBuild merely provides a *fallback* for VERSION for people who prefer to invoke SlackBuilds manually.

Quote:
Originally Posted by dederon View Post
2nd the info file is missing the build version.
Yes, I know that thanks.

Quote:
Originally Posted by dederon View Post
3rd is that i want sbog to use the slackbuild only.
Bad call.

There are plenty of updates when a fix is made to the .info file only, e.g. fixed md5sum, changed download, fixed deps.

And there are plenty of updates when a fix is made to the .SlackBuild only.

Quote:
Originally Posted by dederon View Post
saying that, i would welcome some kind of package database on slackbuilds.org, this would make sbog superfluous. getting the current version of a package should be simple for a client, but sbog (and sbopkg) has to rely on the build scripts. you better not look at the code to find out how i extract the version and build info. it's awful.
To a large extent, the version and build info (and therefore any database containing that) is irrelevant. You should be looking to see if git (or the tarball) has been updated.
 
3 members found this post helpful.
Old 02-16-2018, 04:04 PM   #7
dederon
Member
 
Registered: Oct 2013
Posts: 108

Original Poster
Rep: Reputation: 56
the last two replies seem to indicate that my starter post does not emphasize enough that sbog is about listing package upgrades only. it does not care about dependencies, checksums, download locations and the like. these are irrelevant for sbog.
 
2 members found this post helpful.
Old 02-16-2018, 04:17 PM   #8
55020
Senior Member
 
Registered: Sep 2009
Location: Yorks. W.R. 167397
Distribution: Slackware
Posts: 1,307
Blog Entries: 4

Rep: Reputation: Disabled
So your users won't be told about fixes. Okayyyyyyy
 
2 members found this post helpful.
Old 02-17-2018, 01:45 AM   #9
dederon
Member
 
Registered: Oct 2013
Posts: 108

Original Poster
Rep: Reputation: 56
@ponce: did you receive my email from last weekend with a patch for dianara and the request/offer to clean up some slackbuilds?
 
Old 02-17-2018, 02:00 AM   #10
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,109

Rep: Reputation: 4179Reputation: 4179Reputation: 4179Reputation: 4179Reputation: 4179Reputation: 4179Reputation: 4179Reputation: 4179Reputation: 4179Reputation: 4179Reputation: 4179
Quote:
Originally Posted by dederon View Post
@ponce: did you receive my email from last weekend with a patch for dianara and the request/offer to clean up some slackbuilds?
yes, sorry if I hadn't answered to it yet, but I had to do another thing after having read it and unfortunately I forgot to get back to it...

apart from dianara and gajim, why don't you explain your request to clean up some slackbuilds in this topic (or on the slackbuilds-users mailing list) so that it gets discussed with more people?
 
Old 02-17-2018, 12:49 PM   #11
dederon
Member
 
Registered: Oct 2013
Posts: 108

Original Poster
Rep: Reputation: 56
hi ponce, as for the slackbuild cleanup: i don't want to make a fuss about it, it's only six scripts and i don't use them anyway. thanks for all your help.
 
Old 02-18-2018, 01:52 AM   #12
a4z
Senior Member
 
Registered: Feb 2009
Posts: 1,727

Rep: Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742
can sbog work with queue files?
t have some dependency handling
 
Old 02-18-2018, 08:05 AM   #13
dederon
Member
 
Registered: Oct 2013
Posts: 108

Original Poster
Rep: Reputation: 56
Quote:
Originally Posted by a4z View Post
can sbog work with queue files?
t have some dependency handling
sbog (like sbopkg) does not handle dependencies.

what are you trying to do? do you want the upgrades listed with regard to dependencies?
 
Old 02-18-2018, 08:16 AM   #14
drgibbon
Senior Member
 
Registered: Nov 2014
Distribution: Slackware64 15.0
Posts: 1,221

Rep: Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943
Quote:
Originally Posted by 55020 View Post
There are plenty of updates when a fix is made to the .info file only, e.g. fixed md5sum, changed download, fixed deps.
Would the user with an already functional package really want to be notified of an update if the MD5 or download link changes? (Changed dependencies is probably legitimate though). But in terms of checking for upstream version upgrades, I do think that information should be sourced from the info files, as it seems like a fragile situation to have to parse it from SlackBuilds, where weird/unforeseen scripts might break the updater's logic.
 
Old 02-18-2018, 08:19 AM   #15
drgibbon
Senior Member
 
Registered: Nov 2014
Distribution: Slackware64 15.0
Posts: 1,221

Rep: Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943
Quote:
Originally Posted by a4z View Post
can sbog work with queue files?
t have some dependency handling
sbotools does a decent job of handling SlackBuild dependencies (sboupgrade and sboremove).
 
1 members found this post helpful.
  


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 installs "original" SlackBuild to /usr/doc/<pkg>/ instead of "local" SlackBuild drumz Slackware 29 01-20-2018 12:12 AM
[SOLVED] [Sbopkg] - sqg generates wrong queue file for "linphone" joenew Slackware 11 01-06-2018 10:09 AM
[SOLVED] Can sbopkg "see" packages tagged something different that "_SBo"? solarfields Slackware 3 07-26-2015 06:03 PM
[SOLVED] Issues installing "shutter" SBo with sbopkg tallship Slackware 2 01-28-2011 01:29 AM
[ANN] sbopkg 0.33.1 released slakmagik Slackware 6 05-27-2010 10:02 PM

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

All times are GMT -5. The time now is 02:15 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