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
=== modified file 'examples/intltool-demo/po/CMakeLists.txt'
--- examples/intltool-demo/po/CMakeLists.txt 2017-04-03 15:31:40 +0000
+++ examples/intltool-demo/po/CMakeLists.txt 2017-04-03 15:31:40 +0000
@@ -5,7 +5,7 @@
5 GETTEXT_PACKAGE ${GETTEXT_PACKAGE}5 GETTEXT_PACKAGE ${GETTEXT_PACKAGE}
6 COPYRIGHT_HOLDER "Foocorp Ltd."6 COPYRIGHT_HOLDER "Foocorp Ltd."
7 FILE_GLOBS "${CMAKE_SOURCE_DIR}/*.gschema.xml.in;${CMAKE_SOURCE_DIR}/python/*.py"7 FILE_GLOBS "${CMAKE_SOURCE_DIR}/*.gschema.xml.in;${CMAKE_SOURCE_DIR}/python/*.py"
8 FILTER ".*test.*"8 FILTER ".*test.*;.*filtered"
9 LANGUAGE "python"9 LANGUAGE "python"
10)10)
1111
@@ -13,4 +13,3 @@
13 ALL13 ALL
14 GETTEXT_PACKAGE ${GETTEXT_PACKAGE}14 GETTEXT_PACKAGE ${GETTEXT_PACKAGE}
15)15)
16
1716
=== modified file 'src/Intltool/IntltoolConfig.cmake'
--- src/Intltool/IntltoolConfig.cmake 2017-04-03 15:31:40 +0000
+++ src/Intltool/IntltoolConfig.cmake 2017-04-03 15:31:40 +0000
@@ -180,12 +180,16 @@
180 if(_ARG_EXPRESSIONS)180 if(_ARG_EXPRESSIONS)
181 set(_TMP "")181 set(_TMP "")
182 foreach(_ITEM ${${INPUT}})182 foreach(_ITEM ${${INPUT}})
183 unset(_MATCHED)
183 foreach(_REGEX ${_ARG_EXPRESSIONS})184 foreach(_REGEX ${_ARG_EXPRESSIONS})
184 if("${_ITEM}" MATCHES "${_REGEX}")185 if("${_ITEM}" MATCHES "${_REGEX}")
185 else()186 set(_MATCHED ON)
186 list(APPEND _TMP "${_ITEM}")187 break()
187 endif()188 endif()
188 endforeach()189 endforeach()
190 if(NOT _MATCHED)
191 list(APPEND _TMP "${_ITEM}")
192 endif()
189 endforeach()193 endforeach()
190 set(${OUTPUT} "${_TMP}" PARENT_SCOPE)194 set(${OUTPUT} "${_TMP}" PARENT_SCOPE)
191 unset(_TMP)195 unset(_TMP)

Subscribers

People subscribed via source and target branches

to all changes: