Re: automated clean up of /usr/lib because of /lib

From: Doug Barton <DougB_at_FreeBSD.org>
Date: Sun, 31 Aug 2003 15:02:21 -0700 (PDT)
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
Received on Sun Aug 31 2003 - 13:04:17 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:20 UTC