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.

Introduction to Linux - A Hands on Guide

This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.

Slight tweak to the script to skip packages with an empty REQUIRES= line unless a new SKIP_EMPTY variable is uncommented. Probably makes no sense to create queuefiles for packages with no dependencies in most cases.

Unless you want to have a queuefile for customized options, for example the p7zip package, which has optional dependencies if you want to build it with GUI=yes option, but has an empty REQUIRES field (therefore my previous post that parsing the %README% not really makes sense unless all script maintainers actually use it).

just to clarify: the %README% entry in REQUIRES means that, according to the maintainer, it's *mandatory* having a look at the README before building for successful compilation or for having a working package after, like:
- creation of additional users/groups;
- some important options you need to choose between before building;
- steps to take before building;
- steps to take after package installation;
- whatever more;

( leaving aside that one should be supposed to have a look at READMEs of the stuff he builds from SBo anyways )

( leaving aside that one should be supposed to have a look at READMEs of the stuff he builds from SBo anyways )

True, but as you can see in the case of p7zip skipping packages with an empty REQUIRES field is not always the correct option. I can't see any disadvantages in having queuefiles that contain only the package name, I would think that it is more of a disadvantage to not being able to determine packages that have optional dependencies, especially if you want to build a whole bunch (or all) queue-files at once.
A simple boolean flag in the .info-file, like OPTIONAL="TRUE||FALSE" would make it much easier in these cases where you for sure won't read all 3000+ READMEs, but can do a simple grep over all .info files to become aware of which packages need special attention.

To be honest, some time ago I tried to write something similar (though my attempts were lot less elegant), but the issue of not being able to determine reliably if a package has optional dependencies (which really matters for queue-files) and the reluctance of most maintainers when it comes to changes (see discussions on the SBo mailing list) put me down on that and I have given up before even asking for something like that.

Unless you want to have a queuefile for customized options, for example the p7zip package, which has optional dependencies if you want to build it with GUI=yes option, but has an empty REQUIRES field (therefore my previous post that parsing the %README% not really makes sense unless all script maintainers actually use it).

Yep, which is why I made it so you can uncomment SKIP_EMPTY and those queuefiles will be created so you can have it both ways. :-) Plus, if the REQUIRES is empty except for the %README% then the queuefile will still be created even if SKIP_EMPTY is left commented. In other words, the default action is to skip packages where the REQUIRES is truly empty. If there is anything in the REQUIRES (include %README%) then a queuefile will be created. Again, this can be changed by uncommenting SKIP_EMPTY in which case all queuefiles will be created.

If you are using the -a option, there are some things that can be done to speed things up...

The quickest fix is to use the @package_name option instead of recursively processing the package.

The more involved fix would be to read all the package names into an associative array (bash 4 supports that) so you don't have to hit the file system in the search_package function. The code looks an awful lot like...

Just call init_package_array before calling main_loop. There's a long delay when init_package_array runs, so it would not make sense to run that for a single package.

It should be possible to use the tsort command to create an ordered list of everything, but that's overkill given the way that sbopkg works. (On the other hand, it would be nice if sbopkg would order the packages correctly when upgrading packages and tsort could possibly help.)