Re: Using yum within a program

seth vidal <[email protected]>
Newsgroups gmane.linux.rpm.yum
Message-ID <1184210103.3738.1.camel@cutter>
On Wed, 2007-07-11 at 16:31 -0400, Teresa Thomas wrote:
> Hi, 
> 
> When a certain event happens in my program (written in JAVA), I want
> to install a package onto the system. I was looking into
> java.lang.Runtime's exec() function which can be used to execute
> command(s) as a separate process. But this becomes tricky in some
> cases. For example, when the user is not logged in as root, yum
> requires authentication and this involves using buffered readers for
> command outputs and inputs.

yum isn't asking for the root pw - something else is doing this for yum.
Additionally, yum does allow for non-interactive processes - look at the
-y option.



> The project I am working on has both command line and GUI components,
> so a solution compatible/extensible with both would be the best.
> Thanks in advance for any help.

It might be a good idea to step back and figure out why you're trying to
do this and if there is a better way around it.

-sv
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.