On Fri, Nov 20, 2009 at 12:22 AM, Matthew Burgess < matt...@linuxfromscratch.org> wrote:
> Bruce Dubbs wrote: > > Chris Staub wrote: > >> On 11/19/2009 07:51 PM, Bruce Dubbs wrote: > >>> The problem is that find is returning a full path. That will copy all > >>> files to /usr/include. You would have to parse each line of the find > >>> output to remove the path before the current directory. > >>> > >>> We now do: > >>> > >>> make INSTALL_HDR_PATH=dest headers_install > >>> cp -rv dest/include/* /usr/include > >>> > >>> Why not just add one line: > >>> > >>> make INSTALL_HDR_PATH=dest headers_install > >>> rm dest/include/linux/.*install* > >>> cp -rv dest/include/* /usr/include > >>> > >>> That removes it before copying to /usr/include. > >>> > >> But there are the ".install" files in every subdir, not just in the > >> "linux" dir. I use: > >> > >> find dest/include -name .install -or -name ..install.cmd | xargs rm -fv > > > > Ahh. I didn't realize they were in multiple directories. > > > > find dest/include -name .install -or -name ..install.cmd -exec rm -v > > '{}' \; > > Thanks guys, removing them at the source is obviously correct. I'd > prefer this variant, though: > > find dest/include -name .install --or -name ..install.cmd -delete > > I believe that '-delete' is the recommended/race-free way of removing > files found by find(1), though I can't find any documentation support > this just yet. > > It may be dangerous for us to recommend deleting files recursively. In the event of a typo, it could cause a bit of damage. I understand that it is up to the user to check the spelling, but in most cases [sed, or mkdir's] they just end up w/ a crippled LFS system. Something like rm -rf /tools/include/linux/.*linux * [note the space before the *] could have an adverse effect outside of the build system. [inputted into wrong terminal, ssh terminal closing before entering command, mounted root system within LFS system, /dev directory] Disclaimer: I chose the rm command as opposed to the proposed find as it was easier to poke holes in it. Offhand, it would take some work to do damage w/ the current find, especially if we are already chrooted -- Nathan Coulson (conathan) ------ Location: Brittish Columbia, Canada Timezone: PST (-8) Webpage: http://www.nathancoulson.com
-- http://linuxfromscratch.org/mailman/listinfo/lfs-dev FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page