Bug 731800 - Add a %python2_version rpm macro
Summary: Add a %python2_version rpm macro
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python
Version: 14
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Dave Malcolm
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-08-18 17:50 UTC by Garrett Holmstrom
Modified: 2011-08-18 20:17 UTC (History)
3 users (show)

Fixed In Version: python-2.7.2-5.fc17
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-08-18 20:17:34 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Garrett Holmstrom 2011-08-18 17:50:01 UTC
Description of problem:
The rpm package provides a useful %python_version macro:
%(%{__python} -c "import sys; sys.stdout.write(sys.version[:3])")

Could we have a similar %python2_version macro as well?


Version-Release number of selected component (if applicable):
python-2.7-8.fc14.1.x86_64


Steps to Reproduce:
rpm --eval %python2_version

  
Actual results:
%python2_version


Expected results:
2.7


Additional info:
%python_version is defined in /usr/lib/rpm/macros.  rpm owns this, so this bug may actually belong to rpm.

Related: bug #719082's request for a %python3_version macro

Comment 1 Dave Malcolm 2011-08-18 19:28:19 UTC
New "macros.python2" file committed/pushed to git as:
http://pkgs.fedoraproject.org/gitweb/?p=python.git;a=commitdiff;h=85867c0a81ff2e52d71e69dc846a3c0efd3fed46


With this applied locally, I get the following on this box:
$ rpm --eval %python2_version
2.7

For consistency, I also added these macros:
$ rpm --eval %__python2
/usr/bin/python2
$ rpm --eval %python2_sitelib
/usr/lib/python2.7/site-packages
$ rpm --eval %python2_sitearch
/usr/lib64/python2.7/site-packages


Building python-2.7.2-5.fc17 for dist-rawhide
Task info: http://koji.fedoraproject.org/koji/taskinfo?taskID=3284636


Note You need to log in before you can comment on or make changes to this bug.