Modify The Sbotools To Download The Needed Tree Only
Sbotools is a very handy tool to manage Slackbuilds.org packages in your Slackware system. It can download, install, upgrade, check for available updates, and also resolve the dependencies. As I wrote in my previous post about Automate Your Slackbuild Using Sbotools, Sbotools need you to pull the whole Slackbuilds tree from Slackbuild.org first or everytime you want to upgrade the packages from Slackbuilds.org. Yes, the whole tree will be pulled into your local file system although you just want to install some packages only. That made me think why not just pull the files that we need to install only? I don't need to install the others if I don't need them so why should I download them all. Besides that, it will save the time, space in the harddisk, and also the internet bandwidth.
Based on that idea, I start to modify the Sbotools 1.9 code. With this modification, we need to download only one file, the SLACKBUILDS.TXT.gz, which is only around 500 KB, not the whole tree. That SLACKBUILDS.TXT file contains enough information about all the packages available in Slackbuilds.org, so I will use it as the database for searching, installing, upgrading, checking available updates, and also resolving the dependencies.
The modified Sbotools source is available in the attachment below. The attachment contains all the Sbotools files, but in fact I only made the modification in the following files.
- SBO-Lib/lib/SBO/Lib.pm
- sbocheck
- sbofind
- sboinstall
- sboupgrade
If you has Sbotools installed already, you might need to replace the following files with the files I mention above.
- /usr/share/Perl5/SBO/Lib.pm
- /usr/sbin/sbocheck
- /usr/sbin/sbofind
- /usr/sbin/sboinstall
- /usr/sbin/sboupgrade
To see the clearer difference between the original Sbotools 1.9 code and my modification, I also provide the patch file, which is generated using git, in the attachment below.
Please note that I only test this modification for Sbotools 1.9. I can't guarantee that this modification can work with the other version of Sbotools.
Attachment | Size |
---|---|
The modified code based on Sbotools 1.9. | 47.98 KB |
The patch file to see what is changed from the original code. | 8.21 KB |
Add new comment