csomh / source-git / rpm

Forked from source-git/rpm 4 years ago
Clone
2ff057
#!/bin/sh
2ff057
#
2ff057
# Gets file list on standard input and RPM_BUILD_ROOT as first parameter
2ff057
# and searches for omitted files (not counting directories).
2ff057
# Returns it's output on standard output.
2ff057
#
2ff057
# filon@pld.org.pl
2ff057
2ff057
# Get build root
2ff057
RPM_BUILD_ROOT="${1}"
2ff057
2ff057
# Handle the case where ${RPM_BUILD_ROOT} is undefined, not a directory, etc.
2ff057
if [ ! -d "${RPM_BUILD_ROOT}" ] ; then
2ff057
	cat > /dev/null
2ff057
	if [ -e "${RPM_BUILD_ROOT}" ] ; then
2ff057
		echo "Error: \`${RPM_BUILD_ROOT}' is not a directory" 1>&2
2ff057
	fi
2ff057
	exit 1
2ff057
fi
2ff057
2ff057
# Create temporary file listing files in the manifest
2ff057
[ -n "$TMPDIR" ] || TMPDIR="/tmp"
2ff057
FILES_DISK=`mktemp "${TMPDIR}/rpmXXXXXX"`
2ff057
2ff057
# Ensure temporary file is cleaned up when we exit
2ff057
trap "rm -f \"${FILES_DISK}\"" 0 2 3 5 10 13 15
2ff057
2ff057
# Find non-directory files in the build root and compare to the manifest.
2ff057
# TODO: regex chars in last sed(1) expression should be escaped
2ff057
find "${RPM_BUILD_ROOT}" -type f -o -type l | LC_ALL=C sort > "${FILES_DISK}"
2ff057
LC_ALL=C sort | diff -d "${FILES_DISK}" - | sed -n 's|^< '"${RPM_BUILD_ROOT}"'\(.*\)$|   \1|gp'
2ff057