From owner-freebsd-current@FreeBSD.ORG Sun Aug 31 15:04:17 2003 Return-Path: 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 EFFE016A4C1 for ; Sun, 31 Aug 2003 15:04:17 -0700 (PDT) Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [204.127.198.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id 37D8143FE5 for ; Sun, 31 Aug 2003 15:04:17 -0700 (PDT) (envelope-from DougB@freebsd.org) Received: from master.dougb.net (12-234-22-23.client.attbi.com[12.234.22.23](untrusted sender)) by comcast.net (rwcrmhc13) with SMTP id <2003083122022101500gllp5e>; Sun, 31 Aug 2003 22:02:22 +0000 Date: Sun, 31 Aug 2003 15:02:21 -0700 (PDT) From: Doug Barton To: Alexander Leidinger In-Reply-To: <20030831203149.10589d5c.Alexander@Leidinger.net> Message-ID: <20030831145808.M68829@znfgre.qbhto.arg> References: <20030831203149.10589d5c.Alexander@Leidinger.net> Organization: http://www.FreeBSD.org/ X-message-flag: Outlook -- Not just for spreading viruses anymore! MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: current@freebsd.org Subject: Re: automated clean up of /usr/lib because of /lib X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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: Sun, 31 Aug 2003 22:04:18 -0000 There was a discussion of this recently, and the conclusion was more or less that doing this in an automated fashion is frought with danger, since you don't know for sure what else besides system components the user has put in the various directories. I've been using the following combination of a bash function (that could just as easily be its own script) and a script I call after_installworld. 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 installdate && make installworld } #!/bin/sh PATH=/usr/bin:/bin export PATH for dir in /bin /lib /libexec /rescue /sbin \ /usr/bin /usr/games /usr/lib /usr/libdata /usr/libexec /usr/sbin ; do for file in `find $dir \( -type f -o -type l \) -a \ ! -newer /usr/src/installdate`; do case "${file}" in /usr/lib/compat/*|*/0ld/*|/usr/libdata/perl/*) ;; *) echo '' ls -lao ${file} read -p " *** Move ${file} to ${file%/*}/0ld? [n] " M case ${M} in [yY]*) mkdir -p ${file%/*}/0ld chflags 0 ${file} && mv -i ${file} ${file%/*}/0ld/ ;; esac ;; esac done done exit 0 This combination keeps things squeaky clean for me. HTH, Doug -- This .signature sanitized for your protection