[SOLVED] Correct universal way of building/installing SBo package in batch mode?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I think you missed the origianl idea of how -B is designed for
Quote:
-B Process the packages or queues without prompting for confirmation first.
So basically you still need to decide whether you want to install a single package or from queue. If you choose queue, it will directly install based on queue without prompting, so it's already as it's designed.
sbopkg -i filezilla
Both a queuefile and a package were found with the name "filezilla".
Use (Q)ueuefile, (P)ackage, or (A)bort?: q
###########################################
New queue process started on:
Fri Apr 3 13:24:00 WIB 2020
###########################################
+++++++++++++++++++++++++++++++++++++++++++
PRE-CHECK LOG
Using the SBo repository for Slackware 14.2
Queue Process: Download, build, and install
libfilezilla:
Checking GPG for libfilezilla.tar.gz ... OK
Processing libfilezilla 0.16.0-1
Using original .info file
Using original SlackBuild file
No build options selected.
wxGTK3:
Checking GPG for wxGTK3.tar.gz ... OK
Processing wxGTK3 3.0.4-2
Using original .info file
Using original SlackBuild file
No build options selected.
filezilla:
Checking GPG for filezilla.tar.gz ... OK
Processing filezilla 3.42.1-1
Using original .info file
Using original SlackBuild file
No build options selected.
+++++++++++++++++++++++++++++++++++++++++++
Pre-check complete.
Do you wish to proceed based on the search results above? Packages not
found will be skipped during the process.
(P)roceed or (Q)uit?:
with -B:
Code:
sbopkg -B -i filezilla
Both a queuefile and a package were found with the name "filezilla".
Use (Q)ueuefile, (P)ackage, or (A)bort?: q
###########################################
New queue process started on:
Fri Apr 3 13:24:35 WIB 2020
###########################################
+++++++++++++++++++++++++++++++++++++++++++
PRE-CHECK LOG
Using the SBo repository for Slackware 14.2
Queue Process: Download, build, and install
libfilezilla:
Checking GPG for libfilezilla.tar.gz ... OK
Processing libfilezilla 0.16.0-1
Using original .info file
Using original SlackBuild file
No build options selected.
wxGTK3:
Checking GPG for wxGTK3.tar.gz ... OK
Processing wxGTK3 3.0.4-2
Using original .info file
Using original SlackBuild file
No build options selected.
filezilla:
Checking GPG for filezilla.tar.gz ... OK
Processing filezilla 3.42.1-1
Using original .info file
Using original SlackBuild file
No build options selected.
+++++++++++++++++++++++++++++++++++++++++++
Pre-check complete.
Processing libfilezilla
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?
Last edited by FlinchX; 04-03-2020 at 01:36 AM.
Reason: edit: typo
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
###########################################
New queue process started on:
Fri Apr 3 13:47:14 WIB 2020
###########################################
+++++++++++++++++++++++++++++++++++++++++++
PRE-CHECK LOG
Using the SBo repository for Slackware 14.2
Queue Process: Download, build, and install
libfilezilla:
Checking GPG for libfilezilla.tar.gz ... OK
Processing libfilezilla 0.16.0-1
Using original .info file
Using original SlackBuild file
No build options selected.
+++++++++++++++++++++++++++++++++++++++++++
Pre-check complete.
Processing libfilezilla
And this is exactly my problem, I don't want to fill any prompts manually, because this way I can't automate installing stuff with sbopkg. I'd like to be able to tell sbopkg to prefer queues or packages when it finds both with the same name, via command line argument.
-n type When there are queues and packages with same name, treat the names passed to -b/-d/-i
as of this type. Valid options are: queue, pkg. When this option is set, sbopkg
running in batch mode won't prompt for a choice.
The -n option isn't taken and there would be just one additional option to handle both cases.
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
+++ sbopkg 2020-04-04 00:00:00.000000000 +0000
@@ -4515,6 +4515,8 @@
unset ALLOW_MULTI # If set, allow more that one instance of sbopkg running
unset BUILDLIST # List of packages to build/install (from CLI)
unset PIDFILE # PID
+unset NAME_TYPE # The policy used to treat names: either queue or package
+ # (see "-n")
unset BUILD CHK_UPDATES GENSEARCH CHANGELOG OBSOLETESRC GETPKGS
unset RSYNC SEARCH UPDATE VERSION CUSTOMVER SKIP_INSTALLED VIEW_READMES
@@ -4560,7 +4562,7 @@
fi
# This is the command line options and help.
-while getopts ":b:BcD:d:e:f:g:hi:kloPpqRrs:uV:v" OPT; do
+while getopts ":b:BcD:d:e:f:g:hi:kln:oPpqRrs:uV:v" OPT; do
case $OPT in
b ) # Download, build
set_type build
@@ -4607,6 +4609,11 @@
CHANGELOG=1
unset DIAG
;;
+ n ) # How to treat names when there are both queues and packages
+ # with the same name
+ NAME_TYPE=$OPTARG
+ unset DIAG
+ ;;
o ) # Show obsolete sources
OBSOLETESRC=1
unset DIAG
@@ -4666,6 +4673,10 @@
-i pkg/queue(s) Like '-b', but also install built packages.
-k Skip installed packages when building.
-l Display the repo's ChangeLog.txt and then quit.
+ -n name_type When there are queues and packages with the same name, treat
+ the names passed to -b/-d/-i as of this type. Valid options
+ are: queue, pkg. When this option is set, sbopkg running in
+ batch mode won't prompt for a choice.
-o Display the obsolete source files & prompt for deletion.
-P List uninstalled cached package files & prompt for deletion.
-p List installed packages from active repo.
@@ -4713,6 +4724,16 @@
readonly ON_ERROR
fi
+if [[ -n $NAME_TYPE && \
+ $NAME_TYPE != queue && \
+ $NAME_TYPE != pkg ]]; then
+ echo "Unknown -n specifier -- \"$NAME_TYPE\"" >&2
+ echo "Valid values are: queue, pkg" >&2
+ exit 1
+else
+ readonly NAME_TYPE
+fi
+
# Check for a good config file and set initial variables
config_check
@@ -4796,19 +4817,27 @@
fi
if [[ -r $QUEUEDIR/$PKGBUILD.sqf ]] &&
search_package $PKGBUILD; then
- crunch_fmt "Both a queuefile and a package were found with \
- the name \"$PKGBUILD\"."
- echo
- while :; do
- read $NFLAG \
- -ep "Use (Q)ueuefile, (P)ackage, or (A)bort?: "
- case $REPLY in
- Q|q) parse_queue $QUEUEDIR/$PKGBUILD.sqf; break ;;
- P|p) parse_arguments "$PKGBUILD"; break ;;
- A|a) exit 1 ;;
- *) unknown_response ;;
- esac
- done
+ if [[ -z $NAME_TYPE ]]; then
+ crunch_fmt "Both a queuefile and a package were found with \
+ the name \"$PKGBUILD\"."
+ echo
+ while :; do
+ read $NFLAG \
+ -ep "Use (Q)ueuefile, (P)ackage, or (A)bort?: "
+ case $REPLY in
+ Q|q) parse_queue $QUEUEDIR/$PKGBUILD.sqf; break ;;
+ P|p) parse_arguments "$PKGBUILD"; break ;;
+ A|a) exit 1 ;;
+ *) unknown_response ;;
+ esac
+ done
+ else
+ if [ "$NAME_TYPE" == "queue" ]; then
+ parse_queue $QUEUEDIR/$PKGBUILD.sqf
+ elif [ "$NAME_TYPE" == "pkg" ]; then
+ parse_arguments "$PKGBUILD"
+ fi
+ fi
else
if [[ -r $QUEUEDIR/$PKGBUILD.sqf ]]; then
# Add an entire queue
I want to use sbopkg, as my example shows, perhaps I should've added that explicitly to the title.
Create a virtual machine with a pristine environment. Install slackrepo. Use slackrepo to build. Use slapt-get to install from your slackrepo virtual machine.
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.
And this is exactly my problem, I don't want to fill any prompts manually, because this way I can't automate installing stuff with sbopkg. I'd like to be able to tell sbopkg to prefer queues or packages when it finds both with the same name, via command line argument.
You can give the name of the queue file (with extension!) and sbopkg will just use the queue file directly, without prompting:
Code:
sbopkg -k -b ffmpeg.sqf
I don't know of a way to prefer the package over the queue file, however.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.