Openembedded Core Discussions
 help / color / mirror / Atom feed
From: ChenQi <Qi.Chen@windriver.com>
To: Saul Wold <sgw@linux.intel.com>
Cc: qingtao.cao@windriver.com, openembedded-core@lists.openembedded.org
Subject: Re: [PATCH V2 4/4] rpm-postinsts.bb: enable postinst logging
Date: Tue, 21 May 2013 10:27:48 +0800	[thread overview]
Message-ID: <519ADBA4.1010009@windriver.com> (raw)
In-Reply-To: <519A4359.2090205@linux.intel.com>

On 05/20/2013 11:38 PM, Saul Wold wrote:
> On 05/19/2013 07:50 PM, Qi.Chen@windriver.com wrote:
>> From: Chen Qi <Qi.Chen@windriver.com>
>>
>> Enable postinst logging by checking the configuration in /etc/
>> default/postinst.
>>
>> In this way, the postinst logging is enabled if 'debug-tweaks' is
>> in IMAGE_FEATURES, and at the same time, we avoid unnecessary rebuild
>> if IMAGE_FEATURES is changed.
>>
>> [YOCTO #4262]
>>
>> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
>> ---
>>   meta/recipes-devtools/rpm/rpm-postinsts.bb |   13 +++++++------
>>   1 file changed, 7 insertions(+), 6 deletions(-)
>>
>> diff --git a/meta/recipes-devtools/rpm/rpm-postinsts.bb 
>> b/meta/recipes-devtools/rpm/rpm-postinsts.bb
>> index 3d2d05d..01d7450 100644
>> --- a/meta/recipes-devtools/rpm/rpm-postinsts.bb
>> +++ b/meta/recipes-devtools/rpm/rpm-postinsts.bb
>> @@ -11,10 +11,6 @@ inherit allarch
>>   #
>>   POSTINSTALL_INITPOSITION ?= "98"
>>
>> -POSTLOG ?= "/var/log/postinstall.log"
>> -REDIRECT_CMD = "${@base_contains('IMAGE_FEATURES', 'debug-tweaks', 
>> '>>${POSTLOG} 2>&1', '', d)}"
>> -REDIRECT_CMD[vardepsexclude] += "IMAGE_FEATURES POSTLOG"
>> -
>>   do_fetch() {
>>       :
>>   }
>> @@ -36,11 +32,16 @@ if [ "x$D" != "x" ] && [ -f 
>> $D/var/lib/rpm/Packages ]; then
>>       install -d $D/${sysconfdir}/rcS.d
>>       cat > 
>> $D${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts << "EOF"
>>   #!/bin/sh
>> -
>> +[ -e /etc/default/postinst ] && . /etc/default/postinst
>>   [ -d /etc/rpm-postinsts ] && for i in `ls /etc/rpm-postinsts/`; do
>>       i=/etc/rpm-postinsts/$i
>>       echo "Running postinst $i..."
>> -    if [ -f $i ] && $i ${REDIRECT_CMD}; then
>> +    if [ -x $i ]; then
>> +        if [ "$POSTINST_LOGGING" = "ENABLED" ]; then
>> +            $i >/var/log/postinstall.log 2&>1
>
> This will over write the results of a previous postinstall because 
> this is running in a for look, you should use >> instead of >.
>
> I also suggested that the log file be a variable and you should use 
> the ${localestatedir} as the base for /var.  So you would add 
> something like POSTINST_LOGFILE.
>
> Thanks
>     Sau!
>
>
Thanks for pointing the error out.

I'll fix it and send out a V3 soon.

Best Regards,
Chen Qi
>
>> +        else
>> +            $i
>> +        fi
>>           rm $i
>>       else
>>           echo "ERROR: postinst $i failed."
>>
>
>



      reply	other threads:[~2013-05-21  2:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-20  2:50 [PATCH V2 0/4] Postinst logging reimplementation Qi.Chen
2013-05-20  2:50 ` [PATCH V2 1/4] image.bbclass: add postinst_enable_logging Qi.Chen
2013-05-20  2:50 ` [PATCH V2 2/4] dpkg: modify the run-postinst script to enable postinst logging Qi.Chen
2013-05-20 16:09   ` Paul Eggleton
2013-05-21  2:25     ` ChenQi
2013-05-20  2:50 ` [PATCH V2 3/4] opkg: " Qi.Chen
2013-05-20  2:50 ` [PATCH V2 4/4] rpm-postinsts.bb: " Qi.Chen
2013-05-20 15:38   ` Saul Wold
2013-05-21  2:27     ` ChenQi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=519ADBA4.1010009@windriver.com \
    --to=qi.chen@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=qingtao.cao@windriver.com \
    --cc=sgw@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox