firehol/packaging/check-contents

50 lines
1.0 KiB
Plaintext
Raw Normal View History

#!/bin/sh
#
# check-contents
#
scriptname=check-contents
if ! MYTMP=$(mktemp -d -t $scriptname-XXXXXX)
then
echo >&2
echo >&2
echo >&2 "Cannot create temporary directory."
echo >&2
exit 1
fi
cleanup() {
status=$?
rm -rf "${MYTMP}"
exit $status
}
# clean up if we get stopped by Crtl-C or forced logout or normal exit
trap cleanup INT
trap cleanup HUP
trap cleanup 0
if [ $# -ne 2 ]
then
echo "check-contents git-dir tar-gz-file"
exit 1
fi
mkdir $MYTMP/unpack
tar xfzC "$2" $MYTMP/unpack
diff -r "$1" $MYTMP/unpack/* | grep "^Only" | sed \
-e '/: autom4te\.cache$/d' \
-e '/: \.deps$/d' \
-e '/: \.git$/d' \
-e '/: \.gitattributes$/d' \
-e '/: \.gitignore$/d' \
-e '/: config\.log$/d' \
-e '/: config\.status$/d' \
-e '/: Makefile$/d' \
-e '/: tmp-anchor-links$/d' \
-e '/: tmp-manproc$/d' \
-e '/: firehol.*\.tar\.\(gz\|bz2\|xz\)$/d' \
-e '/: unittest$/d' \
-e '/sbin: \(firehol\|fireqos\|link-balancer\)$/d' \
-e '/sbin: \(update-ipsets\|vnetbuild\|commands.sed\)$/d'