From owner-freebsd-current@FreeBSD.ORG Tue Jul 26 19:27:50 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E17B016A41F; Tue, 26 Jul 2005 19:27:50 +0000 (GMT) (envelope-from DougB@freebsd.org) Received: from rwcrmhc12.comcast.net (rwcrmhc14.comcast.net [216.148.227.89]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9DAF543D45; Tue, 26 Jul 2005 19:27:50 +0000 (GMT) (envelope-from DougB@freebsd.org) Received: from [192.168.15.101] (67-20-70-103.vnnyca.adelphia.net[67.20.70.103]) by comcast.net (rwcrmhc14) with SMTP id <200507261927450140010ui2e>; Tue, 26 Jul 2005 19:27:50 +0000 Date: Tue, 26 Jul 2005 12:27:15 -0700 (PDT) From: Doug Barton To: Peter Jeremy In-Reply-To: <20050725195258.GD9620@cirb503493.alcatel.com.au> Message-ID: <20050726115812.X31388@ync.qbhto.arg> References: <200507231942.j6NJgdks037508@repoman.freebsd.org> <42E2A029.1090404@gmail.com> <42E2DA50.2000205@FreeBSD.org> <20050724011629.GK14567@elvis.mu.org> <20050724094522.GL14567@elvis.mu.org> <20050725195258.GD9620@cirb503493.alcatel.com.au> Organization: http://www.FreeBSD.org/ X-OpenPGP-Key-ID: 0xD5B2F0FB X-message-flag: Outlook -- Not just for spreading viruses anymore! MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-current@freebsd.org Subject: Cleaning stale files from the base (Was: Re: cvs commit: src ObsoleteFiles.inc) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2005 19:27:51 -0000 [ Moving to -current to get the discussion off the cvs lists, and get a wider audience ] On Tue, 26 Jul 2005, Peter Jeremy wrote: > On Sun, 2005-Jul-24 11:45:23 +0200, Maxime Henrion wrote: >> If files are installed using the -p flag of install(1), which preserves the >> modification time (I'm not sure we actually use this flag). > > We do in /usr/include (and maybe elsewhere). I have posted this before, but I deal with this issue, and the man page issue, as follows: doinstall () { cd /usr && [ -d include-old ] && /bin/rm -r include-old; [ ! -e include-old ] && mv -i include include-old; /bin/rm -r /usr/share/man; cd /usr/src && touch /var/tmp/installdate && make installworld } I've been doing it this way for several years, and have never run into a problem. For production use, we could change the rm of the man pages to a mv as the includes are done if people wanted to be more cautious. >> Also, a find >> -ctime +1 is only useful if the installworld was done not long ago; if it's >> a few days old or more, we'd have to hack the script. We can also imagine >> doing an installworld in the morning, and another in the evening. > > It's not perfect but it's better than what we had before. You can > fairly easily work around the above by adding something like > date > ${DESTDIR}/etc/installworld As you can see above, I use /var/tmp for this, as it is a little closer to hier-clean, but it's not a huge issue. > into /usr/src/Makefile.inc1 as the first thing installworld does and > then use '! -newercm /etc/installworld' for find. I use the script that I posted at http://people.freebsd.org/~dougb/after_installworld for this. Some desirable additions to that script might be a list of files to ignore (such as perl symlinks in /usr/bin), and an option to delete the file outright, but this is a good proof of concept for what I have in mind. I did recently discover that this script leaves out some directories in /usr/share that could usefully be cleaned, but a lot of that stuff is installed with preserved timestamps, which makes this method difficult. The other thing that makes this method exciting is that if you build world with -DNO_CLEAN, then the libraries where code has not changed are not updated, and get installed with the old dates. That's why in my script the lib directories are last. If I haven't done a clean buildworld, I ^C the script at that point. So like I said, this isn't perfect, but as a POC it's a good place to start. hth, Doug -- This .signature sanitized for your protection