From owner-svn-src-projects@FreeBSD.ORG Tue Nov 25 23:01:01 2014 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE97D266; Tue, 25 Nov 2014 23:01:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1643400; Tue, 25 Nov 2014 23:01:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAPN11Lr041537; Tue, 25 Nov 2014 23:01:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAPN11AC041536; Tue, 25 Nov 2014 23:01:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411252301.sAPN11AC041536@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 25 Nov 2014 23:01:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r275089 - projects/building-blocks/tools X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Nov 2014 23:01:02 -0000 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,+=\./,+=,'