Re: rpm exit codes

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

 



On 7/18/05, Ken Millett <KMILLETT@xxxxxxxxxx> wrote:
> In fact, my original question was that I have a separate install script
> that executes rpm to install a specific rpm and I wanted to be able to
> determine from the exit code that rpm itself returned why the install of
> the specific rpm failed, much like Matt described.  Apparently, rpm does
> not return a reason why the install failed, but only that it failed.
> Too bad, it would have been nice to determine the cause of the failure
> and perhaps fix the problem or at least tell the user why it failed.
> 
Ken, what you really want to do (OK, to achieve your goal need to do)
is use the Python binding for rpm or the C bindings to get to the
problem set that is available from the transaction after it fails. 
This will really give you the proper clues as to what has really
transpired.  There are perl bindings for running a transaction through
rpm, but I did not expose the problem set (probably not hard, just
haven't looked at that in a while).

The bottom line is your not going to get back from the exit code
anything but the message that "the transaction failed for one reason
or another", because you can still have failures that happen before
packages get installed (deps, space, etc.).

Cheers...james
> >>> mattdm@xxxxxxxxxx 7/18/2005 2:40:27 PM >>>
> On Mon, Jul 18, 2005 at 10:28:56PM +0200, Tony Earnshaw wrote:
> > > > Normal shell scripting.
> > > What do you mean by that?
> > The whole %install routine gives access to a shell environment. You
> have
> > complete access to the shell error codes and can test for whatever
> OP
> > wants.
> 
> One of us is misunderstanding the original question. I think it's you,
> but I
> could be wrong. :)
> 
> I believe the question was about the exit codes of *rpm itself*, and
> the
> "install script" in question is a script that calls the rpm command
> line
> program, not the "%install" section in the RPM.
> 
> 
> --
> Matthew Miller           mattdm@xxxxxxxxxx
> <http://www.mattdm.org/>
> Boston University Linux      ------>
> <http://linux.bu.edu/>
> Current office temperature: 80 degrees Fahrenheit.
> 
> _______________________________________________
> Rpm-list mailing list
> Rpm-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/rpm-list
> 
> _______________________________________________
> Rpm-list mailing list
> Rpm-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/rpm-list
>


[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux