X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fpackaging%2Ftest-rpm-deps.sh;h=2bb0db6dbda972cc7368a4dfee44ae40dd9e008d;hb=95d62ba8065ca3281fb2b6265411f6412fc67594;hp=d8fd61e581adad291a5514d75ee158fa0b8c43b1;hpb=9849af885fc9b6e0e5472ba4fc8d512a9b324b95;p=releng%2Fbuilder.git diff --git a/jjb/packaging/test-rpm-deps.sh b/jjb/packaging/test-rpm-deps.sh index d8fd61e58..2bb0db6db 100644 --- a/jjb/packaging/test-rpm-deps.sh +++ b/jjb/packaging/test-rpm-deps.sh @@ -8,8 +8,12 @@ set -ex -o pipefail # Verify exactly 1 RPM is in the path we expect set -- /home/$USER/rpmbuild/RPMS/noarch/*.rpm -# shellcheck disable=SC1054 -[ $# -eq 1 ] || {{ echo "Expected 1 RPM, found $#"; exit 1; }} +if [ $# -eq 1 ]; then + echo "Found one RPM in build out dir, as expected" +else + echo "Expected 1 RPM, found $#" + echo 1 +fi # If path is globbed (/path/to/*.rpm), expand it path=$(sudo find / -wholename /home/$USER/rpmbuild/RPMS/noarch/*.rpm) @@ -41,16 +45,16 @@ fi # shellcheck disable=SC2034 mapfile -t actual_deps < <( rpm -qp /home/$USER/rpmbuild/RPMS/noarch/*.rpm --requires ) # shellcheck disable=SC2154 disable=SC2145 -printf 'Dependency found: %s\n' "${{actual_deps[@]}}" +printf 'Dependency found: %s\n' "${actual_deps[@]}" -# shellcheck disable=SC2154 disable=SC2145 disable=SC2034 -diff_deps=(`echo "${{expected_deps[@]}}" "${{actual_deps[@]}}" | tr ' ' '\n' | sort | uniq -u`) +# shellcheck disable=SC2154,SC2145,SC2034,SC2207 +diff_deps=(`echo "${expected_deps[@]}" "${actual_deps[@]}" | tr ' ' '\n' | sort | uniq -u`) # shellcheck disable=SC2154 disable=SC2145 disable=SC2068 disable=SC2170 disable=SC1083 -if [ ${{#diff_deps[*]}} -eq 0 ]; then +if [ ${#diff_deps[*]} -eq 0 ]; then echo "RPM requirements are as expected" else echo "RPM requirements don't match the expected requirements" # shellcheck disable=SC2154 disable=SC2145 - printf 'Dependency mismatch: %s\n' ${{diff_deps[@]}} + printf 'Dependency mismatch: %s\n' ${diff_deps[@]} exit 1 fi