Merge lp:~pete-woods/cmake-extras/fix-filtering into lp:cmake-extras

Proposed by Pete Woods on 2017-04-03
Status: Merged
Approved by: Pete Woods on 2017-04-03
Approved revision: 75
Merged at revision: 75
Proposed branch: lp:~pete-woods/cmake-extras/fix-filtering
Merge into: lp:cmake-extras
Prerequisite: lp:~larryprice/cmake-extras/multiple-programming-languages
Diff against target: 40 lines (+7/-4)
2 files modified
examples/intltool-demo/po/CMakeLists.txt (+1/-2)
src/Intltool/IntltoolConfig.cmake (+6/-2)
To merge this branch: bzr merge lp:~pete-woods/cmake-extras/fix-filtering
Reviewer Review Type Date Requested Status
Pete Woods Approve on 2017-04-03
Review via email: mp+321726@code.launchpad.net

This proposal supersedes a proposal from 2017-03-24.

Commit message

Intltool filtering should filter out files that match any regex.

Description of the change

Intltool filtering should filter out files that match any regex. The current behavior is that any file that *does not match* one regex from the given expressions will be allowed into the filtered list.

To post a comment you must log in.
Pete Woods (pete-woods) wrote : Posted in a previous version of this proposal

As per the other review. Your fix looks good, but please add a regression test for it.

Pete Woods (pete-woods) : Posted in a previous version of this proposal
review: Needs Fixing
Larry Price (larryprice) wrote : Posted in a previous version of this proposal

Thanks for giving it a once-over. I changed the FILTER in the test to a list, which broke the original filter test. By adding in this MP, the filter test is fixed. Let me know if you would prefer an individual new test as well.

Pete Woods (pete-woods) wrote : Posted in a previous version of this proposal

No, that's totally fine. Thanks for the red-green explanation :)

review: Approve
Pete Woods (pete-woods) wrote : Posted in a previous version of this proposal

Sadly your branches trivially conflict with each other.

Pete Woods (pete-woods) wrote :

I've resubmitted this proposal with the conflicts resolved

Pete Woods (pete-woods) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'examples/intltool-demo/po/CMakeLists.txt'
2--- examples/intltool-demo/po/CMakeLists.txt 2017-04-03 15:31:40 +0000
3+++ examples/intltool-demo/po/CMakeLists.txt 2017-04-03 15:31:40 +0000
4@@ -5,7 +5,7 @@
5 GETTEXT_PACKAGE ${GETTEXT_PACKAGE}
6 COPYRIGHT_HOLDER "Foocorp Ltd."
7 FILE_GLOBS "${CMAKE_SOURCE_DIR}/*.gschema.xml.in;${CMAKE_SOURCE_DIR}/python/*.py"
8- FILTER ".*test.*"
9+ FILTER ".*test.*;.*filtered"
10 LANGUAGE "python"
11 )
12
13@@ -13,4 +13,3 @@
14 ALL
15 GETTEXT_PACKAGE ${GETTEXT_PACKAGE}
16 )
17-
18
19=== modified file 'src/Intltool/IntltoolConfig.cmake'
20--- src/Intltool/IntltoolConfig.cmake 2017-04-03 15:31:40 +0000
21+++ src/Intltool/IntltoolConfig.cmake 2017-04-03 15:31:40 +0000
22@@ -180,12 +180,16 @@
23 if(_ARG_EXPRESSIONS)
24 set(_TMP "")
25 foreach(_ITEM ${${INPUT}})
26+ unset(_MATCHED)
27 foreach(_REGEX ${_ARG_EXPRESSIONS})
28 if("${_ITEM}" MATCHES "${_REGEX}")
29- else()
30- list(APPEND _TMP "${_ITEM}")
31+ set(_MATCHED ON)
32+ break()
33 endif()
34 endforeach()
35+ if(NOT _MATCHED)
36+ list(APPEND _TMP "${_ITEM}")
37+ endif()
38 endforeach()
39 set(${OUTPUT} "${_TMP}" PARENT_SCOPE)
40 unset(_TMP)

Subscribers

People subscribed via source and target branches

to all changes: