diff options
author | Jonathan Bauer | 2013-08-01 18:37:39 +0200 |
---|---|---|
committer | Jonathan Bauer | 2013-08-01 18:37:39 +0200 |
commit | 43f419a4f85fadeacfd3eb2d2b7e82449468fb5e (patch) | |
tree | 7a509bb0a8bd0e99aa760dad68b7796fe5bf73ac /server/export_target | |
parent | [server/export_target] move the check for the validity of the given config in... (diff) | |
download | tm-scripts-43f419a4f85fadeacfd3eb2d2b7e82449468fb5e.tar.gz tm-scripts-43f419a4f85fadeacfd3eb2d2b7e82449468fb5e.tar.xz tm-scripts-43f419a4f85fadeacfd3eb2d2b7e82449468fb5e.zip |
[generate_config] fix broken file checking
Diffstat (limited to 'server/export_target')
-rwxr-xr-x | server/export_target | 11 |
1 files 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. |