[OE-core] [PATCH] rootfs_rpm: Escape the backtick to ensure the ls runs on the target

Saul Wold sgw at linux.intel.com
Wed Jan 30 18:35:23 UTC 2013


On 01/30/2013 02:13 AM, Enrico Scholz wrote:
> Saul Wold <sgw-VuQAYsv1563Yd54FQh9/CA at public.gmane.org> writes:
>
>> This change ensures that the ls /etc/rpm-postinsts runs in the target
>> at first boot time, rather than at the creation time of the script on
>> the host.
>> ...
>> -for i in `ls /etc/rpm-postinsts/`; do
>> +for i in \`ls /etc/rpm-postinsts/\`; do
>>   	i=/etc/rpm-postinsts/$i
>>   	echo "Running postinst $i..."
>
> are you really sure, this is enough? $i gets probably expanded too.  A
> better way than to escape all and everything is to quote the EOF marker.
>
Yes, I verified the out put in the S98run-postinsts script that is on 
disk and it's correct.

There a line above that sets i=\$i so the expansion occurs back to $i!

Sau!

> E.g. compare
>
> i=abc
>
> cat << "EOF"
> echo $i
> EOF
>
> cat << EOF
> echo $i
> EOF
>
>
> Enrico
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
>




More information about the Openembedded-core mailing list