From owner-freebsd-hackers@FreeBSD.ORG Mon May 19 13:17:19 2008 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A57D106564A; Mon, 19 May 2008 13:17:19 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (unknown [IPv6:2a01:170:102f::2]) by mx1.freebsd.org (Postfix) with ESMTP id B3E998FC0A; Mon, 19 May 2008 13:17:18 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.1/8.14.1) with ESMTP id m4JDHGR3000933; Mon, 19 May 2008 15:17:17 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.1/8.14.1/Submit) id m4JDHGbl000932; Mon, 19 May 2008 15:17:16 +0200 (CEST) (envelope-from olli) Date: Mon, 19 May 2008 15:17:16 +0200 (CEST) Message-Id: <200805191317.m4JDHGbl000932@lurza.secnetix.de> From: Oliver Fromme To: freebsd-hackers@FreeBSD.ORG, Beech Rintoul In-Reply-To: <200805182328.45822.beech@freebsd.org> X-Newsgroups: list.freebsd-hackers User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.2-STABLE-20070808 (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Mon, 19 May 2008 15:17:17 +0200 (CEST) Cc: Subject: Re: Help with copytree code X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-hackers@FreeBSD.ORG, Beech Rintoul List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2008 13:17:19 -0000 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