From 1e838c25d6fb9e9793b8dd4adbf5ce3078e1d0e5 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Fri, 1 Feb 2019 10:38:02 +0100 Subject: Speed up v3 decompression, add feedback --- makecolumns.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/makecolumns.sh b/makecolumns.sh index 4f4bebc..b1d2278 100755 --- a/makecolumns.sh +++ b/makecolumns.sh @@ -15,7 +15,7 @@ main() { [ -f `dirname $0`/../bin/el ] && EL=`dirname $0`/../bin/el if [ -z "${EL}" ]; then - echo "el not found. Get it at 'cvs -d :pserver:anoncvs@cvs.erdgeist.org:/home/cvsroot co el'" + echo "el not found. Get it at 'git clone git://erdgeist.org/el'" exit 1 fi @@ -49,17 +49,19 @@ main() { do_decompress_version_3() { printf "Extracting $2 chunks ... " + mkdir LHA && cd LHA extract_version_3 "${1}" + cd .. printf "done.\n" printf "Decompressing $2 chunks ... " - numfiles=`find . -name \*.lha | wc -l` + numfiles=`find LHA | wc -l` reported=0; processed=0 - for archive in *.lha; do + for archive in LHA/*.lha; do lha x ${archive} > /dev/null - rm ${archive} [ 1 -eq $(( ( ( (processed+=1) * 20 ) / numfiles ) > reported )) ] && printf "%d%% " $(( (reported+=1) * 5 )) done + rm -r LHA [ $reported -lt 10 ] && printf "100% " printf "done.\n" } @@ -225,7 +227,7 @@ handle_format_version_3() { cut -c 1 < 01_unknown > 01_Flags cut -c 2- < 01_unknown > 02_Nachname fi - rm 01_unknown + #rm 01_unknown printf "done.\n" printf "Splitting decompress vname chunks into their columns ... " @@ -277,7 +279,11 @@ handle_format_version_3() { # If street names come in an extra file, extract # street names first - [ -f "${streets}" ] && do_processfile_version_3 "${streets}" "street name" 99_Strassenname convert_zeros + if [ -f "${streets}" ]; then + printf "Extracting street name indexes ... " + do_processfile_version_3 "${streets}" "street name" 99_Strassenname convert_zeros + printf "done.\n" + fi # extract street names if 07_unknown contains street indexes # instead of street names -- cgit v1.2.3