Merge lp:~larryprice/cmake-extras/fix-filtering into lp:cmake-extras

Proposed by Larry Price on 2017-03-24
Status: Superseded
Proposed branch: lp:~larryprice/cmake-extras/fix-filtering
Merge into: lp:cmake-extras
Diff against target: 35 lines (+7/-3)
2 files modified
examples/intltool-demo/po/CMakeLists.txt (+1/-1)
src/Intltool/IntltoolConfig.cmake (+6/-2)
To merge this branch: bzr merge lp:~larryprice/cmake-extras/fix-filtering
Reviewer Review Type Date Requested Status
Pete Woods 2017-03-24 Approve on 2017-04-03
Review via email:

This proposal has been superseded by a proposal from 2017-04-03.

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 :

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

Pete Woods (pete-woods) :
review: Needs Fixing
74. By Larry Price on 2017-03-27

Add an additional filter item (breaks old test, fixed by this MP)

Larry Price (larryprice) wrote :

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 :

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

review: Approve
Pete Woods (pete-woods) wrote :

Sadly your branches trivially conflict with each other.

Unmerged revisions

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-02-22 19:59:32 +0000
3+++ examples/intltool-demo/po/CMakeLists.txt 2017-03-27 20:47:33 +0000
4@@ -5,7 +5,7 @@
8- FILTER ".*test.*"
9+ FILTER ".*test.*;.*filtered"
10 )
12 intltool_install_translations(
14=== modified file 'src/Intltool/IntltoolConfig.cmake'
15--- src/Intltool/IntltoolConfig.cmake 2017-02-28 17:46:57 +0000
16+++ src/Intltool/IntltoolConfig.cmake 2017-03-27 20:47:33 +0000
17@@ -173,12 +173,16 @@
19 set(_TMP "")
20 foreach(_ITEM ${${INPUT}})
21+ unset(_MATCHED)
22 foreach(_REGEX ${_ARG_EXPRESSIONS})
23 if("${_ITEM}" MATCHES "${_REGEX}")
24- else()
25- list(APPEND _TMP "${_ITEM}")
26+ set(_MATCHED ON)
27+ break()
28 endif()
29 endforeach()
30+ if(NOT _MATCHED)
31+ list(APPEND _TMP "${_ITEM}")
32+ endif()
33 endforeach()
34 set(${OUTPUT} "${_TMP}" PARENT_SCOPE)
35 unset(_TMP)


People subscribed via source and target branches

to all changes: