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 |
Use slapt-get to install, if that's what you want.
|
There's no universal way. There are different tools that have different methods.
|
I want to use sbopkg, as my example shows, perhaps I should've added that explicitly to the title.
|
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, |
Quote:
|
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.
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 |
Quote:
Quote:
|
Quote:
|
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:
|
Quote:
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. |
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. |
Quote:
|
I'm just maintaining it. The original author is Chess Griffin, Slakmagik, and Mauro
|
I have submitted a formal issue on github regarding this https://github.com/sbopkg/sbopkg/issues/60
|
I think you missed the origianl idea of how -B is designed for
Quote:
|
Here's what i mean
without -B: Code:
sbopkg -i filezilla Code:
sbopkg -B -i filezilla |
We're having the discussion split between LQ and GitHub, but since you closed the issue there, I'll provide a more detailed answer here.
I'm not contesting how -B works. The problem is that in your example `sbopkg -B -i filezilla`, sbopkg still stops prompting the user for interactive input. Am I missing some less obvious way to make sbopkg fully non-interactive in this situation, for automation purposes? |
It still give prompt since it gives the users an option to use queue or directly use a package
if the package doesn't have a queue, it will directly install the package without asking Code:
sbopkg -B -i libfilezilla |
Quote:
|
Feel free to send a PR
|
@bassmadrigal
What about something like Code:
-n type When there are queues and packages with same name, treat the names passed to -b/-d/-i |
This is what I have so far.
Note that this is a patch against 0.38.1, not against the latest git master. As I said above, I'm not using -current, so I don't have a sandbox to test that scenario. I did a couple of tests in 14.2 and it kind of works, but I'm a shell scripting noob, so feedback is necessary. @bassmadrigal : if you are attempting to do the same and are planning to provide patches for both 14.2 and -current, you are welcome to use the code. Code:
--- sbopkg.orig 2016-09-01 16:45:16.000000000 +0000 |
Quote:
I'm doing exactly that with -current for the one laptop I've got running -current. I've got an actual piece of hardware running a stock Slackware64 14.2 image that does the same for my other machines; I've got the extra hardware, which is why I'm using it for 14.2. If using sbopkg on a machine with other stuff installed floats your boat, I'm not going to try to stop you. |
Another trouble I'm running into: at first startup, sbopkg asks interactively to create some missing dirs. I can't find any command line argument that will create those missing directories and exit without asking anything.
|
it's a variable that you can export via the command line or set directly to "NO" in /etc/sbopkg/sbopkg.conf
Code:
MKDIR_PROMPT=${MKDIR_PROMPT:-NO} |
Thanks ponce, i set those NO by default now, so directory will be created automatically for future release of sbopkg
|
Quote:
Code:
sbopkg -k -b ffmpeg.sqf |
Quote:
|
Code:
sbopkg -h |
I gave it some more thought and now I'm not even sure if I should use the patch that I attached a few posts above. Since it's possible to explicitly tell sbopkg to use a queue by using APPNAME.sqf rather than APPNAME, as @drumz pointed above, then I assume it's also possible to tell sbopkg to use the APPNAME as package, by making sure that there's no queue with the same name as well. This can be done by explicitly removing the queue with the same name if it exists, since generating it again later if needed is not a resource hog. Not having a queue also removes the ambiguous scenario when there's both a package and a queue with the same name.
So: 1. If I want to use APPNAME as queue, I should explicitly pass APPNAME.sqf (generate it if needed) to sbopkg 2. If I want to use APPNAME as package, I should remove APPNAME.sqf if it exists, before passing APPNAME to sbopkg This would allow to use sbopkg as it is now without the patch applied. This would make sure sbookg will never ask me to use the package or the queue, since I'm explicitly telling it to use the queue when I need that. And this would make sure that whenever I need sbopkg to run the package, I'll never run into ambiguity either, since I'm making sure there's no queue with same name. Did I get it right this time? |
So basically sbopkg will find APPNAME according to the repository and queue based on what's inside queue directory. In the latest sbopkg (in git master), it has an ability to generate custom queue and install it from that custom queue.
I just made a custom queue for virt-manager last night and install it as virt-manager_current.sqf in /var/lib/sbopkg/queue and i can install it using sbopkg -i virt-manager_current |
All times are GMT -5. The time now is 02:18 PM. |