[oe] [PATCH v3] package.bbclass: copy dotfiles in root D to PKGD

Frans Meulenbroeks fransmeulenbroeks at gmail.com
Tue Oct 19 17:24:39 UTC 2010


2010/10/19 Enrico Scholz <enrico.scholz at sigma-chemnitz.de>:
> Frans Meulenbroeks <fransmeulenbroeks at gmail.com> writes:
>
>>>> +     os.system('rm -rf %s/*' % (pkgcopy))
>>>
>>> Can be written as
>>>
>>>  os.system('rm -rf %s' % (pkgcopy))
>>> ...
>>>> +     os.system('cp -pPR %s/. %s/' % (installdest, pkgcopy))
>>>
>>
>> No this is not good. The rm command you give will also remove the dir.
>
> Why is this bad?  The dir is recreated by the 'cp'.
>
>
>> The cp command will copy %s/.
>
> Only the final permissions of <dstdir> may differ between
>
>  rm -rf <dstdir>
>  cp -pPR <srcdir>/. <dstdir>/
>
> and
>
>  rm -rf <dstdir>
>  mkdir <dstdir>
>  cp -pPR <srcdir>/. <dstdir>/
>
>
> In first case, <dstdir> gets permissions of <srcdir>. In the second it
> keeps the permissions from <dstdir>.
>
> Else, content (both the files and their attributes) of <dstdir> will be
> the same for both operations.

Yes, you're right. I accidenlty dropped off the / of the dstdir when I
tested this earlier.
Sorry for the noise.
Not sure if there is a gain though.

Frans.




More information about the Openembedded-devel mailing list