Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 Aug 2003 15:02:21 -0700 (PDT)
From:      Doug Barton <DougB@FreeBSD.org>
To:        Alexander Leidinger <Alexander@Leidinger.net>
Cc:        current@freebsd.org
Subject:   Re: automated clean up of /usr/lib because of /lib
Message-ID:  <20030831145808.M68829@znfgre.qbhto.arg>
In-Reply-To: <20030831203149.10589d5c.Alexander@Leidinger.net>
References:  <20030831203149.10589d5c.Alexander@Leidinger.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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




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