Showing 1 changed files with 6 additions and 6 deletions
+6 -6
flightgear/fgaddon
... ...
@@ -377,18 +377,18 @@ if test -e $database; then
377 377
     cp $database $in_ram_database
378 378
 
379 379
     sql_cols=$(sqlite_request "pragma table_info(setxml)" \
380
-             | cut --delimiter="|" --fields=2,3 --output-delimiter=" " \
381
-             | sort \
382
-             | md5sum)
380
+             | awk -F'|' '{print $2 " " tolower($3)}' \
381
+             | sort)
383 382
     datatypes[file]=text
384 383
     datatypes[variantof]=integer
385 384
     datatypes[installed]=integer
386 385
     script_cols=$(for col in ${!datatypes[@]}; do echo "$col ${datatypes["$col"]%% *}"; done \
387
-                | sort \
388
-                | md5sum)
386
+                | sort)
389 387
     unset datatypes[file] datatypes[variantof] datatypes[installed]
390
-    if test "$sql_cols" != "$script_cols"; then
388
+    if test "$(md5sum <<< $sql_cols)" != "$(md5sum <<< $script_cols)"; then
391 389
         echo "ALERT: datbase version mismatch !"
390
+        echo "DB:     $sql_cols"
391
+        echo "script: $script_cols"
392 392
         exit 1
393 393
     fi
394 394
     if sqlite_request '.tables' | grep -q 'recover_'; then