]> code.ossystems Code Review - openembedded-core.git/commit
utils: Reduce the number of calls to the "dirname" command
authorOleksandr Popovych <opopovyc@cisco.com>
Fri, 20 Aug 2021 12:41:43 +0000 (05:41 -0700)
committerAnuj Mittal <anuj.mittal@intel.com>
Wed, 25 Aug 2021 02:44:50 +0000 (10:44 +0800)
commit33ebb967a9489384c2407e7e3211f8bfca7c3916
treea5a8651fdd4078b13ab2bbf61bafb2318dcce0af
parent1a9addac9b78eac9a0183145792f4f293d4143bb
utils: Reduce the number of calls to the "dirname" command

utils.bbclass contains create_cmdline_wrapper() function that
creates wrapper script with additional arguments for any passed
"$cmd" command, and uses several calls to "dirname".

Because "dirname" is an external command, in cases of lots of
calls to wrapped "$cmd", each call of "dirname" will incur
significant overhead.

There are three same calls to "dirname": one for saving it`s
output to "realdir" variable, and other two in "exec" command.
So last two "dirname" calls can be replaced with cached value
from "realdir" variable.

Signed-off-by: Oleksandr Popovych <opopovyc@cisco.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 4b9cf2c80fd14386e0b88a2e6c40a9fa3f1ae0f7)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
meta/classes/utils.bbclass