svn commit: r275089 - projects/building-blocks/tools
Garrett Cooper
ngie at FreeBSD.org
Tue Nov 25 23:01:02 UTC 2014
Author: ngie
Date: Tue Nov 25 23:01:01 2014
New Revision: 275089
URL: https://svnweb.freebsd.org/changeset/base/275089
Log:
Add script I'm using to add entries to OptionalObsoleteFiles.inc
Added:
projects/building-blocks/tools/add-optional-obsolete-files-entries.sh (contents, props changed)
Added: projects/building-blocks/tools/add-optional-obsolete-files-entries.sh
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/building-blocks/tools/add-optional-obsolete-files-entries.sh Tue Nov 25 23:01:01 2014 (r275089)
@@ -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,+=\./,+=,'
More information about the svn-src-projects
mailing list