Files
rpm-packaging/tools/run_specchecks.sh
Dirk Mueller a6a26831d1 Evaluate singlespec macros for the tox-lint check
With the introduction of the singlespec macros, those need
to be available in the lint environment so that rpmspec checks
don't fail on parse errors.

Change-Id: I5cec87ba018255e1d91816c9b3a6ddedc17cbffc
2017-08-15 13:52:41 +02:00

36 lines
841 B
Bash
Executable File

#!/bin/bash
set -e
basedir=${1:-$PWD}
WORKSPACE=${WORKSPACE:-$basedir}
echo "run checks over specfiles from $WORKSPACE/logs/"
thome=$(mktemp -d)
cat openstack/openstack-macros/macros.openstack-singlespec > $thome/.rpmmacros
failed=0
for spec in $WORKSPACE/logs/suse/*.spec ; do
egrep -q '^Source:' $spec && {
echo "$spec should not have Source: lines. Please use Source0: instead."
failed=1
}
egrep -q '^%setup' $spec && {
echo "$spec should not use '%setup'. Please use '%autosetup' instead."
failed=1
}
pushd $(dirname $spec) >/dev/null
HOME=$thome rpmspec -q --qf "%{VERSION}\n" $(basename $spec) >/dev/null || {
echo "$spec does not parse properly. Please check your syntax."
failed=1
}
popd > /dev/null
done
rm -rf $thome
exit $failed