Skip to content
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

Avoid calling GPSBabel if the input and output are both gpx files #18

Closed
wants to merge 1 commit into from

Conversation

huobos
Copy link
Contributor

@huobos huobos commented Jan 20, 2017

GPSBabel fails to import GPX file with spaces and Chinese in its name. It's better avoid calling it if the input and output are both GPX files.

@gdt
Copy link

gdt commented Jan 20, 2017

Are you sure that the behavior will be identical in all cases? GPSBabel seems to also normalize and clean up gpx, so gpx->gpx transforms are not necessarily pointless. I really don't understand the details here, but the commit message does not explain enough for a reader to understand.

It seems better to fix GPSBabel.

@huobos
Copy link
Contributor Author

huobos commented Jan 21, 2017 via email

@rnorris
Copy link
Collaborator

rnorris commented Jan 21, 2017

GPSBabel handles files with spaces, but you'll need to quote files like "file name.gpx".
This happens transparently in Viking as we invoke GPSBabel via g_spawn_async_with_pipes () which does that for us.

However for 'exotic' filenames such as 'æ.gpx' or similar then possibly GPSBabel can fail.

I think this occurs for Qt4 builds of GPSBabel such as the current version 1.5.3 on Debian AMD64. I guess old versions pre the use of Qt (such as GPSBabel 1.3?) might work correctly.

However if you use the latest git head source code GPSBabel (which is now Qt5 only) it now works.

@huobos
Copy link
Contributor Author

huobos commented Jan 22, 2017

So this code is not neccesary.

@huobos huobos closed this Jan 22, 2017
@huobos huobos deleted the GPSBabel branch January 22, 2017 09:44
@gdt
Copy link

gdt commented Jan 22, 2017

I didn't mean to say I was sure it wasn't a good idea. Just that a change, especially to work around a bug that should be fixed, should clearly explain what the impact on behavior is.

When gpsbabel was a regular program, viking depending on it seemed fine. But now that it drags in qt5, I think we should reconsider. So the idea that gpx is the native format, and gpsbabel isn't used could make a lot of sense. Then, gpsbabel could be not really a dependency, and the other formats could use it if asked for, and warn if not installed.

Really what I am raising is the notion of having viking packages not depend on gpsbabel.

@rnorris
Copy link
Collaborator

rnorris commented Jan 22, 2017

GPSBabel is not an explicit dependency, just highly recommended.

@gdt
Copy link

gdt commented Jan 22, 2017

Thanks. Then I will drop it from the viking package in pkgsrc. People who want it can install it. Presumably it doesn't need to be there at configure/build time.

@gdt
Copy link

gdt commented Jan 22, 2017

And in that case, if the above patch or similar means that viking can open gpx files without gpsbabel, I think that would be a great improvement.

@rnorris
Copy link
Collaborator

rnorris commented Jan 22, 2017

Viking doesn't need GPSBabel at configure or build time.

It tries to detect it at runtime and stuff that would use it is generally disabled or at worst some kind of error message about the functionality not working correctly when the action is attempted.

I believe Viking has never needed GPSBabel to open GPX files, but since GPX is a format supported by GPSBabel you can force loading a GPX file via the File->Acquire->Import File with GPSBabel... route - should you desire to do so!

This patch probably would override that and so is not desired.

@gdt
Copy link

gdt commented Jan 22, 2017

Thank you for the explanation. It then sounds like all is well code wise in viking, and it's ok for my package to not force gpsbabel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants