LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Correct universal way of building/installing SBo package in batch mode? (https://www.linuxquestions.org/questions/slackware-14/correct-universal-way-of-building-installing-sbo-package-in-batch-mode-4175672375/)

FlinchX 04-01-2020 05:29 PM

Correct universal way of building/installing SBo package in batch mode?
 
I am trying to avoid doing sqg -a for the whole SBo repository, because it's time consuming.

Some packages have dependencies, others don't.

My goal is to install a single package in batch mode, so my input data is an "APPNAME" string.

Do I just need to do

Code:

sqg -p APPNAME
sbopkg -i APPNAME

and it'll be smart enough to generate the queue if there are dependencies, then use the queue rather than the package name if there's one?

Richard Cranium 04-01-2020 07:45 PM

Use slapt-get to install, if that's what you want.

montagdude 04-01-2020 08:34 PM

There's no universal way. There are different tools that have different methods.

FlinchX 04-02-2020 01:09 AM

I want to use sbopkg, as my example shows, perhaps I should've added that explicitly to the title.

giomat 04-02-2020 03:47 AM

if you pass to sqg a package with no dependencies it will simply print a complaint that the queue file is empty.
If a queue is generated, then building with "sbopkg -i" will ask you if you want to use the queue or just build and install the package.
Anyway queue files are really just simple plain text files where every line contains the name of a package to build, so it's
really easy to modify the existing ones or roll your own if you want to add some optional dependency to a package.
Queue files are stored in /var/lib/sbopkg/queues,

FlinchX 04-02-2020 03:57 AM

Quote:

Originally Posted by giomat (Post 6106931)
if you pass to sqg a package with no dependencies it will simply print a complaint that the queue file is empty.
If a queue is generated, then building with "sbopkg -i" will ask you if you want to use the queue or just build and install the package.

So, I can just do sqg -p APP for anything I want to install, then do sbopkg -B -i APP and it will pick the queue if there is one in QUEUEDIR, otherwise it'll treat APP as packagename and will do everything without asking anything interactively?

giomat 04-02-2020 04:36 AM

Quote:

Originally Posted by FlinchX (Post 6106935)
So, I can just do sqg -p APP for anything I want to install, then do sbopkg -B -i APP and it will pick the queue if there is one in QUEUEDIR, otherwise it'll treat APP as packagename and will do everything without asking anything interactively?

well regarding this last bit, by default sbopkg will ask you explicitly if you want to build everything or just the package, because it will find both a queue file (.sqf) and an sbo package having the same name. I'm not sure but perhaps passing the -B option will force sbopkg to always prefer the queue file if found. If it doesn't, then perhaps you could ask the sbopkg developer to add a new flag for your use case.

bassmadrigal 04-02-2020 11:10 AM

As far as I know, there is no feature in sbopkg to automatically choose the queuefile. Adding -B will still ask if you want to process the queue or program.

For what it's worth, there has been an update to sqg (that hasn't been pushed out to a released package yet and likely won't until 15.0 is released) allowing you to generate a custom queuefile name. This would allow you to do something like below, which would allow you to specify a custom name for your queue and then run sbopkg -i against that custom name, and there will only be the queuefile to use, so -B should then work.

Code:

sqg -p $PRGNAM -o $PRGNAM-q
sbopkg -B -i $PRGNAM-q

Unfortunately, you can't just grab the latest since there's been a lot of changes to deal with the package database being moved from /var/log/packages/ to /var/lib/pkgtools/packages/ and it won't work on 14.2. Plus, this is just a hack to get what you want done and doesn't allow you to prefer the queuefile or package automatically. It may not be a bad idea to request a new option (or two) to prefer either the queuefile or package automatically when building.

FlinchX 04-02-2020 04:28 PM

Quote:

As far as I know, there is no feature in sbopkg to automatically choose the queuefile. Adding -B will still ask if you want to process the queue or program.
I have just tested and indeed, this is what sbopkg-0.38.1 does.

Quote:

there has been an update to sqg (that hasn't been pushed out to a released package yet and likely won't until 15.0 is released) allowing you to generate a custom queuefile name
Indeed, another way to get rid of the interactive prompt would be a command line switch to use the queue when there's both a queue and a package.

bassmadrigal 04-02-2020 05:04 PM

Quote:

Originally Posted by FlinchX (Post 6107177)
Indeed, another way to get rid of the interactive prompt would be a command line switch to use the queue when there's both a queue and a package.

I did have a look at the sbopkg script earlier, and it shouldn't be too hard to add an option to prefer the queue or package, but what I would expect the preferred options to be were already taken. -p and -q are both used for other features. -P is also used, but -Q is available. If you have any suggestions on what letters could be used, let me know and I might be able to throw together a patch and submit a pull request to Willy for it over the weekend. I'd also be able to supply a patch for the sbopkg script that is used for 14.2 (since the pull request would be based on the one used for -current and may not work for our version).

FlinchX 04-02-2020 05:40 PM

I think -Q as in "use the queue when there's both a queue and a package" makes sense.

So far the "prefer package when there's both queue and package" scenario escapes me, I can't think of a situation when this can be useful. It's either "use package" when a package has no dependencies (even if using sqg then, no queue would be generated) or "use queue" when there's both, because a package has dependencies and a queue was generated for it.

Quote:

I'd also be able to supply a patch for the sbopkg script that is used for 14.2
Having a new sbopkg release with such a feature that works with 14.2 would be great, because I'm using 14.2 as playground (didn't get to fiddle with -current yet).

bassmadrigal 04-02-2020 06:10 PM

Quote:

Originally Posted by FlinchX (Post 6107197)
So far the "prefer package when there's both queue and package" scenario escapes me, I can't think of a situation when this can be useful. It's either "use package" when a package has no dependencies (even if using sqg then, no queue would be generated) or "use queue" when there's both, because a package has dependencies and a queue was generated for it.

What if you had created a queue for ffmpeg and built all the packages for it and now you need to rebuild just ffmpeg? You would either need to remove the ffmpeg.sqf file or couldn't run sbopkg without needing to enter 'p' for package.

This could happen if a package has a lot of dependencies and if that package happens to be updated, you may not need to rebuild all the dependencies (especially if it contains something like qt5).

I'm not sure how often I would need to automate sbopkg to even need to specify to use the queue or package, but it would be nice to support both scenarios if we're already supporting one.

FlinchX 04-02-2020 06:25 PM

Now I see what you mean.

Perhaps a sbopkg developer could share some wisdom about the design choices that were made in the beginning. As in, why certain sbopkg options were implemented to accept both packages/queues.

bassmadrigal 04-02-2020 06:59 PM

Quote:

Originally Posted by FlinchX (Post 6107208)
Now I see what you mean.

Perhaps a sbopkg developer could share some wisdom about the design choices that were made in the beginning. As in, why certain sbopkg options were implemented to accept both packages/queues.

As far as I know, forum member (and SBo admin) willysr is the active developer of sbopkg right now, but I don't know if he is one of the creators or just who is maintaining it now.

willysr 04-02-2020 07:51 PM

I'm just maintaining it. The original author is Chess Griffin, Slakmagik, and Mauro


All times are GMT -5. The time now is 05:20 AM.