Patchwork [1/1] oe/path.py: call /bin/cp directly

login
register
mail settings
Submitter wenzong.fan@windriver.com
Date Aug. 13, 2013, 7:09 a.m.
Message ID <27b0ee9bd74b6c95c3ddd11b673a56d8543cd5d6.1376377523.git.wenzong.fan@windriver.com>
Download mbox | patch
Permalink /patch/55511/
State New
Headers show

Comments

wenzong.fan@windriver.com - Aug. 13, 2013, 7:09 a.m.
From: Wenzong Fan <wenzong.fan@windriver.com>

This avoids running cp with interactive mode if defined:

    alias cp='cp -i'

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
---
 meta/lib/oe/path.py |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Saul Wold - Aug. 16, 2013, 5:11 p.m.
On 08/13/2013 12:09 AM, wenzong.fan@windriver.com wrote:
> From: Wenzong Fan <wenzong.fan@windriver.com>
>
> This avoids running cp with interactive mode if defined:
>
>      alias cp='cp -i'
>
> Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
> ---
>   meta/lib/oe/path.py |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py
> index da044ba..6933977 100644
> --- a/meta/lib/oe/path.py
> +++ b/meta/lib/oe/path.py
> @@ -97,7 +97,7 @@ def copyhardlinktree(src, dst):
>           check_output(cmd, shell=True, stderr=subprocess.STDOUT)
>           if os.path.isdir(src):
>               src = src + "/*"
> -        cmd = 'cp -afl %s %s' % (src, dst)
> +        cmd = '/bin/cp -afl %s %s' % (src, dst)

As Richard points out in the Consolidated Pull, this is the wrong way to 
go about this, there are possibly other places that will have similar 
issues and we can't fix then all this way.

A better solution is to add a sanity check and suggest that the user 
needs to fix their environment to ensure the build will succeed.

Sau!
>           check_output(cmd, shell=True, stderr=subprocess.STDOUT)
>       else:
>           copytree(src, dst)
>
wenzong.fan@windriver.com - Aug. 19, 2013, 2:07 a.m.
On 08/17/2013 01:11 AM, Saul Wold wrote:
> On 08/13/2013 12:09 AM, wenzong.fan@windriver.com wrote:
>> From: Wenzong Fan <wenzong.fan@windriver.com>
>>
>> This avoids running cp with interactive mode if defined:
>>
>>      alias cp='cp -i'
>>
>> Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
>> ---
>>   meta/lib/oe/path.py |    2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py
>> index da044ba..6933977 100644
>> --- a/meta/lib/oe/path.py
>> +++ b/meta/lib/oe/path.py
>> @@ -97,7 +97,7 @@ def copyhardlinktree(src, dst):
>>           check_output(cmd, shell=True, stderr=subprocess.STDOUT)
>>           if os.path.isdir(src):
>>               src = src + "/*"
>> -        cmd = 'cp -afl %s %s' % (src, dst)
>> +        cmd = '/bin/cp -afl %s %s' % (src, dst)
>
> As Richard points out in the Consolidated Pull, this is the wrong way to
> go about this, there are possibly other places that will have similar
> issues and we can't fix then all this way.
>
> A better solution is to add a sanity check and suggest that the user
> needs to fix their environment to ensure the build will succeed.

Ok, I will update the patch for this issue.

Thanks
Wenzong

>
> Sau!
>>           check_output(cmd, shell=True, stderr=subprocess.STDOUT)
>>       else:
>>           copytree(src, dst)
>>
>

Patch

diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py
index da044ba..6933977 100644
--- a/meta/lib/oe/path.py
+++ b/meta/lib/oe/path.py
@@ -97,7 +97,7 @@  def copyhardlinktree(src, dst):
         check_output(cmd, shell=True, stderr=subprocess.STDOUT)
         if os.path.isdir(src):
             src = src + "/*"
-        cmd = 'cp -afl %s %s' % (src, dst)
+        cmd = '/bin/cp -afl %s %s' % (src, dst)
         check_output(cmd, shell=True, stderr=subprocess.STDOUT)
     else:
         copytree(src, dst)