[OE-core] [PATCH] kernel: Remove unnecessary cd and rm

Darren Hart dvhart at linux.intel.com
Tue May 21 21:41:07 UTC 2013



On 05/21/2013 02:26 PM, Darren Hart wrote:
> Please include a a comment. The burden is on the submitter to prove
> the cd and the rm are unnecessary, not the reviewer.
> 
> 
> On 05/21/2013 08:39 AM, Martin Jansa wrote:
>> ---
>>  meta/classes/kernel.bbclass | 7 ++-----
>>  1 file changed, 2 insertions(+), 5 deletions(-)
>>
>> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
>> index 3320747..47a96c5 100644
>> --- a/meta/classes/kernel.bbclass
>> +++ b/meta/classes/kernel.bbclass
>> @@ -378,13 +378,10 @@ kernel_do_deploy() {
>>  		ln -sf ${MODULE_TARBALL_BASE_NAME}.bin ${MODULE_TARBALL_SYMLINK_NAME}
>>  	fi
>>  
>> -	cd ${DEPLOYDIR}
>> -	rm -f ${KERNEL_IMAGE_SYMLINK_NAME}.bin
>> -	ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${KERNEL_IMAGE_SYMLINK_NAME}.bin
>> -	ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${KERNEL_IMAGETYPE}
>> +	ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${DEPLOYDIR}/${KERNEL_IMAGE_SYMLINK_NAME}.bin
>> +	ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${DEPLOYDIR}/${KERNEL_IMAGETYPE}
> 
> So we are now in a different directory (do we know which one?) but the
> source of the ln commands doesn't change. If we are in the same
> directory, then why add DEPLOYDIR to the destination?

I suspect the answer is absolute path, but this is a good example of where
a proper comment is useful.

-- 
Darren Hart
Intel Open Source Technology Center
Yocto Project - Technical Lead - Linux Kernel



More information about the Openembedded-core mailing list