[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: method to check for package installation
From: |
Ed Brown |
Subject: |
Re: method to check for package installation |
Date: |
Wed, 28 Apr 2004 09:43:05 -0600 |
Instead of a long list of conditional shellcommands, we pass the
ALLCLASSES variable to a short perl script. The classes we define if an
rpm isn't installed begin with 'needs_', the rpm names that follow are
gathered and passed to yum. It's working well, but should, and will be
soon, rewritten as a module.
-Ed
On Wed, 2004-04-28 at 08:53, Graham Allan wrote:
> 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.
>
> G.
Re: method to check for package installation, Mark . Burgess, 2004/04/28
Re: method to check for package installation, Christian Pearce, 2004/04/28
- Re: method to check for package installation, Chip Seraphine, 2004/04/28
- Re: method to check for package installation, Christian Pearce, 2004/04/28
- Re: method to check for package installation, Chip Seraphine, 2004/04/28
- Re: method to check for package installation, Christian Pearce, 2004/04/28
- Re: method to check for package installation, wob-cfengine-help, 2004/04/29
- Re: method to check for package installation, Anne Cross, 2004/04/29