diff --git a/tools/run_renderspec.sh b/tools/run_renderspec.sh index 3e9d73841..17d0bed6d 100755 --- a/tools/run_renderspec.sh +++ b/tools/run_renderspec.sh @@ -2,7 +2,11 @@ set -eux +# 1st positional arg is the working dir basedir=${1:-$PWD} +# 2nd positional arg is the find -name parameter +FIND_STR=${2:-*} + specdir=${basedir}/openstack/ WORKSPACE=${WORKSPACE:-$basedir} @@ -19,7 +23,7 @@ done count=0 echo "run renderspec over specfiles from ${specdir}" for specstyle in $specstyles; do - find ${specdir} -name '*.spec.j2' -type f -print0 | \ + find ${specdir} -name "${FIND_STR}.spec.j2" -type f -print0 | \ xargs -n 1 -0 -P 0 -I __SPEC__ bash -c " set -e skip='--skip-pyversion py3' diff --git a/tools/run_specchecks.sh b/tools/run_specchecks.sh index 07e99beaa..7fb8dbd4f 100755 --- a/tools/run_specchecks.sh +++ b/tools/run_specchecks.sh @@ -2,7 +2,10 @@ set -e +# 1st positional arg is the working dir basedir=${1:-$PWD} +# 2nd positional arg is the find -name parameter +FIND_STR=${2:-*} WORKSPACE=${WORKSPACE:-$basedir} @@ -12,7 +15,8 @@ thome=$(mktemp -d) cat openstack/openstack-macros/macros.openstack-singlespec > $thome/.rpmmacros failed=0 -for spec in $WORKSPACE/logs/suse/*.spec ; do +for spec in `find $WORKSPACE/logs/suse/ -name "${FIND_STR}.spec" -type f -print` ; do + echo "Checking $spec" egrep -q '^Source:' $spec && { echo "$spec should not have Source: lines. Please use Source0: instead." failed=1 diff --git a/tools/run_speccleaner.sh b/tools/run_speccleaner.sh index 59bf31bfe..1a2ec4639 100755 --- a/tools/run_speccleaner.sh +++ b/tools/run_speccleaner.sh @@ -2,7 +2,10 @@ set -e +# 1st positional arg is the working dir basedir=${1:-$PWD} +# 2nd positional arg is the find -name parameter +FIND_STR=${2:-*} WORKSPACE=${WORKSPACE:-$basedir} # tempfile to store the spec-cleaner diff for all specs @@ -14,7 +17,8 @@ echo "run spec-cleaner over specfiles from $WORKSPACE/logs/" count=0 # TODO(toabctl): also run spec-cleaner with non-SUSE specs # but the current problem is that the license check works for SUSE only -for spec in $WORKSPACE/logs/suse/*.spec ; do +for spec in `find $WORKSPACE/logs/suse/ -name "${FIND_STR}.spec" -type f -print` ; do + echo "spec-cleaner checking $spec" # NOTE(toabctl):spec-cleaner can not ignore epochs currently sed -i '/^Epoch:.*/d' $spec # NOTE(jpena): spec-cleaner wants python2/python3 instead of diff --git a/tox.ini b/tox.ini index 4f1d3d6fa..21b941ff4 100644 --- a/tox.ini +++ b/tox.ini @@ -14,9 +14,9 @@ passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY [testenv:linters] commands = - {toxinidir}/tools/run_renderspec.sh {toxinidir} - {toxinidir}/tools/run_specchecks.sh {toxinidir} - {toxinidir}/tools/run_speccleaner.sh {toxinidir} + {toxinidir}/tools/run_renderspec.sh {toxinidir} {posargs} + {toxinidir}/tools/run_specchecks.sh {toxinidir} {posargs} + {toxinidir}/tools/run_speccleaner.sh {toxinidir} {posargs} # compat. remove me [testenv:lint]