Index: projects/building-blocks/tools/add-optional-obsolete-files-entries.sh =================================================================== --- projects/building-blocks/tools/add-optional-obsolete-files-entries.sh (nonexistent) +++ projects/building-blocks/tools/add-optional-obsolete-files-entries.sh (revision 275089) @@ -0,0 +1,49 @@ +#!/bin/sh +# +# Simple script for enumerating installed files for a list of directories +# +# usage: add-optional-obsolete-files-entries.sh directory .. +# +# $FreeBSD$ + +: ${TMPDIR=/tmp} + +DESTDIR=$(mktemp -d $TMPDIR/tmp.XXXXXX) || exit +trap "rm -Rf $DESTDIR" EXIT INT TERM + +# Don't pollute the output with +: ${SRCCONF=/dev/null} +: ${__MAKE_CONF=/dev/null} + +if [ $# -gt 0 ] +then + directories=$* +else + directories=. +fi + +export __MAKE_CONF DESTDIR SRCCONF + +SRCTOP=$(cd $(make -V'${.MAKE.MAKEFILES:M*/share/mk/sys.mk:H:H:H}'); pwd) + +# Don't install the manpage symlinks +(cd $SRCTOP; make hier INSTALL_SYMLINK=true MK_MAN=no >/dev/null) + +for directory in $directories +do + (cd $directory && make install >/dev/null) || exit +done +# Prune empty directories +# XXX: is [ -n ... ] call necessary? +while empty_dirs=$(find $DESTDIR -type d -and -empty) && [ -n "$empty_dirs" ] +do + rmdir $empty_dirs +done + +# Enumerate all of the installed files/directories +(cd $DESTDIR; + find -s . -type f -mindepth 1 | sed -e 's,^,OLD_FILES+=,'; + find -s . -type d -mindepth 1 -and \! -empty | \ + egrep -v '^\./(s*bin|libexec|usr|usr/include|usr/lib|usr/libexec|usr/s*bin|usr/share|usr/share/man|usr/share/man/man[0-9])$' | \ + sed -e 's,^,OLD_DIRS+=,' +) | sed -e 's,+=\./,+=,' Property changes on: projects/building-blocks/tools/add-optional-obsolete-files-entries.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property