From 43f419a4f85fadeacfd3eb2d2b7e82449468fb5e Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Thu, 1 Aug 2013 18:37:39 +0200 Subject: [generate_config] fix broken file checking --- server/export_target | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/server/export_target b/server/export_target index 37a74b55..e74db2d3 100755 --- a/server/export_target +++ b/server/export_target @@ -87,9 +87,9 @@ generate_config() { pinfo "Generating config.tgz for '${SERVER_CONFIG_TYPE}'" # check if SERVER_EXPORT_TARGET is valid - [ ! -z "${SERVER_EXPORT_CONFIG}" ] || perror "Server export config not given!" - [ -d "${SERVER_CONFIGS_DIR}/${SERVER_EXPORT_CONFIG}" ] || \ - perror "Given export config not found: ${SERVER_CONFIGS_DIR}/${SERVER_EXPORT_CONFIG}" + [ ! -z "${SERVER_CONFIG_TYPE}" ] || perror "Server export config not given!" + [ -d "${SERVER_CONFIGS_DIR}/${SERVER_CONFIG_TYPE}" ] || \ + perror "Given export config not found: ${SERVER_CONFIGS_DIR}/${SERVER_CONFIG_TYPE}" # directory where the activated modules are given # ex: server/configs/freiburg/ @@ -116,7 +116,7 @@ generate_config() { cd "${TARGET_CONFIG_DIR}/${MODULE_CONFIG}" || perror "\tCould not cd to '${TARGET_CONFIG_DIR}/${MODULE_CONFIG}'" # check if files are already in another module config - for FILE in $(find . -type f); do + for FILE in $(find . -type f | cut -c 3-); do # check for all the archives we find in TARGET_CONFIG_BUILD_DIR for ARCHIV in $(ls "${TARGET_CONFIG_BUILD_DIR}/"*.tar 2>/dev/null); do if [ "x$(tar tvf "${ARCHIV}" | grep "$FILE")" != "x" ]; then @@ -131,9 +131,10 @@ generate_config() { done # no conflict, add file to archive + pinfo "${TARGET_CONFIG_BUILD_DIR}/${MODULE_CONFIG}.tar" tar cf "${TARGET_CONFIG_BUILD_DIR}/${MODULE_CONFIG}.tar" $(ls) RET=$? - [ "x$RET" != "x0" ] && perror "\tCould not create '${TARGET_CONFIG_BUILD_DIR}/${MODULE_CONFIG}.tgz'" + [ "x$RET" != "x0" ] && perror "\tCould not create '${TARGET_CONFIG_BUILD_DIR}/${MODULE_CONFIG}.tar'" done # now we have packed all configs separately and can concatenate them all together. -- cgit v1.2.3-55-g7522