From e71905763d0c1856fe245a4c27be9fc694cd92ee Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Fri, 19 Feb 2016 19:14:45 +0100 Subject: Add support for global application specific filter definitions i.e. `change` now tries to read a filter definition file matching the current process' name from `/usr/local/share/libChangeLog/filter`. --- CMakeLists.txt | 47 ++++++++++++++++++++++++++++++++++------------- change | 4 +++- 2 files changed, 37 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a7cfb5f..f92c549 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,31 +13,52 @@ include_directories( add_library( ChangeLog SHARED - src/main.cc - src/bootstrap.cc - src/init/alloc.cc - src/utility/io.cc - src/utility/logger.cc - src/tracking/path_matcher.cc - src/tracking/change_tracker.cc + src/main.cc + src/bootstrap.cc + src/init/alloc.cc + src/utility/io.cc + src/utility/logger.cc + src/tracking/path_matcher.cc + src/tracking/change_tracker.cc ) target_link_libraries( ChangeLog - boost_system - boost_filesystem + boost_system + boost_filesystem ) install( PROGRAMS - change + change DESTINATION - bin + bin ) install( TARGETS - ChangeLog + ChangeLog LIBRARY DESTINATION - lib + lib +) + +install( + DIRECTORY DESTINATION + share/libChangeLog + DIRECTORY_PERMISSIONS + OWNER_READ OWNER_WRITE OWNER_EXECUTE + GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE +) + +install( + DIRECTORY + src/filter + DESTINATION + share/libChangeLog + FILE_PERMISSIONS + OWNER_READ OWNER_WRITE + GROUP_READ WORLD_READ + PATTERN + "filter/*.filter" ) diff --git a/change b/change index c53dadb..8d68ee3 100755 --- a/change +++ b/change @@ -1,7 +1,9 @@ #!/usr/bin/bash +readonly FILTER_PATH="/usr/local/share/libChangeLog/filter" + export CHANGE_LOG_TARGET="/tmp/$(basename $0).$$.tmp" -export CHANGE_LOG_IGNORE_PATTERN_PATH=".change_log_ignore" +export CHANGE_LOG_IGNORE_PATTERN_PATH="$FILTER_PATH/$(basename $1).filter" LD_PRELOAD=libChangeLog.so eval "$@" -- cgit v1.2.3