From 92405a9ad7a53b7ac2ca306d655ebb2c7250c61b Mon Sep 17 00:00:00 2001 From: Saul Wold Date: Tue, 25 Jun 2019 15:21:04 -0700 Subject: [PATCH] speclint: only show the diff files Since we moved the specfile into the tempdir so that it can be modified the final checks are showing all the specfiles even if they pass the spec cleaner process. Also don't reset the failed variable. Fix the argument check for multiple files Change-Id: I0a7c33f0ce4f31607bb518a2a899a522cdd7fd4c Signed-off-by: Saul Wold --- tools/spec-tools/speclint.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/spec-tools/speclint.sh b/tools/spec-tools/speclint.sh index ee55b266a..746413021 100755 --- a/tools/spec-tools/speclint.sh +++ b/tools/spec-tools/speclint.sh @@ -14,7 +14,7 @@ usage() { exit 1 } -if [ -z $@ ]; then +if [ ${#@} -eq 0 ]; then usage fi @@ -65,7 +65,7 @@ for spec in $@; do (cd $(dirname $spec); HOME=$tmpdir rpmspec -q --qf "%{VERSION}\n" $specname) >/dev/null || { echo "$spec does not parse properly. Please check your syntax." failed=1 - } + } echo "spec-cleaner checking $specname" # Make a copy to do some fix-ups required by spec-cleaner @@ -84,10 +84,9 @@ for spec in $@; do done # check if some diffs are available -failed=0 -for specdiff in $tmpdir/*; do +for specdiff in $tmpdir/*.cleaner.diff; do if [ -s "$specdiff" ]; then - echo "##### `basename ${specdiff}` ##### " + echo "##### `basename ${specdiff} .cleaner.diff` ##### " cat $specdiff failed=1 fi