Bug 3311

Summary: %__python_version expands to nothing if puthon is not installed
Product: Sisyphus Reporter: Sir Raorn <raorn>
Component: rpmAssignee: placeholder <placeholder>
Status: CLOSED FIXED QA Contact: qa-sisyphus
Severity: major    
Priority: P2 CC: at, glebfm, imz, ldv, placeholder, vt
Version: unstable   
Hardware: all   
OS: Linux   

Description Sir Raorn 2003-11-24 13:11:48 MSK
GLobal macro %__python_version expands to empty string if puthon is not
installed. This causes parse errors in sandman while doing it's pre-commit check
on specfiles containing something like:

Requires: python >= %__python_version

This macro should look like this:

%__python_version %((%__python -c 'import sys; print sys.version' 2>/dev/null ||
echo "unknown") |head -1 |cut -d' ' -f1 |cut -d. -f1,2)

This will not cause any errors in build process since python-devel package is
often BuildRequire'd in such packages.
Comment 1 Dmitry V. Levin 2003-11-24 18:09:16 MSK
Applied in upcoming rpm-4.0.4-alt28