Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 May 2008 15:17:16 +0200 (CEST)
From:      Oliver Fromme <olli@lurza.secnetix.de>
To:        freebsd-hackers@FreeBSD.ORG, Beech Rintoul <beech@FreeBSD.ORG>
Subject:   Re: Help with copytree code
Message-ID:  <200805191317.m4JDHGbl000932@lurza.secnetix.de>
In-Reply-To: <200805182328.45822.beech@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Beech Rintoul wrote:
 > This copytree code is from bsd.port.mk, and I've been asked to try and 
 > find a fix. This is very handy for installing a whole tree (like a 
 > web app) keeping everything intact. It wasn't designed to copy to a 
 > populated directory so it affects everything in that dir, not just 
 > what's being installed. We need to keep it's functionality, but a fix 
 > is more than I can come up with.

Why don't you simply do the chown+chmod on the source tree
instead of doing it afterwards on the target tree?
I think that would solve the problem.

By the way, cpio(1) does have the option -R to change
owner and/or group on the target files, so you don't need
to run chown(1) afterwards.  Unfortunately there doesn't
seem to be an option to set the permission modes, though.

Finally, I recommend you use the "-print0" option of find
and the -0 option of cpio, so it will also work if there
are any file names that contain spaces or other special
characters.

Best regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606,  Geschäftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün-
chen, HRB 125758,  Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart

FreeBSD-Dienstleistungen, -Produkte und mehr:  http://www.secnetix.de/bsd

"Unix gives you just enough rope to hang yourself --
and then a couple of more feet, just to be sure."
        -- Eric Allman



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200805191317.m4JDHGbl000932>