[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: method to check for package installation

From: Graham Allan
Subject: Re: method to check for package installation
Date: Wed, 28 Apr 2004 09:53:18 -0500
User-agent: Mutt/

On Wed, Apr 28, 2004 at 11:23:06AM +1000, Tim Nelson wrote:
> On Tue, 27 Apr 2004, Graham Allan wrote:
> > I'm trying to write a method file to check if a particular RPM package
> > is installed, and if not, install it.
>       Is there some particular reason you aren't using RPM's built-in 
> functionality?  rpm -i and rpm -U both do this.  

Mainly because we use yum to perform the actual installations (rpm by
itself doesn't handle dependencies well enough).

So the desired sequesnce is to determine if a package is installed, and
if not, run "yum -y install packagename".

This has been working for a while with hard-coded lists of package
names, but aesthetically, it's not so great - the script has one long
list of class definitions to test for packages, then another long list
of conditional shellcommands. The test and the action are too widely
separated for good readability.

The idea was to try and move the test/shellcommand into a method so the
main script can simply have a list of one-line "test and install"
method calls.

Graham Allan
School of Physics and Astronomy - University of Minnesota

reply via email to

[Prev in Thread] Current Thread [Next in Thread]