summaryrefslogtreecommitdiff
path: root/sysutils/bareos-server/files/patch-core-cmake_BareosInstallConfigFiles.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils/bareos-server/files/patch-core-cmake_BareosInstallConfigFiles.cmake')
-rw-r--r--sysutils/bareos-server/files/patch-core-cmake_BareosInstallConfigFiles.cmake72
1 files changed, 72 insertions, 0 deletions
diff --git a/sysutils/bareos-server/files/patch-core-cmake_BareosInstallConfigFiles.cmake b/sysutils/bareos-server/files/patch-core-cmake_BareosInstallConfigFiles.cmake
new file mode 100644
index 000000000000..2cafd3ea706f
--- /dev/null
+++ b/sysutils/bareos-server/files/patch-core-cmake_BareosInstallConfigFiles.cmake
@@ -0,0 +1,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()