apache / cordova-plugman

Apache Cordova Plugman
https://cordova.apache.org/
Apache License 2.0
400 stars 151 forks source link

CB-6414 - fixes the issue where two config.xml munges exists, it will st... #72

Closed jbavari closed 10 years ago

jbavari commented 10 years ago

https://issues.apache.org/jira/browse/CB-6414

kamrik commented 10 years ago

Looks like the root of the problem is in config_keeper. The files there are identified by the "fake path" [see note], so when the same file is referenced as "config.xml" and "res/xml/config.xml", config keeper considers them to be two different files and changes for one of them get overwritten by the changes to the other.

I think it would be better to solve the problem in config_keeper rather than here, otherwise we might hit it again later with another file that might get referenced as two different names.

Maybe we could even go a level higher and avoid referring to the same file by two different names when generating the munge.

Anyway, if you decide to go with the current solution, please add a commend about what it does. Otherwise it is very cryptic.

[note] Fake path is constructed as project_root/file_name. It is used because deducing the full real path requires globbing which is very slow (tens of milliseconds in some cases). The assumption was that the same file will alway be referred to with the same file_name in the munges. This assumption is broken in this case.

agrieve commented 10 years ago

I did merge this in, but forgot to close it (@Josh, can you close it?).

Mark - sounds like that's a better approach. Could you make the change?

jbavari commented 10 years ago

I will close it @agrieve I have started looking into how the config_keeper is being used. I will try to figure it out still, however, I might not be as fast as @kamrik would be.

kamrik commented 10 years ago

The best thing would be to avoid the double naming altogether when the munge is generated, so that it's always config.xml or res/xml/config.xml. If that's possible.

I'll look into the config_keeper tomorrow. @jbavari, tell me if you've already solved it by then to avoid duplicate work.

purplecabbage commented 10 years ago

@jbavari Unrelated to this thread, you should add your name to github so readers of this thread can resolve jbavari == Josh Bavari, I was initially confused by @agrieve 's callout to @josh ( which is someone else ... ) This also applies to @agrieve ...