Re: [Rpm-maint] Logging rpm installation logs to file
Thanks Panu, It worked fine. Can I get this scriptlet execution output in some buffer so that I can print this information in a formatted way? I am doing something like: I will be able to print this in my already open log file if I get this scriptlet execution oultput in some buffer. - - - Thanks Virendra Sharma Panu Matilainen <[EMAIL PROTECTED]> 01/08/2008 01:13 PM To [EMAIL PROTECTED] cc rpm-maint@lists.rpm.org Subject Re: [Rpm-maint] Logging rpm installation logs to file On Mon, 7 Jan 2008, [EMAIL PROTECTED] wrote: > Hi Panu, > > With the change you suggested the error is resolved but rpmtsSetScriptFd() > is still not logging the data to file. > > LogFile.txt is created but it is empty :-( Mm.. yeah, indeed by default you get /dev/null dupped to your log :) Add rpmIncreaseVerbosity() call somewhere before executing the transaction, that should activate the logging. - Panu - ForwardSourceID:NTE7CE =-=-= Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you ___ Rpm-maint mailing list Rpm-maint@lists.rpm.org https://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] Logging rpm installation logs to file
Hi Panu, With the change you suggested the error is resolved but rpmtsSetScriptFd() is still not logging the data to file. LogFile.txt is created but it is empty :-( - - - Virendra Panu Matilainen <[EMAIL PROTECTED]> 01/07/2008 05:18 PM To [EMAIL PROTECTED] cc rpm-maint@lists.rpm.org Subject Re: [Rpm-maint] Logging rpm installation logs to file On Mon, 7 Jan 2008, [EMAIL PROTECTED] wrote: > Hi Panu, > > I've tried redirecting output using rpmtsSetScriptFd()but it is not > working. > > I've done something like this: > >> FILE *fdLogFile; >> fdLogFile = fopen("LogFile.txt", "w"); >> if (fdLogFile == NULL) >> { >> printf("Unable to open file LogFile.txt"); >> return RPM_FAILURE; >> } >> > .. > .. >> rpmtsSetScriptFd(ts, (FD_t)&fdLogFile); > .. > .. >> fclose(fdLogFile); > > > > On running this I am getting the following error: > > testRpm: ./rpmio_internal.h:525: c2f: Assertion `fd && fd->magic == > 0x04463138' failed. > Aborted FD_t is not something you can just cast to FILE, it's rpm's own io subsys type. Try something like this instead: FD_t fdLogFile; fdLogFile = Fopen("LogFile.txt", "w.fdio"); if (fdLogFile == NULL) ... rpmtsSetScriptFd(ts, fdLogFile); Fopen() and the related rpmio functions can be found in rpmio.h. - Panu - ForwardSourceID:NTE746 =-=-= Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you ___ Rpm-maint mailing list Rpm-maint@lists.rpm.org https://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] Logging rpm installation logs to file
Hi Panu, I've tried redirecting output using rpmtsSetScriptFd()but it is not working. I've done something like this: > FILE *fdLogFile; > fdLogFile = fopen("LogFile.txt", "w"); > if (fdLogFile == NULL) > { > printf("Unable to open file LogFile.txt"); > return RPM_FAILURE; > } > .. .. > rpmtsSetScriptFd(ts, (FD_t)&fdLogFile); .. .. > fclose(fdLogFile); On running this I am getting the following error: testRpm: ./rpmio_internal.h:525: c2f: Assertion `fd && fd->magic == 0x04463138' failed. Aborted Please help me out. - - - Thanks, Virendra [EMAIL PROTECTED] Panu Matilainen <[EMAIL PROTECTED]> 12/13/2007 11:23 AM To [EMAIL PROTECTED] cc rpm-maint@lists.rpm.org Subject Re: [Rpm-maint] Logging rpm installation logs to file On Wed, 12 Dec 2007, [EMAIL PROTECTED] 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.00 > %% 33.36 > %% 66.72 > ### [100%] > > %% 17.349287 > %% 20.712614 > > %% 64.926155 > %% 99.915932 > %% 100.00 > > 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 - ForwardSourceID:NTD35E =-=-= Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you ___ Rpm-maint mailing list Rpm-maint@lists.rpm.org https://lists.rpm.org/mailman/listinfo/rpm-maint
[Rpm-maint] Logging rpm installation logs to file
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.00 %% 33.36 %% 66.72 ### [100%] %% 17.349287 %% 20.712614 %% 64.926155 %% 99.915932 %% 100.00 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? - - Virendra Sharma mail: [EMAIL PROTECTED] ForwardSourceID:NTD2E6 =-=-= Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you ___ Rpm-maint mailing list Rpm-maint@lists.rpm.org https://lists.rpm.org/mailman/listinfo/rpm-maint