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.