diff options
author | Yehonal <yehonal.azeroth@gmail.com> | 2016-08-30 15:28:01 +0200 |
---|---|---|
committer | Yehonal <yehonal.azeroth@gmail.com> | 2016-08-30 15:28:01 +0200 |
commit | 925defe406520f61fc4753c072560f1f17032431 (patch) | |
tree | c4a972b540c3d790f5d83277866f1f262bfc8357 /bin | |
parent | 2cf4e06e01a758dae20e6b493af79bc53d1772c6 (diff) | |
parent | c556918797792567370ad6ce1150a9e2458ddc5f (diff) |
Merge branch 'master' of https://github.com/azerothcore/azerothcore-wotlk.git
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/db_assembler/db_assembler.sh | 71 | ||||
-rwxr-xr-x | bin/db_pendings/import.sh | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | bin/runners/run-engine | 0 |
3 files changed, 35 insertions, 38 deletions
diff --git a/bin/db_assembler/db_assembler.sh b/bin/db_assembler/db_assembler.sh index c060988b64..74902ab729 100755 --- a/bin/db_assembler/db_assembler.sh +++ b/bin/db_assembler/db_assembler.sh @@ -27,22 +27,25 @@ fi function assemble() { # to lowercase - database=$1 + database=${1,,} start_sql=$2 with_base=$3 with_updates=$4 with_custom=$5 - var_base="DB_"$database"_PATHS" - base=${!var_base} + uc=${database^^} - var_updates="DB_"$database"_UPDATE_PATHS" - updates=${!var_updates} + name="DB_"$uc"_PATHS" + v="$name[@]" + base=("${!v}") - var_custom="DB_"$database"_CUSTOM_PATHS" - custom=${!var_custom} + name="DB_"$uc"_UPDATE_PATHS" + v="$name[@]" + updates=("${!v}") - echo $updates + name='DB_'$uc'_CUSTOM_PATHS' + v="$name[@]" + custom=("${!v}") suffix_base="_base" @@ -95,11 +98,12 @@ function assemble() { n="registry__$hash" if [[ -z ${!n} ]]; then if [ ! -e $updFile ]; then - echo "" > $updFile + echo "-- assembled updates" > $updFile fi printf -v "registry__${hash}" %s "$file" echo "-- New update sql: "$file + echo "-- $file" cat "$entry" >> $updFile fi done @@ -109,7 +113,7 @@ function assemble() { fi if [ $with_custom = true ]; then - custFile=$OUTPUT_FOLDER$database$suffix_custom"_"$curTime".sql" + custFile=$OUTPUT_FOLDER$database$suffix_custom".sql" if [ ! ${#custom[@]} -eq 0 ]; then echo "Generating $OUTPUT_FOLDER$database$suffix_custom ..." @@ -124,19 +128,12 @@ function assemble() { continue fi - file=$(basename "$entry") - hash=$($MD5_CMD "$entry") - hash="${hash%% *}" #remove file path - n="registry__$hash" - if [[ -z ${!n} ]]; then - if [ ! -e $custFile ]; then - echo "" > $custFile - fi - - printf -v "registry__${hash}" %s "$file" - echo "-- New custom sql: "$file - cat "$entry" >> $custFile + if [[ ! -e $custFile ]]; then + echo "-- assembled custom" > "$custFile" fi + + echo "-- $file" >> $custFile + cat "$entry" >> $custFile done fi done @@ -145,24 +142,24 @@ function assemble() { } function run() { - echo "===== STARTING PROCESS =====" + echo "===== STARTING PROCESS =====" - mkdir -p $OUTPUT_FOLDER + mkdir -p $OUTPUT_FOLDER - for db in ${DATABASES[@]} - do - assemble "$db" $version".sql" $1 $2 $3 - done + for db in ${DATABASES[@]} + do + assemble "$db" $version".sql" $1 $2 $3 + done - echo "" > $reg_file + echo "" > $reg_file - for k in ${!registry__*} - do - n=$k - echo "$k='${!n}';" >> "$reg_file" - done + for k in ${!registry__*} + do + n=$k + echo "$k='${!n}';" >> "$reg_file" + done - echo "===== DONE =====" + echo "===== DONE =====" } PS3='Please enter your choice: ' @@ -182,11 +179,11 @@ do run false true false break #avoid loop ;; - "Create only customs") + "Create only customs") run false false true break #avoid loop ;; - "Clean registry") + "Clean registry") rm "$reg_file" break #avoid loop ;; diff --git a/bin/db_pendings/import.sh b/bin/db_pendings/import.sh index f3ed764ba6..cf85cd349e 100755 --- a/bin/db_pendings/import.sh +++ b/bin/db_pendings/import.sh @@ -89,7 +89,7 @@ function import() { echo "DROP PROCEDURE IF EXISTS \`updateDb\`;" >> "$newFile"; fi; - #rm $entry; + rm $entry; oldDate=$dateToday oldCnt=$cnt diff --git a/bin/runners/run-engine b/bin/runners/run-engine index 9115abe777..9115abe777 100755..100644 --- a/bin/runners/run-engine +++ b/bin/runners/run-engine |