Re: How to determine whether yum have changed something from a script

Matthew Miller <[email protected]>
Newsgroups gmane.linux.rpm.yum
Message-ID <[email protected]>
On Fri, Nov 23, 2007 at 05:15:27PM +0700, Fajar A. Nugraha wrote:
> Here's the case. I need to create a script which basically runs yum -y
> update, and after runs another script whose action depends on what yum did.
> yum errors can be checked from the return code, but it seems that a
> successful update and no update at all returns the same return code : 0.
> Is there a scriptable-way to test whether yum did anything, other than
> grepping the string "No Packages marked for Update" from yum output?

Run 'yum check-update' first and check its exit code first. Then you'll be
able to distinguish between these two cases.


-- 
Matthew Miller           [email protected]          <http://mattdm.org/>
Boston University Linux      ------>              <http://linux.bu.edu/>
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.