+usage()
+{
+ echo "deptest.sh [OPTIONS] [PACKAGES]"
+ echo
+ echo "OPTIONS:"
+ echo " --lean Run a lean test. Do not clean the build directory for each"
+ echo " package test."
+ echo " --force Force a test, even if a success/blacklist stamp is available"
+ echo " -j X Number of make jobs"
+ echo
+ echo "PACKAGES are packages to test. If not specified, all installed packages"
+ echo "will be tested."
+}
+
+deptest_make()
+{
+ local target="$1"
+ shift
+ local logfile="$1"
+ shift
+ make -j$nrjobs "$target" \
+ BUILD_DIR="$BUILD_DIR" \
+ BUILD_DIR_HOST="$BUILD_DIR_HOST" \
+ KERNEL_BUILD_DIR="$KERNEL_BUILD_DIR" \
+ BIN_DIR="$BIN_DIR" \
+ STAGING_DIR="$STAGING_DIR" \
+ STAGING_DIR_HOST="$STAGING_DIR_HOST" \
+ FORCE_HOST_INSTALL=1 \
+ V=99 "$@" >"$LOG_DIR/$logfile" 2>&1
+}
+
+clean_kernel_build_dir()
+{
+ # delete everything, except the kernel build dir "linux-X.X.X"
+ (
+ cd "$KERNEL_BUILD_DIR" || die "Failed to enter kernel build dir"
+ for entry in *; do
+ [ -z "$(echo "$entry" | egrep -e '^linux-*.*.*$')" ] || continue
+ rm -rf "$entry" || die "Failed to clean kernel build dir"
+ done
+ )
+}
+
+stamp_exists() # $1=stamp
+{
+ [ -e "$1" -o -L "$1" ]
+}
+