this solves issues that rpm tries to access every source
and it does that in wrong dir in packages like php.spec (tries php53
dir)
really rpm should check the files if only want to parse simple things
like version
similar issue in the past:
http://lists.pld-linux.org/mailman/pipermail/pld-devel-en/2015-November/024529.html
__package_rpmversion() {
if [[ $PWD =~ $(rpm -E %_topdir) ]] && [ "$(\ls *.spec 2>/dev/null | wc -w)" = 1 ]; then
# give only first version (ignore subpackages)
- rpm --specfile *.spec -q --qf '%{VERSION}\n' | head -n1
+ rpm --define "_specdir $PWD" --specfile *.spec -q --qf '%{VERSION}\n' | head -n1
fi
}