[Rpm-maint] Logging rpm installation logs to file

Panu Matilainen pmatilai at redhat.com
Thu Dec 13 05:53:59 UTC 2007


On Wed, 12 Dec 2007, viren.sharma at tcs.com wrote:

> Hi all,
>
> I am trying to use rpmts library for installing RPMs.
> But I am facing a problem in creating logs of information which we get
> while installing a RPM package.
>
> When I install a RPM package, I get the following logs on STDOUT.
>
> Preparing...                %% 0.000000
> %% 33.333336
> %% 66.666672
> ########################################### [100%]
> XXXX YYYY ZZZZ
> %% 17.349287
> %% 20.712614
> XXXX YYYY ZZZZ
> %% 64.926155
> %% 99.915932
> %% 100.000000
>
> I think this is the output from the rpm scriptlets which are run as part
> of any install.
>
> I want to capture this information and log it to a file.
> But I am unable to find such a function in RPM library which does this
> job.  : -(
>
> Can anyone please suggest some mechanism to do this?

You can redirect the scriptlet execution output to arbitrary file with 
rpmtsSetScriptFd().

 	- Panu -



More information about the Rpm-maint mailing list