Don't be fatal on File field not being properly parsed
ClosedPublic

Authored by apol on Nov 2 2016, 12:06 PM.

Details

Summary

Fallback on trying the same filename as the actual file.
There were some regressions due to the former matching expression:
string(REGEX REPLACE "^(.*\n)?File=([^\n]+kcfg).*\n.*$" "\\2" _kcfg_FILENAME "${_contents}")

This one would allow for the File field to be the kcfgc file (which doesn't
make sense).
With this patch we're not reproducing this behaviour, but we're allowing for the
things that aren't building to work. After all, most kcfg and kcfgc files share
the same name.

Diff Detail

Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
apol updated this revision to Diff 7824.Nov 2 2016, 12:06 PM
apol retitled this revision from to Don't be fatal on File field not being properly parsed.
apol updated this object.
apol edited the test plan for this revision. (Show Details)
apol added a reviewer: Frameworks.
kfunk added a subscriber: kfunk.Nov 2 2016, 12:29 PM
kfunk added inline comments.
KF5ConfigMacros.cmake
71

I suggest to add some commentary here.

apol updated this revision to Diff 7826.Nov 2 2016, 12:46 PM

Dropped weird regex change

apol marked an inline comment as done.Nov 2 2016, 12:46 PM
apol added inline comments.
KF5ConfigMacros.cmake
71

Right, actually I was thinking of removing this part as the fallback fixes the issues we found.

aacid added a subscriber: aacid.Nov 2 2016, 9:53 PM

If the file is broken maybe we should just fail in a more understandable way so people fix their software?

apol marked an inline comment as done.Nov 2 2016, 11:44 PM
In D3226#60186, @aacid wrote:

If the file is broken maybe we should just fail in a more understandable way so people fix their software?

The best way so people get to fix their software would be just to change the WARNING for a FATAL_ERROR. If you have a good idea of how to fail better, I'll be happy to include it.

Maybe look for File= and then make sure it's a kcfg file separately?

davidedmundson accepted this revision.Nov 3 2016, 10:50 AM
davidedmundson added a reviewer: davidedmundson.
This revision is now accepted and ready to land.Nov 3 2016, 10:50 AM
apol closed this revision.Nov 3 2016, 2:25 PM