Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 492604 - dev-lang/python-exec:2 - causes collisions between packages?
Summary: dev-lang/python-exec:2 - causes collisions between packages?
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-26 12:06 UTC by Alon Bar-Lev (RETIRED)
Modified: 2013-11-28 23:06 UTC (History)
1 user (show)

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 Alon Bar-Lev (RETIRED) gentoo-dev 2013-11-26 12:06:58 UTC
The new method of storing the original scripts using:

/usr/lib/python-exec/${EPYTHON}/$(basename ${SCRIPT})

Assumes that every single script at system has unique name, which is somewhat far fetched.

What is the solution for two separate scripts, for example config.py located at two different directories, example:

 /usr/share/xxx/config.py
 /usr/share/yyy/config.py

When scripts were at the location of the wrapper there was no such problem.

Thanks,
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-11-28 22:33:43 UTC
Is this a real issue or just a theoretical one? The wrapper is intended to wrap scripts that are run by user. Putting Python scripts in /usr/share is incorrect itself, and most likely won't give you the result you want anyway.
Comment 2 Alon Bar-Lev (RETIRED) gentoo-dev 2013-11-28 22:36:37 UTC
(In reply to Michał Górny from comment #1)
> Is this a real issue or just a theoretical one? The wrapper is intended to
> wrap scripts that are run by user. Putting Python scripts in /usr/share is
> incorrect itself, and most likely won't give you the result you want anyway.

Why putting python script at /usr/share is incorrect? not all script should be in path, some needed during product one time configuration, cgis, hooks and so on.

Assuming that basename of script is unique is incorrect.

I thought that this python-exec should be generic mechanism, it was so far.
Comment 3 Mike Gilbert gentoo-dev 2013-11-28 22:53:34 UTC
The obvious solution here (to me) would be to create a mirrored directory structure under /usr/lib/python-exec/${EPYTHON}.

Possible problems:

1. Path length limits (unlikely).
2. Symlinked directories; do we use a normalized path? This could get messy.

We could keep the current python-exec:2 behavior as a fallback.
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-11-28 22:55:16 UTC
(In reply to Alon Bar-Lev from comment #2)
> (In reply to Michał Górny from comment #1)
> > Is this a real issue or just a theoretical one? The wrapper is intended to
> > wrap scripts that are run by user. Putting Python scripts in /usr/share is
> > incorrect itself, and most likely won't give you the result you want anyway.
> 
> Why putting python script at /usr/share is incorrect? not all script should
> be in path, some needed during product one time configuration, cgis, hooks
> and so on.

/usr/share is for *data*. Script is not really data. It belongs in /usr/lib.

> Assuming that basename of script is unique is incorrect.
> 
> I thought that this python-exec should be generic mechanism, it was so far.

Find a good solution. Write a patch. We can all complain if you like but this won't do the necessary work. I'm not going to waste my time over it unless it becomes necessary for some reason.
Comment 5 Alon Bar-Lev (RETIRED) gentoo-dev 2013-11-28 23:00:28 UTC
The solution was there all the time...

Use plain suffix for the original scripts leave them at original directories.

Not sure why you hurry up to close bugs.

You did not provide any solution but stated that all script within the entire world need to be unique, this is invalid assumption.
Comment 6 Mike Gilbert gentoo-dev 2013-11-28 23:02:51 UTC
(In reply to Alon Bar-Lev from comment #5)
> The solution was there all the time...
> 
> Use plain suffix for the original scripts leave them at original directories.
> 

As stated in bug 492606, this breaks anything that relies on basename(sys.argv[0]) having a specific value. It's trading one type of breakage for another.
Comment 7 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-11-28 23:06:06 UTC
(In reply to Mike Gilbert from comment #6)
> (In reply to Alon Bar-Lev from comment #5)
> > The solution was there all the time...
> > 
> > Use plain suffix for the original scripts leave them at original directories.
> > 
> 
> As stated in bug 492606, this breaks anything that relies on
> basename(sys.argv[0]) having a specific value. It's trading one type of
> breakage for another.

Please also don't forget that relying on basename(sys.argv[0]) is much more common and breaks important Gentoo packages. The few I can think of quickly are package managers and gentoolkit.