summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xtests/basic/rpm.t17
1 files changed, 5 insertions, 12 deletions
diff --git a/tests/basic/rpm.t b/tests/basic/rpm.t
index e2c630f..a914d53 100755
--- a/tests/basic/rpm.t
+++ b/tests/basic/rpm.t
@@ -35,18 +35,11 @@ else
GIT_PARENT=$(git describe --abbrev=0)
fi
-# check for changed files
-CHANGED_FILES=$(git diff --name-only ${GIT_PARENT})
-# if a commit changes this test, we should not skip it
-SELFTEST=$(grep -e 'tests/basic/rpm.t' <<< "${CHANGED_FILES}")
-# filter out any files not affecting the build itself
-CHANGED_FILES=$(grep -E -v \
- -e '\.c$' \
- -e '\.h$' \
- -e '\.py$' \
- -e '^tests/' \
- <<< "${CHANGED_FILES}")
-if [ -z "${CHANGED_FILES}" -a -z "${SELFTEST}" ]
+# Filter out everything and what remains needs to be built
+BUILD_FILES=$(git diff --name-status ${GIT_PARENT} | grep -Ev '^M.*\.(c|h|py)' | awk {'print $2'})
+SELFTEST=$(grep -e 'tests/basic/rpm.t' <<< "${BUILD_FILES}")
+BUILD_FILES=$(grep -Ev '^tests/' <<< "${BUILD_FILES}")
+if [ -z "${BUILD_FILES}" -a -z "${SELFTEST}"]
then
# nothing affecting packaging changed, no need to retest rpmbuild
SKIP_TESTS