Skip to content

Commit

Permalink
droplet: install droplet profile examples
Browse files Browse the repository at this point in the history
  • Loading branch information
joergsteffens committed Nov 30, 2018
1 parent 33bc3e0 commit 97b010e
Showing 1 changed file with 30 additions and 22 deletions.
52 changes: 30 additions & 22 deletions core/cmake/BareosInstallConfigFiles.cmake
Expand Up @@ -58,33 +58,41 @@ endif()



FOREACH (BACKEND ${BACKENDS})
MESSAGE(STATUS "install ${CONFIGBASEDIRECTORY} config files for BACKEND ${BACKEND}")
set(BackendConfigSrcDir "${SRC_DIR}/src/stored/backends/${BACKEND}/${CONFIGBASEDIRECTORY}")

file(GLOB_RECURSE configfiles RELATIVE "${BackendConfigSrcDir}" "${BackendConfigSrcDir}/*.conf")
foreach(configfile ${configfiles})
get_filename_component(dir ${configfile} DIRECTORY)
get_filename_component(fname ${configfile} NAME)

# install configs from sd backends
FOREACH (BACKEND ${BACKENDS})
MESSAGE(STATUS "install config files for BACKEND ${BACKEND}")
file(GLOB resourcedirs "${SRC_DIR}/src/stored/backends/${BACKEND}/${CONFIGBASEDIRECTORY}/*")
MESSAGE(STATUS "globbing ${SRC_DIR}/src/stored/backends/${BACKEND}/${CONFIGBASEDIRECTORY}/")
foreach(resdir ${resourcedirs})
MESSAGE(STATUS "install config files for BACKEND ${BACKEND} ${resdir}")
file(GLOB configfiles "${resdir}/*.conf*")
get_filename_component(resname ${resdir} NAME)
foreach(configfile ${configfiles})
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()
endforeach()
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()
endforeach()

ENDFOREACH()
file(GLOB_RECURSE configfiles RELATIVE "${BackendConfigSrcDir}" "${BackendConfigSrcDir}/*.example")
foreach(configfile ${configfiles})
get_filename_component(dir ${configfile} DIRECTORY)
#get_filename_component(fname ${configfile} NAME)

if (EXISTS ${DESTCONFDIR}/${configfile})
MESSAGE(STATUS "overwriting ${configfile}")
else()
MESSAGE(STATUS "${configfile} as ${configfile}")
endif()

FILE(COPY "${BackendConfigSrcDir}/${configfile}" DESTINATION "${DESTCONFDIR}/${dir}")
endforeach()

ENDFOREACH()



Expand Down

0 comments on commit 97b010e

Please sign in to comment.