Skip to content

Commit 259fda7

Browse files
committed
refactor: remove trigger handler script and simplify reload logic
1. Removed INSTALL_DEBIAN_TRIGGER CMake option and associated trigger handler script 2. Simplified post-install trigger handling by directly calling D-Bus reload interface 3. Eliminated intermediate script layer for more direct and reliable configuration reloads 4. Updated Debian packaging rules to reflect these changes The changes were made to: - Reduce maintenance overhead by removing an unnecessary script layer - Improve reliability by directly interacting with D-Bus service - Simplify the configuration reload process - Remove unused build configuration option refactor: 移除触发器处理脚本并简化重载逻辑 1. 移除了INSTALL_DEBIAN_TRIGGER CMake选项及相关触发器处理脚本 2. 简化了安装后触发器处理,直接调用D-Bus重载接口 3. 消除了中间脚本层,使配置重载更直接可靠 4. 更新了Debian打包规则以反映这些变更 这些变更是为了: - 通过移除不必要的脚本层减少维护开销 - 通过直接与D-Bus服务交互提高可靠性 - 简化配置重载流程 - 移除未使用的构建配置选项
1 parent b0e37fa commit 259fda7

5 files changed

Lines changed: 12 additions & 61 deletions

File tree

dconfig-center/dde-dconfig-daemon/CMakeLists.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
find_package(Qt${QT_VERSION_MAJOR} ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Core DBus)
66
find_package(Dtk${DTK_VERSION_MAJOR}Core REQUIRED)
77

8-
option(INSTALL_DEBIAN_TRIGGER "Install dconfig trigger handler script" OFF)
9-
108
# generate moc_predefs.h
119
set(CMAKE_AUTOMOC ON)
1210
set(AUTOMOC_COMPILER_PREDEFINES ON)
@@ -44,8 +42,3 @@ install(FILES services/dde-dconfig-daemon.service DESTINATION ${CMAKE_INSTALL_PR
4442

4543
## bin
4644
install(TARGETS dde-dconfig-daemon DESTINATION ${CMAKE_INSTALL_BINDIR})
47-
48-
## trigger handler scripts
49-
if(INSTALL_DEBIAN_TRIGGER)
50-
install(PROGRAMS scripts/dde-dconfig-daemon-reload-handler DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/dde-dconfig-daemon)
51-
endif()

dconfig-center/dde-dconfig-daemon/scripts/dde-dconfig-daemon-reload-handler

Lines changed: 0 additions & 48 deletions
This file was deleted.

debian/dde-dconfig-daemon.install

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ usr/share/dbus-1/interfaces/*
77
usr/share/dbus-1/system-services/*
88
usr/share/dde-dconfig/translations/*
99
usr/lib/systemd/system/*
10-
usr/lib/dde-dconfig-daemon/*

debian/dde-dconfig-daemon.postinst

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,18 @@ set -e
33

44
# Handle dconfig triggers
55
if [ "$1" = "triggered" ]; then
6-
# Call reload handler when triggered
7-
if [ -x /usr/lib/dde-dconfig-daemon/dde-dconfig-daemon-reload-handler ]; then
8-
/usr/lib/dde-dconfig-daemon/dde-dconfig-daemon-reload-handler
6+
# Call reload interface directly via D-Bus
7+
if dbus-send --system \
8+
--dest="org.desktopspec.ConfigManager" \
9+
--type=method_call \
10+
"/" \
11+
"org.desktopspec.ConfigManager.reload" >/dev/null 2>&1; then
12+
logger -t "dde-dconfig-daemon" "Configuration trigger detected, reload completed successfully" 2>/dev/null || true
13+
echo "Configuration trigger detected, reload completed successfully"
914
else
10-
echo "Warning: dde-dconfig-daemon-reload-handler not found or not executable"
15+
logger -t "dde-dconfig-daemon" -p daemon.err "Configuration trigger detected, reload failed" 2>/dev/null || true
16+
echo "ERROR: Configuration trigger detected, reload failed" >&2
17+
exit 1
1118
fi
1219
fi
1320

debian/rules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z
1212
dh $@ --parallel
1313

1414
override_dh_auto_configure:
15-
dh_auto_configure -- -DDVERSION=$(DEB_VERSION_UPSTREAM) -DDTK_VERSION=6 -DINSTALL_DEBIAN_TRIGGER=ON
15+
dh_auto_configure -- -DDVERSION=$(DEB_VERSION_UPSTREAM) -DDTK_VERSION=6
1616

1717

1818
override_dh_auto_install:

0 commit comments

Comments
 (0)