diff options
author | Dirk Engling <erdgeist@erdgeist.org> | 2019-02-01 10:38:02 +0100 |
---|---|---|
committer | Dirk Engling <erdgeist@erdgeist.org> | 2019-02-01 10:38:02 +0100 |
commit | 1e838c25d6fb9e9793b8dd4adbf5ce3078e1d0e5 (patch) | |
tree | 3f4dffb4884a64bb7aabae8e353fc5d1d7ec84a5 | |
parent | a187241f4e4cf8a592e0a3cc0b61f949e6184a9e (diff) |
Speed up v3 decompression, add feedback
-rwxr-xr-x | makecolumns.sh | 18 |
1 files 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() { | |||
15 | [ -f `dirname $0`/../bin/el ] && EL=`dirname $0`/../bin/el | 15 | [ -f `dirname $0`/../bin/el ] && EL=`dirname $0`/../bin/el |
16 | 16 | ||
17 | if [ -z "${EL}" ]; then | 17 | if [ -z "${EL}" ]; then |
18 | echo "el not found. Get it at 'cvs -d :pserver:anoncvs@cvs.erdgeist.org:/home/cvsroot co el'" | 18 | echo "el not found. Get it at 'git clone git://erdgeist.org/el'" |
19 | exit 1 | 19 | exit 1 |
20 | fi | 20 | fi |
21 | 21 | ||
@@ -49,17 +49,19 @@ main() { | |||
49 | 49 | ||
50 | do_decompress_version_3() { | 50 | do_decompress_version_3() { |
51 | printf "Extracting $2 chunks ... " | 51 | printf "Extracting $2 chunks ... " |
52 | mkdir LHA && cd LHA | ||
52 | extract_version_3 "${1}" | 53 | extract_version_3 "${1}" |
54 | cd .. | ||
53 | printf "done.\n" | 55 | printf "done.\n" |
54 | 56 | ||
55 | printf "Decompressing $2 chunks ... " | 57 | printf "Decompressing $2 chunks ... " |
56 | numfiles=`find . -name \*.lha | wc -l` | 58 | numfiles=`find LHA | wc -l` |
57 | reported=0; processed=0 | 59 | reported=0; processed=0 |
58 | for archive in *.lha; do | 60 | for archive in LHA/*.lha; do |
59 | lha x ${archive} > /dev/null | 61 | lha x ${archive} > /dev/null |
60 | rm ${archive} | ||
61 | [ 1 -eq $(( ( ( (processed+=1) * 20 ) / numfiles ) > reported )) ] && printf "%d%% " $(( (reported+=1) * 5 )) | 62 | [ 1 -eq $(( ( ( (processed+=1) * 20 ) / numfiles ) > reported )) ] && printf "%d%% " $(( (reported+=1) * 5 )) |
62 | done | 63 | done |
64 | rm -r LHA | ||
63 | [ $reported -lt 10 ] && printf "100% " | 65 | [ $reported -lt 10 ] && printf "100% " |
64 | printf "done.\n" | 66 | printf "done.\n" |
65 | } | 67 | } |
@@ -225,7 +227,7 @@ handle_format_version_3() { | |||
225 | cut -c 1 < 01_unknown > 01_Flags | 227 | cut -c 1 < 01_unknown > 01_Flags |
226 | cut -c 2- < 01_unknown > 02_Nachname | 228 | cut -c 2- < 01_unknown > 02_Nachname |
227 | fi | 229 | fi |
228 | rm 01_unknown | 230 | #rm 01_unknown |
229 | printf "done.\n" | 231 | printf "done.\n" |
230 | 232 | ||
231 | printf "Splitting decompress vname chunks into their columns ... " | 233 | printf "Splitting decompress vname chunks into their columns ... " |
@@ -277,7 +279,11 @@ handle_format_version_3() { | |||
277 | 279 | ||
278 | # If street names come in an extra file, extract | 280 | # If street names come in an extra file, extract |
279 | # street names first | 281 | # street names first |
280 | [ -f "${streets}" ] && do_processfile_version_3 "${streets}" "street name" 99_Strassenname convert_zeros | 282 | if [ -f "${streets}" ]; then |
283 | printf "Extracting street name indexes ... " | ||
284 | do_processfile_version_3 "${streets}" "street name" 99_Strassenname convert_zeros | ||
285 | printf "done.\n" | ||
286 | fi | ||
281 | 287 | ||
282 | # extract street names if 07_unknown contains street indexes | 288 | # extract street names if 07_unknown contains street indexes |
283 | # instead of street names | 289 | # instead of street names |