From owner-freebsd-hackers@FreeBSD.ORG Sun Feb 15 12:34:52 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E65A916A4CE for ; Sun, 15 Feb 2004 12:34:52 -0800 (PST) Received: from smtp4.server.rpi.edu (smtp4.server.rpi.edu [128.113.2.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id A0FE243D1D for ; Sun, 15 Feb 2004 12:34:52 -0800 (PST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp4.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i1FKYlHQ001724; Sun, 15 Feb 2004 15:34:47 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <20040215.101900.20429400.imp@bsdimp.com> References: <20040215.101900.20429400.imp@bsdimp.com> Date: Sun, 15 Feb 2004 15:34:46 -0500 To: "M. Warner Losh" From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) cc: hackers@freebsd.org Subject: Re: Adding 'realclean' target to /usr/src/Makefile X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2004 20:34:53 -0000 At 10:19 AM -0700 2/15/04, M. Warner Losh wrote: >In message: > Garance A Drosihn writes: >: realclean : >: rm -Rf ${.OBJDIR}/* > >I'd make that be more like: > >realclean : > @chflags -R 0 ${.OBJDIR}/* > @rm -Rf ${.OBJDIR}/* > >If you can tolerate errors in the output, the following is >faster because the chflags has lots less work to do: > >realclean : > @rm -Rf ${.OBJDIR}/* > @chflags -R 0 ${.OBJDIR}/* > @rm -Rf ${.OBJDIR}/* The more foolproof/reliable we can make it for everybody, the more I like it. I'll see your chflags, and add one redirection of stderr so the user won't see errors that we don't really care about: realclean : @rm -Rf ${.OBJDIR}/* 2>/dev/null @chflags -R 0 ${.OBJDIR}/* @rm -Rf ${.OBJDIR}/* Any errors that showed up on the first 'rm' should also show up on the second 'rm', so we shouldn't really lose any useful info. I might also try wrapping the second two commands in an 'if', so they will be executed only if there's still something left over after the first 'rm'. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu