Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 434356 - media-video/mplayer2-2.0_p20120828 requires Python >=2.7 (rather than the current >=2.6)
Summary: media-video/mplayer2-2.0_p20120828 requires Python >=2.7 (rather than the cur...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-08 17:46 UTC by Sebastian Pipping
Modified: 2012-09-30 15:26 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build log (media-video:mplayer2-2.0_p20120828:20120908-173237.log,20.29 KB, text/plain)
2012-09-08 17:46 UTC, Sebastian Pipping
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Pipping gentoo-dev 2012-09-08 17:46:36 UTC
Created attachment 323220 [details]
build log

Interesting part of the log
===========================
[..]
./TOOLS/matroska.py --generate-header > libmpdemux/ebml_types.h
Traceback (most recent call last):
  File "./TOOLS/matroska.py", line 250, in <module>
    parse_elems(elements_ebml, 'EBML')
  File "./TOOLS/matroska.py", line 242, in parse_elems
    new = MatroskaElement(name, hexid, eltype, namespace)
  File "./TOOLS/matroska.py", line 210, in __init__
    self.definename = '{}_ID_{}'.format(namespace, name.upper())
ValueError: zero length field name in format
make: *** [libmpdemux/ebml_types.h] Error 1
[..]


Testing with 2.6 and 2.7
========================
# python2.7 -c "print '{}_ID_{}'.format('abc', 'def')"
abc_ID_def

sping@sevendust ~ $ 
# python2.6 -c "print '{}_ID_{}'.format('abc', 'def')"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ValueError: zero length field name in format
Comment 1 Nikoli 2012-09-17 09:30:12 UTC
scarabeus, should we just change '>=dev-lang/python-2.6' to '>=dev-lang/python-2.7' or you will change patch?
Comment 2 Tomáš Chvátal (RETIRED) gentoo-dev 2012-09-26 13:39:41 UTC
Just provide patches guys.
Comment 3 Sebastian Pipping gentoo-dev 2012-09-27 23:03:06 UTC
+  27 Sep 2012; Sebastian Pipping <sping@gentoo.org>
+  mplayer2-2.0_p20120828.ebuild, mplayer2-9999.ebuild:
+  Require python 2.7, not just 2.6 (bug #434356)
+

To go a little futher, something like

  python_set_active_version 2.7 || python_set_active_version 3

would be needed in the ebuild.  Due to the internal call to die() inside, the former would need a subshell as in

  ( python_set_active_version 2.7 ) || python_set_active_version 3

though that may still produces ugly messages and may well be considered a dirty workaround.
Comment 4 Mike Gilbert gentoo-dev 2012-09-27 23:43:43 UTC
(In reply to comment #3)

I would do something like this:

major=$(python_get_version --major)
minor=$(python_get_version --minor)
[[ $major >= 3 || $minor >= 7 ]] || die "Please eselect at least python2.7"
Comment 5 Sebastian Pipping gentoo-dev 2012-09-30 15:26:42 UTC
(In reply to comment #4)
> I would do something like this:
> 
> major=$(python_get_version --major)
> minor=$(python_get_version --minor)
> [[ $major >= 3 || $minor >= 7 ]] || die "Please eselect at least python2.7"

Good idea, thanks!


+  30 Sep 2012; Sebastian Pipping <sping@gentoo.org>
+  mplayer2-2.0_p20120828.ebuild:
+  Produce more helpful errors when compiling with Python 2.6 active (bug
+  #434356, concept by Mike Gilbert)
+