#!/bin/sh

# sbopkglint test, must be sourced by sbopkglint (not run standalone).

# PKG, PRGNAM, VERSION, ARCH are set by sbopkglint. also the current
# directory is the root of the installed package tree.

#######################################################################
# checks for $TMP/package-* hardcoded in files. uses the environment
# TMP, defaults to /tmp/SBo. this means that if you set TMP when
# building the package, you have to set it to the same thing for this
# check to work properly. If you don't ever set it, it'll be fine.

found="$(find . -type f -print0 | xargs -0 fgrep -l "$TMP/package-")"
if [ -n "$found" ]; then
	warn "found files with TMP ($TMP/package-*) baked in:"
	echo "$found" 1>&2
fi
