Selaa lähdekoodia

Warn explicitly about configuration file updates

The configuration file will never be overwritten automatically.
Therefore, changes need to be applied by the user manually.
tags/1.3
Timo Röhling 9 vuotta sitten
vanhempi
commit
bcc6c2ba9a
3 muutettua tiedostoa jossa 30 lisäystä ja 3 poistoa
  1. 1
    1
      CMakeLists.txt
  2. 15
    0
      README_UPGRADE.md
  3. 14
    2
      postinstall.cmake.in

+ 1
- 1
CMakeLists.txt Näytä tiedosto

@@ -100,6 +100,6 @@ if(USE_APPARMOR)
100 100
 endif()
101 101
 
102 102
 install(TARGETS ${PROJECT_NAME} DESTINATION "sbin")
103
-install(FILES README.md main.cf.ex DESTINATION "${DOC_DIR}")
103
+install(FILES README.md README_UPGRADE.md main.cf.ex DESTINATION "${DOC_DIR}")
104 104
 install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/postinstall.cmake")
105 105
 

+ 15
- 0
README_UPGRADE.md Näytä tiedosto

@@ -0,0 +1,15 @@
1
+PostSRSd Upgrade Note
2
+=====================
3
+
4
+/etc/default/postsrsd
5
+---------------------
6
+
7
+The shipped configuration file has changed from previous versions.
8
+However, the installer will not automatically overwrite existing
9
+configuration files to prevent data loss.
10
+
11
+Please review the changes after the installation and update your
12
+configuration file accordingly. Note in particular, that most options
13
+may no longer remain commented out, since it was cumbersome to maintain 
14
+all the default values in the various startup scripts.
15
+

+ 14
- 2
postinstall.cmake.in Näytä tiedosto

@@ -15,8 +15,20 @@ if(CHROOT_DIR AND NOT EXISTS "$ENV{DESTDIR}${CHROOT_DIR}")
15 15
 	file(MAKE_DIRECTORY "$ENV{DESTDIR}${CHROOT_DIR}")
16 16
 endif()
17 17
 
18
-if(INIT_FLAVOR AND NOT EXISTS "$ENV{DESTDIR}${CONFIG_DIR}/@PROJECT_NAME@")
19
-	file(INSTALL FILES "@CMAKE_CURRENT_BINARY_DIR@/@PROJECT_NAME@.default" DESTINATION "${CONFIG_DIR}" RENAME "@PROJECT_NAME@")
18
+if(INIT_FLAVOR)
19
+	if (NOT EXISTS "$ENV{DESTDIR}${CONFIG_DIR}/@PROJECT_NAME@")
20
+		file(INSTALL FILES "@CMAKE_CURRENT_BINARY_DIR@/@PROJECT_NAME@.default" DESTINATION "${CONFIG_DIR}" RENAME "@PROJECT_NAME@")
21
+	else()
22
+		file(INSTALL FILES "@CMAKE_CURRENT_BINARY_DIR@/@PROJECT_NAME@.default" DESTINATION "${CONFIG_DIR}" RENAME "@PROJECT_NAME@.new")
23
+		message(STATUS "")
24
+		message(STATUS "*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*")
25
+		message(STATUS "*!* ${CONFIG_DIR}/@PROJECT_NAME@ will NOT be overwritten!")
26
+		message(STATUS "*!* Please note the changes from @PROJECT_NAME@.new in the same folder and")
27
+		message(STATUS "*!* update your configuration accordinly.")
28
+		message(STATUS "*!* See also README_UPGRADE.md for details")
29
+		message(STATUS "*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*")
30
+		message(STATUS "")
31
+	endif()
20 32
 endif()
21 33
 
22 34
 if(INIT_FLAVOR STREQUAL "sysv-lsb")

Loading…
Peruuta
Tallenna