Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Nov 2011 22:49:14 +0000
From:      Alexander Best <arundel@freebsd.org>
To:        Warner Losh <imp@bsdimp.com>
Cc:        freebsd-toolchain@freebsd.org, Dimitry Andric <dim@freebsd.org>
Subject:   Re: make cleanworld
Message-ID:  <20111108224914.GA52935@freebsd.org>
In-Reply-To: <20111108223924.GA50971@freebsd.org>
References:  <20111108204912.GA34155@freebsd.org> <4EB9A268.5020805@FreeBSD.org> <20111108215549.GA44260@freebsd.org> <03A12F28-FC6A-479F-9F94-A12E3D7EEE1F@bsdimp.com> <20111108223924.GA50971@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue Nov  8 11, Alexander Best wrote:
> On Tue Nov  8 11, Warner Losh wrote:
> > 
> > On Nov 8, 2011, at 2:55 PM, Alexander Best wrote:
> > > find -flags +XXX /usr/obj/usr/git-freebsd-head -exec chflags -R 0 {} +
> > > rm/obj/usr/git-freebsd-head/*
> > > 
> > > that should only execute chflags(1) on those files with flags set.
> > 
> > THat's only faster if the entire directory tree says in the directory cache.  It isn't so much about chflags being called N times, but having to look at N files twice.
> 
> i think i got it now. ;) sorry for beeing so slow. i'll try to come up with a
> patch for Makefile, which mentions this in the comment.

thoughts?

diff --git a/Makefile b/Makefile
index 61e678b..5d053c2 100644
--- a/Makefile
+++ b/Makefile
@@ -185,7 +185,10 @@ buildworld: upgrade_checks
 # files with chflags set, so this unsets them and tries the 'rm' a
 # second time.  There are situations where this target will be cleaning
 # some directories via more than one method, but that duplication is
-# needed to correctly handle all the possible situations.
+# needed to correctly handle all the possible situations. Getting rid
+# of all files without chflags set in the first 'rm' instance saves us
+# time, because now 'chflags' only needs to take the remaining files
+# (those with chflags set) into account.
 #
 BW_CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR}
 cleanworld:

> 
> cheers.
> alex
> 
> > 
> > Warner



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