[SOLVED] Is it possible to run sbopkg with -s or -g option as restricted user?
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.
Is it possible to run sbopkg with -s or -g option as restricted user?
When I search for a software that I want to test or that i need my first look is if it is in the SlackBuild repositories. I use
Code:
sbopkg -g NAME-OF-SOFTWARE
for this. I never use the -s option, but I think my question can be extended to that option (and may be any other option that doesn't change things on the system).
What really annoys me is that I have to become root only to search for a package. I understand that root privileges are needed for installing (and sometimes building) the packages, but why do I need to be root to search in the database?
Is there a workaround for this behavior or do I have to make a feature request?
I know that SlackBuilds need to be run as root.I don't want to run them as restricted user. But I don't see any reason to be root just to do a search in the database or use sbopkg with any other option that does not change anything on the system.
I can for example use slackpkg to search for packages without being root, but need to be root to install/remove/upgrade packages.
or go write it yourself. I honestly can't see any benefit to running sbopkg as a normal user, as it's whole point is making it easier to handle slackbuild scripts... that require you to run as root.
Searching in sbopkg's package database is not an administrative task. I can't see the point in doing non-administrative tasks as root, besides that it would just be more convenient.
But let's not argue about that. I will mark this thread as solved and have a look if I can make a feature request.
you can also search packages names faking sbopkg behaviour (eh, maybe I'm making it too simple ) with a bash script, like this:
it looks for the first argument and you can specify a REPO variable on the command line
Code:
#!/usr/bin/bash
REPO=${REPO:-SBo/13.37}
echo "Searching for $1"
echo "Found the following matches for $1:"
ls -1 /var/lib/sbopkg/$REPO/*/*/*.info | grep $1 | cut -d/ -f7,8
EDIT: I refined it a little: now it gets the variables it needs directly from sbopkg.conf
Code:
#!/usr/bin/bash
. /etc/sbopkg/sbopkg.conf
echo "Searching for $1"
echo "Found the following matches for $1:"
if [ "$(grep $REPO_NAME /etc/sbopkg/repos.d/* | grep $REPO_BRANCH | grep git\:)" ]; then
ls -1 $REPO_ROOT/$REPO_NAME/*/*/*.info | grep $1 | cut -d/ -f6,7
else
ls -1 $REPO_ROOT/$REPO_NAME/$REPO_BRANCH/*/*/*.info | grep $1 | cut -d/ -f7,8
fi
Last edited by ponce; 04-10-2012 at 01:24 PM.
Reason: new version
Yeah, of course, instead of typing su - I launch the browser, surf to SlackBuilds.org and type in the software I am searching for. Very convenient:
that's not completly true: actually, if you got a network connection (but you need it for sbopkg) you can do in a single command (script that uses links/lynx?) also that
works only with slackbuilds.org (thanks go to SBo coders) but the result is much more informative (it searches in the tags too), browsable and maybe also faster
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.