Skip to content
This repository has been archived by the owner on Aug 2, 2020. It is now read-only.

Improves matching filenames #69

Closed
wants to merge 2 commits into from
Closed

Improves matching filenames #69

wants to merge 2 commits into from

Conversation

angerman
Copy link
Collaborator

We currently only match on the file name. If multiple candidates exist,
this patch tries to compare their parent directry to find a better match.

We currently only match on the file name. If multiple candidates exist,
this patch tries to compare their parent directry to find a better match.
@angerman
Copy link
Collaborator Author

This is quite bad. Any suggestions / feedback how to do this better is welcome.

@angerman
Copy link
Collaborator Author

Ideally I think the function should look like:

bestMatch :: FilePath -> [(FilePath, Builder)] -> (FilePath, Builder)

@snowleopard
Copy link
Owner

@angerman Thanks! I'll experiment with this and see how your solution can be improved.

Does this solve the unix problem for you?

@angerman
Copy link
Collaborator Author

Yes. Now stuck with integer-gmp, see #71.

@angerman
Copy link
Collaborator Author

Improved the matching. We basically generate all possible suffixes and try to find the match with the longest suffix.

snowleopard added a commit that referenced this pull request Dec 31, 2015
@snowleopard
Copy link
Owner

@angerman Please test 6c80bd8. I think it is more robust because we know exactly what we match: generated file without the buildPath prefix. No need to try different possible suffixes. It's also simpler.

snowleopard added a commit that referenced this pull request Dec 31, 2015
@snowleopard
Copy link
Owner

Sorry, another small fix: 26cd11f.

@snowleopard
Copy link
Owner

I think we can close this now.

@snowleopard snowleopard closed this Jan 1, 2016
@angerman angerman deleted the feature/betterMatch branch January 4, 2016 14:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants