[EMAIL PROTECTED] dixit:
>• preserve hardlinks
>- @$(CP) $(BUILD_DIR)/root $(LINUX_BUILD_DIR)/
>+ cd ${BUILD_DIR} && pax -rw -pe root ${LINUX_BUILD_DIR}/
This is a prime example why ${CP} should be avoided: nobody
seems to know what it exactly does, and thinks, falsely, that
they're secure. (Hint: even cp -r and cp -R aren't the same,
at least not according to SUSv3, it just happens to be so in
GNU cp.)
We should nuke ${CP} in its entirety.
• packages should use ${INSTALL_PROGRAM}, ${INSTALL_SCRIPT},
${INSTALL_DATA}, or in general ${INSTALL} -m <mode> to “copy”
• if you want to simply copy files, use “cp” directly, but don't
use any of the more “fancy” options without checking here first:
| http://www.opengroup.org/onlinepubs/009695399/utilities/cp.html
• if you want to copy an entire directory hierarchy, or just some
stuff with preserving attributes, symbolic links, hard links, etc.
use pax(1) – http://www.mirbsd.org/man1/pax.htm – e.g. like this:
| cd foo && pax -rw -pe file1 file2 dir1 ... $targetdir/
for single files or subdirs (cd foo is necessary because the path
to the arguments is retained/copied by pax), and
| cd foo && pax -rw -pe . $targetdir/
this works like (cd foo; tar cf - .)|(cd $targetdir; tar xphf -)
just MUCH more efficient
• don't omit the trailing slash after the target dir, ever, for all
three of them
So, if some of you lazy students out there ☺ wants something really
easy to do, change all occurencies of ${CP} to cp, install (please
not directly, use ${INSTALL_DIR}, ${INSTALL_DATA}, ${INSTALL_BIN},
${INSTALL_SCRIPT}, defined in mk/vars.mk) or pax. If in doubt which
one is correct, ask. We're on IRC.
bye,
//mirabile
--
I believe no one can invent an algorithm. One just happens to hit upon it
when God enlightens him. Or only God invents algorithms, we merely copy them.
If you don't believe in God, just consider God as Nature if you won't deny
existence. -- Coywolf Qi Hunt
_______________________________________________
freewrt-developers mailing list
[email protected]
https://www.freewrt.org/lists/listinfo/freewrt-developers