LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   sqg - sbopkg queuefile generator (https://www.linuxquestions.org/questions/slackware-14/sqg-sbopkg-queuefile-generator-4175451646/)

TobiSGD 02-28-2013 11:38 PM

Quote:

Originally Posted by chess (Post 4902094)
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).

ponce 02-28-2013 11:53 PM

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 ;) )

TobiSGD 03-01-2013 06:41 AM

Quote:

Originally Posted by ponce (Post 4902142)
( 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.

ponce 03-01-2013 07:02 AM

about that if you grep -i for "dependenc" on the READMEs you can have a general idea, I think: dependencies that are not optional shouldn't be listed there.

chess 03-01-2013 08:25 AM

Quote:

Originally Posted by TobiSGD (Post 4902133)
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.

allenlinux 12-29-2014 09:31 PM

sqg: command not found

bassmadrigal 12-30-2014 01:55 AM

Quote:

Originally Posted by allenlinux (Post 5292312)
sqg: command not found

As I stated in your other thread, it is located under /usr/doc/sbopkg-0.37.0/contrib/

Richard Cranium 12-30-2014 03:31 AM

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...
Code:

declare -A packages

init_package_array () {
      cd $REPO_DIR
      for i in $(find -type d -mindepth 2 -maxdepth 2 ); do
          packages[$(basename $i)]=$i
      done
}

search_package () {
    local SRCHAPP="$1"

    if [ ${packages[$SRCHAPP]+_} ]; then
        PKGPATH=${packages[$SRCHAPP]}
        return 0
    else
        PKGPATH=""
        return 1
    fi
}

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.)


All times are GMT -5. The time now is 09:28 AM.