summaryrefslogtreecommitdiff
path: root/sysutils/bareos-server/files/patch-core-cmake_BareosInstallConfigFiles.cmake
blob: 2cafd3ea706f7525d42a26aa26a3969ccb8d079f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
--- core/cmake/BareosInstallConfigFiles.cmake	2019-02-13 09:25:55.000000000 -0500
+++ core/cmake/BareosInstallConfigFiles.cmake	2019-05-08 22:47:21.128268000 -0500
@@ -43,18 +43,9 @@
    get_filename_component(resname ${resdir} NAME)
    foreach(configfile ${configfiles})
       get_filename_component(fname ${configfile} NAME)
-      if (EXISTS ${DESTCONFDIR}/${resname}/${fname})
-         MESSAGE(STATUS "${DESTCONFDIR}/${resname}/${fname} exists")
-         MESSAGE(STATUS "rename ${configfile} to ${configfile}.new")
-         FILE (RENAME "${configfile}" "${configfile}.new")
-
-         MESSAGE(STATUS "copy ${configfile}.new to ${DESTCONFDIR}/${resname}")
-         FILE (INSTALL "${configfile}.new" DESTINATION "${DESTCONFDIR}/${resname}")
-         FILE (RENAME "${configfile}.new" "${configfile}")
-      else()
-         MESSAGE(STATUS "${resname}/${fname} as ${resname}/${fname} (new installation)")
-         FILE (COPY "${configfile}" DESTINATION "${DESTCONFDIR}/${resname}")
-      endif()
+      MESSAGE(STATUS "${resname}/${fname} as ${resname}/${fname}.sample (new installation)")
+      FILE (RENAME "${configfile}" "${configfile}.sample")
+      FILE (COPY "${configfile}.sample" DESTINATION "${DESTCONFDIR}/${resname}")
    endforeach()
 endforeach()
 
@@ -82,15 +73,9 @@
       get_filename_component(dir   ${configfile} DIRECTORY)
       get_filename_component(fname ${configfile} NAME)
 
-      if (EXISTS ${DESTCONFDIR}/${configfile})
-         MESSAGE(STATUS "${configfile} as ${configfile}.new (keep existing)")
-         FILE(RENAME "${BackendConfigSrcDir}/${configfile}" "${BackendConfigSrcDir}/${configfile}.new")
-         FILE(COPY   "${BackendConfigSrcDir}/${configfile}.new" DESTINATION "${DESTCONFDIR}/${dir}")
-         FILE(RENAME "${BackendConfigSrcDir}/${configfile}.new" "${BackendConfigSrcDir}/${configfile}")
-      else()
-         MESSAGE(STATUS "${configfile} as ${configfile}")
-         FILE(COPY "${BackendConfigSrcDir}/${configfile}" DESTINATION "${DESTCONFDIR}/${dir}")
-      endif()
+      MESSAGE(STATUS "${configfile} as ${configfile}")
+      FILE(RENAME "${BackendConfigSrcDir}/${configfile}" "${BackendConfigSrcDir}/${configfile}.sample")
+      FILE(COPY "${BackendConfigSrcDir}/${configfile}.sample" DESTINATION "${DESTCONFDIR}/${dir}")
    endforeach()
 
    file(GLOB_RECURSE configfiles RELATIVE "${BackendConfigSrcDir}" "${BackendConfigSrcDir}/*.example")
@@ -104,7 +89,8 @@
          MESSAGE(STATUS "${configfile} as ${configfile}")
       endif()
 
-      FILE(COPY "${BackendConfigSrcDir}/${configfile}" DESTINATION "${DESTCONFDIR}/${dir}")
+      FILE(RENAME "${BackendConfigSrcDir}/${configfile}" "${BackendConfigSrcDir}/${configfile}.sample")
+      FILE(COPY "${BackendConfigSrcDir}/${configfile}.sample" DESTINATION "${DESTCONFDIR}/${dir}")
    endforeach()
 
 ENDFOREACH()
@@ -122,15 +108,9 @@
          STRING(REGEX MATCH "\\.in\$" IS_INFILE ${configfile})
          if (NOT "${IS_INFILE}" STREQUAL ".in")
             get_filename_component(fname ${configfile} NAME)
-            if (EXISTS ${DESTCONFDIR}/${resname}/${fname})
-               MESSAGE(STATUS "${resname}/${fname} as ${resname}/${fname}.new (keep existing)")
-               FILE (RENAME "${configfile}" "${configfile}.new")
-               FILE (COPY "${configfile}.new" DESTINATION "${DESTCONFDIR}/${resname}")
-               FILE (RENAME "${configfile}.new" "${configfile}")
-            else()
-               MESSAGE(STATUS "${resname}/${fname} as ${resname}/${fname}")
-               FILE (COPY "${configfile}" DESTINATION "${DESTCONFDIR}/${resname}")
-            endif()
+            MESSAGE(STATUS "${resname}/${fname} as ${resname}/${fname}")
+            FILE (RENAME "${configfile}" "${configfile}.sample")
+            FILE (COPY "${configfile}.sample" DESTINATION "${DESTCONFDIR}/${resname}")
          else()
             MESSAGE(STATUS "skipping .in file ${configfile}:${IS_INFILE}")
          endif()