Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 504338 - =dev-python/pyds9-1.7 - sed script generates invalid python code
Summary: =dev-python/pyds9-1.7 - sed script generates invalid python code
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Astronomy project
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2014-03-12 16:49 UTC by Joseph Booker
Modified: 2014-03-13 17:09 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Booker 2014-03-12 16:49:11 UTC
pyds9 has an incorrect sed statement in the latest ebuild. Currently it has:
    sed -i \
        -e "s|sys.path|${EROOT%/}/usr/bin|" \
        ds9.py || die

This replaces sys.path (a list of strings) with a literal path.

On my system, this causes the following in ds9.py:
 96         _cmd = False
 97         # look in install directories for xpans
 98         for _dir in /usr/bin:
 99             _fname = os.path.join(_dir, ds9Globals["progs"][0])
100             if os.path.exists(_fname):

This is a syntax error:
In [1]: import ds9
  File "/usr/lib64/python2.7/site-packages/ds9.py", line 98
    for _dir in /usr/bin:
                ^
SyntaxError: invalid syntax


Replacing the sed with the following:
    sed -i \
        -e "s|sys.path|['${EROOT%/}/usr/bin']|" \
        ds9.py || die
Fixes the problem for me.
Comment 1 Sébastien Fabbro (RETIRED) gentoo-dev 2014-03-13 17:09:19 UTC
+  13 Mar 2014; Sébastien Fabbro <bicatali@gentoo.org> pyds9-1.7.ebuild:
+  Fixed path substitution, thanks Joseph Booker, bug #504338
+