-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why some absolute paths have double slashes? #115
Comments
I appreciate that you're interested in fixing this issue. It's a complicated issue, though. I understand that the double slashes look odd but they are not a bug. The POSIX standard allows multiple slashes. They are equivalent to a single slash. The only exception to this is when two slashes appear at the beginning of a path. A double slash at the beginning has no standard meaning and is left to the implementation. Linux always treats double slashes at the beginning of a path as a single slash. So while the paths may look wrong, they are considered correct and acceptable paths. The main reason why this happens in Admittedly, it is rare that an RPM plugin would do this kind of injection. There is only one case that I know of and it is handled here. If we assume that no plugins are injecting path values then the code could avoid using macros to join paths and instead use Python variables and Personally, I think the "always add a slash" method works as expected and without the need to normalize all paths. The only downside is that it looks strange. I'm hesitant to change the current behavior because it would be a fairly big change to the code just to make the generated paths look better. However, If you can demonstrate a scenario where the double slashes cause a bug when building or installing an RPM then I may be persuaded to consider a change. |
I've noticed that some of absolute paths in generated spec and shebangs have doubled slash, e.g. I have files section with config and spec shows:
Also shebang of my script
/usr/bin/python
has changed to#!/opt/my-company//my-app/bin/python
.Probably that's not problem but my daemon in the output of
top
then shows this double slashed path, which I don't like honestly to say.Also, due to this problem I have to set parent directory in
rpmvenv.json
without first slash, e.g.I'd like to fix this if you provide some hints. I suppose all paths need to be processed via
os.path.normpath
.The text was updated successfully, but these errors were encountered: