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

Re: RPM difference between -I and -U



This is the easiest way. I chose bind as my example RPM, but obviously you need to change it to yours....

if [ `rpm -q bfind 2>/dev/null | wc -l` -gt 0 ] ; then echo "already exists" ; else echo "new install" ; fi

Obviously you can replace the two echo statements with your rpm commands and anything else you want to do.


Robin


At 11:16 AM 29/01/02 -0500, you wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

OK, here's our problem.  We have a software package installed at some
customers sites.  We send them new releases every now and then.  During the
setup for the new release we need to do:

if (this is an upgrade)
        Do some stuff
elseif (this is a new install)
        Do some other stuff
endif

How can I do this with RPM.  $1 is always 1, because the package name is the
same when we do a new relase, the versions just change.  How can I do this?
Can we tell if RPM was called with -I or -U, or is there a better way?

Mike.
- --
*********************************
* Mike Baranski                 *
* Security Managment Consulting *
* 919-788-9200 Phone            *
* 919-510-0037 Fax              *
* mike@secmgmt.com              *
*********************************

GPG Key located on:
http://www.keyserver.net/en/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8VsrFn0XmoxBj3PwRAhkJAJ46iXmmsWtzl+4cRKregehooa4fCgCcDmy9
50U4ld1cqQsAmpA9oMyxfOE=
=TiuO
-----END PGP SIGNATURE-----



_______________________________________________
Rpm-list mailing list
Rpm-list@redhat.com
https://listman.redhat.com/mailman/listinfo/rpm-list





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