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

Enrico Scholz enrico.scholz at sigma-chemnitz.de
Tue Oct 19 17:07:33 UTC 2010


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.


Enrico




More information about the Openembedded-devel mailing list