config / .fgfs / fgaddon /
Newer Older
430 lines | 15.777kb
ajout de gestion de bdd pour...
Sébastien MARQUE authored on 2020-08-24
1
#!/bin/bash
2

            
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
3
set -e
4

            
5
declare -A data=(
6
        [/sim/description]=text
7
        [/sim/long-description]=text
8
        [/sim/author]=text
9
        [/sim/flight-model]=text
10
        [/sim/type]=text
11
        [/sim/model/path]=text
12
)
ajout de gestion de bdd pour...
Sébastien MARQUE authored on 2020-08-24
13
fgaddon_svn=https://svn.code.sf.net/p/flightgear/fgaddon/trunk/Aircraft
many improvement
Sébastien MARQUE authored on 2020-09-08
14
fgaddon_path=$HOME/.fgfs/flightgear-fgaddon/Aircraft
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
15
database=${DB:-$0.db}
16
#locale=fr
17

            
18
test -r "$0.conf" && source $0.conf && echo config red
19

            
ajout de gestion de bdd pour...
Sébastien MARQUE authored on 2020-08-24
20

            
21
aircrafts=$(mktemp --dry-run /dev/shm/Aircraft-XXXXXXXXX)
22
aircraft=$(mktemp --dry-run /dev/shm/aircraft-XXXXXXX)
23
setxml=$(mktemp --dry-run /dev/shm/setxml-XXXXXXXX)
24
in_ram_database=$(mktemp --dry-run /dev/shm/XXXXXXX)
25

            
26

            
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
27
function xmlgetnext () {
28
    local IFS='>'
29
    read -d '<' TAG VALUE
30
    # by design, the first TAG/VALUE pair is empty
31
    # to avoid infinite loops at end of file parsing we return an error
32
    # the next time we find an empty TAG
33
    if test -z "$TAG"; then
34
        test ${xmlgetnext_firstentry:-1} -eq 1 && xmlgetnext_firstentry=0 || return 1;
35
    fi
36
    # process $TAG only if necessary
37
    local _TAG=$(printf '%q' $TAG)
38
    if test ${_TAG:0:1} = '$'; then
39
        TAG=$(tr '\n' ' ' <<< $TAG | sed 's/  */ /g; s/ *$//')
40
    fi
ajout de gestion de bdd pour...
Sébastien MARQUE authored on 2020-08-24
41
}
42

            
43
function sqlite_request () {
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
44
    if ! sqlite3 "$in_ram_database" <<< "$1"; then
45
        register_state
46
    fi
47
}
48

            
49
function xmlremovecomments () {
50
    sed -ri 's/<(!--|script>)/\n&/;s/(<\/script|--)>/&\n/' $setxml
51
    sed -ri '/<(script>|!--).*(<\/script|--)>/d;/<(script>|!--)/,/(<\/script|--)>/d' $setxml
small stuff
Sébastien MARQUE authored on 2020-09-27
52
    sed -i 's/\xef\xbb\xbf//' $setxml # removes BOM
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
53
}
54

            
55
function trap_break () {
56
    trap '' INT
57
    echo "stop requested"
58
    register_state
ajout de gestion de bdd pour...
Sébastien MARQUE authored on 2020-08-24
59
}
60

            
61
function trap_exit () {
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
62
    trapped_rc=$?
63
    trap '' INT
64
    rm -f $aircrafts $aircraft $setxml
65
    if test ! -e $in_ram_database; then
66
        exit
67
    fi
68
    test $trapped_rc -ne 0 && register_state
many improvements
Sébastien MARQUE authored on 2020-09-02
69
    echo "updating installation status"
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
70
    for ac in $(sqlite_request 'select printf("%i:%s/%s", aircrafts.id, aircrafts.name, setxml.file)
71
                                from aircrafts inner join setxml
72
                                where aircrafts.id = setxml.variantof and setxml.installed != 0;'); do
many improvements
Sébastien MARQUE authored on 2020-09-02
73
        ac_path=${ac#*:}
many improvement
Sébastien MARQUE authored on 2020-09-08
74
        if test ! -e $fgaddon_path/$ac_path-set.xml; then
75
            sqlite_request "update setxml set installed = 0 where file = '${ac_path#*/}' and variantof = ${ac%:*}"
76
        fi
77
    done
78
    for ac in $fgaddon_path/*/*-set.xml; do
79
        ac=${ac/$fgaddon_path}
80
        sx=${ac##*/}
81
        ac=${ac%/*}
82
        if test -d $fgaddon_path/$ac/.svn; then
83
            install_type=1
84
        elif test -d $fgaddon_path/$ac/.git; then
85
            install_type=2
86
        else
87
            install_type=3
88
        fi
89
        sqlite_request "update setxml set installed = $install_type
90
                        where exists (
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
91
                            select 1
92
                            from aircrafts
93
                            where name = '${ac/\/}' and setxml.variantof = id
many improvement
Sébastien MARQUE authored on 2020-09-08
94
                        )"
many improvements
Sébastien MARQUE authored on 2020-09-02
95
    done
improve output for missing a...
Sébastien MARQUE authored on 2020-09-23
96
    missing_setxml=$(sqlite_request "select printf(' - %s', name) from aircrafts where id not in (select variantof from setxml)")
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
97
    if test -n "$missing_setxml"; then
improve output for missing a...
Sébastien MARQUE authored on 2020-09-23
98
        echo -e "missing setxml config for :\n$missing_setxml"
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
99
    fi
ajout de gestion de bdd pour...
Sébastien MARQUE authored on 2020-08-24
100
    if test -r "$database" && md5sum $in_ram_database | sed "s,$in_ram_database,$database," | md5sum --status -c -; then
101
        rm -f $in_ram_database
many improvements
Sébastien MARQUE authored on 2020-09-02
102
        echo "no changes in $database"
ajout de gestion de bdd pour...
Sébastien MARQUE authored on 2020-08-24
103
    elif test -w "$database"; then
complete rewrite (use svn in...
Sébastien MARQUE authored on 2020-09-07
104
        sqlite_request "vacuum"
ajout de gestion de bdd pour...
Sébastien MARQUE authored on 2020-08-24
105
        mv -f $in_ram_database "$database"
many improvements
Sébastien MARQUE authored on 2020-09-02
106
        echo "database $database updated"
ajout de gestion de bdd pour...
Sébastien MARQUE authored on 2020-08-24
107
    elif ! test -e "$database"; then
108
        mv $in_ram_database "$database"
many improvements
Sébastien MARQUE authored on 2020-09-02
109
        echo "database $database created"
ajout de gestion de bdd pour...
Sébastien MARQUE authored on 2020-08-24
110
    else
111
        rm -f $in_ram_database
many improvements
Sébastien MARQUE authored on 2020-09-02
112
        echo "nothing can be done with $database !"
ajout de gestion de bdd pour...
Sébastien MARQUE authored on 2020-08-24
113
    fi
114
}
115

            
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
116
function register_state () {
117
    sqlite_request "drop table if exists recover_rev"
118
    sqlite_request "create table recover_rev (
119
                        revkey text,
120
                        revision integer,
121
                        revauthor text,
122
                        revdate integer
123
                    )"
fix variable name conflict
Sébastien MARQUE authored on 2020-09-23
124
    for revkey in ${!revindex[@]}; do
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
125
        sqlite_request "insert into recover_rev values (
126
                            '$revkey',
fix variable name conflict
Sébastien MARQUE authored on 2020-09-23
127
                            ${revindex[$revkey]:-0},
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
128
                            '${revauthor[$revkey]}',
129
                            ${revdate[$revkey]:-0}
130
                        )"
131
    done
132
    sqlite_request "drop table if exists recover_setxmlmodified"
133
    sqlite_request "create table if not exists recover_setxmlmodified (
134
                        sx text
135
                    )"
136
    for sx in ${!setxmlmodified[@]}; do
137
        sqlite_request "insert into recover_setxmlmodified values (
138
                            '$sx'
139
                        )"
140
    done
141
    exit
142
}
143

            
144
function update_database () {
fix variable name conflict
Sébastien MARQUE authored on 2020-09-23
145
    echo "[ ${#revindex[@]} ] ${ac:1}"
ajout de gestion de bdd pour...
Sébastien MARQUE authored on 2020-08-24
146

            
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
147
    dbupdate=$(sqlite_request "select revision from aircrafts where name is '${ac:1}'")
ajout de gestion de bdd pour...
Sébastien MARQUE authored on 2020-08-24
148
    if test -z "$dbupdate"; then
complete rewrite (use svn in...
Sébastien MARQUE authored on 2020-09-07
149
        sqlite_request "insert into aircrafts (name, revision, date, author)
fix variable name conflict
Sébastien MARQUE authored on 2020-09-23
150
                        values ('${ac:1}', ${revindex[$ac]}, ${revdate[$ac]}, '${revauthor[$ac]}')"
151
    elif test $dbupdate -lt ${revindex[$ac]}; then
complete rewrite (use svn in...
Sébastien MARQUE authored on 2020-09-07
152
        sqlite_request "update aircrafts set
fix variable name conflict
Sébastien MARQUE authored on 2020-09-23
153
                            revision = ${revindex[$ac]},
complete rewrite (use svn in...
Sébastien MARQUE authored on 2020-09-07
154
                            author   = '${revauthor[$ac]}',
155
                            date = ${revdate[$ac]}
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
156
                        where name is '${ac:1}'"
ajout de gestion de bdd pour...
Sébastien MARQUE authored on 2020-08-24
157
    fi
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
158
    id=$(sqlite_request "select id from aircrafts where name is '${ac:1}'")
ajout de gestion de bdd pour...
Sébastien MARQUE authored on 2020-08-24
159

            
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
160
    for sx in ${!setxmlmodified[@]}; do
161
        unset include include_rootpath
162
        [[ "$sx" =~ ^"${ac:1}/" ]] || continue
163
        for col in ${!data[@]}; do
164
            data[$col]=
165
        done
166
        sx=${sx#*/}
remove -set.xml from filenam...
Sébastien MARQUE authored on 2020-09-02
167
        echo " -> $sx"
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
168
        if ! svn export --quiet --force $fgaddon_svn/${ac:1}/$sx-set.xml $setxml; then
169
            register_state
170
        fi
171
        xmlremovecomments
172
        unset xmlgetnext_firstentry property
complete rewrite (use svn in...
Sébastien MARQUE authored on 2020-09-07
173
        while xmlgetnext; do
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
174
            case "${TAG:0:1}" in
175
                ''|'?'|'!')
176
                    continue;;
177
                /)
178
                    property=${property%/*};;
179
                *)
180
                    if test "${TAG: -1}" != '/'; then
181
                        property+=/${TAG%% *}
fix syntax mistake
Sébastien MARQUE authored on 2020-09-21
182
                    fi;;
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
183
#                    property+=/${TAG%% *}
184
#                    if test "${TAG: -1}" = '/'; then
185
#                        _TAG=${TAG:0:-1}
186
#                        test "${_TAG#* }" != "${_TAG}" && eval "${_TAG#* }"
187
#                        property=${property%/*}
188
#                    fi;;
189
            esac
190

            
191
            if [[ "$TAG" =~ ^"PropertyList include=" ]]; then
192
                include_rootpath=${include%/*}
193
                test $include = $include_rootpath && unset include_rootpath
194
                eval $(echo ${TAG#* })
195
                [[ "$include" =~ ^Aircraft/Generic/ ]] && unset include include_rootpath && continue
196
                if [[ "$include" =~ ^'../' ]]; then
197
                    if test -n "$include_rootpath"; then
198
                        if [[ "$include_rootpath" =~ '/' ]]; then
199
                            include_rootpath=${include_rootpath%/*}
200
                        else
201
                            unset include_rootpath
202
                        fi
203
                    else
204
                        ac_save=$ac
205
                        unset ac
206
                    fi
207
                    include=${include/\.\.\/}
208
                fi
209
                if ! svn cat $fgaddon_svn/${ac:1}/${include_rootpath:+$include_rootpath/}$include >> $setxml; then
210
                    register_state
211
                fi
212
                xmlremovecomments
213
            fi
214

            
215
            if [[ "$property" = /PropertyList@($data_pattern) ]]; then
216
                eval "data[${property/\/PropertyList}]=\"${VALUE//\"/\\\"}\""
217
                data[${property/\/PropertyList}]=$(tr '\n' ' ' <<< ${data[${property/\/PropertyList}]} | sed -r 's/^\s*//;s/\s+/ /g;s/\s*$//')
many improvement
Sébastien MARQUE authored on 2020-09-08
218
            fi
ajout de gestion de bdd pour...
Sébastien MARQUE authored on 2020-08-24
219

            
small stuff
Sébastien MARQUE authored on 2020-09-27
220
#            if test -n "$_TAG"; then
221
#                # _TAG non-null means xml props ends with /
222
#                # need to go back of last property
223
#                property=${property/%\/${_TAG%% *}}
224
#                unset _TAG
225
#            fi
many improvement
Sébastien MARQUE authored on 2020-09-08
226

            
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
227
            # continue parsing (while loop) until everything's found
228
            for col in ${!data[@]}; do
229
                test -z "${data[$col]}" && continue 2
230
            done
231
            break # everything's found
232
        done < $setxml
ajout de gestion de bdd pour...
Sébastien MARQUE authored on 2020-08-24
233

            
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
234
        if eval "test -z \"$data_test_null\""; then
235
            echo "WARNING: no info found, skipping"
236
            continue
complete rewrite (use svn in...
Sébastien MARQUE authored on 2020-09-07
237
        fi
238

            
ajout de gestion de bdd pour...
Sébastien MARQUE authored on 2020-08-24
239
        known=$(sqlite_request "select variantof from setxml where file is '$sx'")
240
        if test -n "$known"; then
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
241
            for col in ${!data[@]}; do
242
                dbvalue=$(sqlite_request "select '$col'
243
                                          from setxml
244
                                          where file is '$sx' and variantof = $known")
245
                if test "$dbvalue" != "${data[$col]}" -a -n "${data[$col]}"; then
246
                    sqlite_request "update setxml
247
                                    set '$col' = '${data[$col]//\'/\'\'}'
248
                                    where file is '$sx' and variantof = $known"
ajout de gestion de bdd pour...
Sébastien MARQUE authored on 2020-08-24
249
                fi
250
            done
251
        else
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
252
            values="'$sx', $id, "
253
            for col in ${!data[@]}; do
254
                values+="'${data[$col]//\'/\'\'}', "
255
            done
256
            values+=0
257
            sqlite_request "insert into setxml values ($values)"
258
        fi
259
        test -n "$ac_save" && ac=$ac_save
260
        unset setxmlmodified[${ac:1}/$sx]
261
    done
fix variable name conflict
Sébastien MARQUE authored on 2020-09-23
262
    unset revindex[$ac]
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
263
}
264

            
265
function apply_revision () {
fix variable name conflict
Sébastien MARQUE authored on 2020-09-23
266
    for ac in "${!revindex[@]}"; do
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
267
        update_database
268
        if test -d $fgaddon_path/${ac:1}/.svn \
269
        && test "$(svn info --show-item=url $fgaddon_path/${ac:1})" != "$fgaddon_svn/${ac:1}" \
270
        || test -d $fgaddon_path/${ac:1} -a ! -d $fgaddon_path/${ac:1}/.svn; then
271
            echo "INFO: local ${ac:1} installed out from repo" >&2
ajout de gestion de bdd pour...
Sébastien MARQUE authored on 2020-08-24
272
        fi
273
    done
274
}
275

            
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
276
trap trap_break INT
ajout de gestion de bdd pour...
Sébastien MARQUE authored on 2020-08-24
277
trap trap_exit EXIT
278

            
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
279
stty -echoctl
280

            
fix variable name conflict
Sébastien MARQUE authored on 2020-09-23
281
declare -A revindex revauthor revdate setxmlmodified files revpath
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
282
data_pattern=$(printf "%s|" ${!data[@]})
283
data_pattern=${data_pattern:0:-1}
284
data_test_null=$(printf '${data[%s]}' ${!data[@]})
285

            
286
if test -e $database; then
287
    cp $database $in_ram_database
288
    sql_cols=$(sqlite_request "pragma table_info(setxml)" | awk -F'|' '{printf("%s %s ", $2, $3)}')
289
    script_cols="file text variantof integer "
290
    for col in ${!data[@]}; do
291
        script_cols+="$col ${data["$col"]} "
292
    done
293
    script_cols+="installed integer " # last space is important
294
    if test "$sql_cols" != "$script_cols"; then
295
        echo "ALERT: datbase version mismatch !"
296
        exit 1
297
    fi
298
    if sqlite_request '.tables' | grep -q 'recover_' && test -z "$1"; then
299
        echo "recovering from previous saved state"
fix variable name conflict
Sébastien MARQUE authored on 2020-09-23
300
        eval $(sqlite_request "select printf('revindex[%s]=%u;revauthor[%s]=%s;revdate[%s]=%u;',
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
301
                                       revkey, revision,
302
                                       revkey, revauthor,
303
                                       revkey, revdate)
304
                               from recover_rev")
305
        eval $(sqlite_request "select printf('setxmlmodified[%s]=1;', sx)
306
                               from recover_setxmlmodified")
307
        sqlite_request "drop table recover_rev"
308
        sqlite_request "drop table recover_setxmlmodified"
309
        apply_revision
310
        exit
311
    fi
312
fi
313

            
314
sqlite_request "create table if not exists aircrafts (
315
                    id integer primary key,
316
                    name text,
317
                    revision integer,
318
                    date integer,
319
                    author text)"
ajout de gestion de bdd pour...
Sébastien MARQUE authored on 2020-08-24
320

            
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
321
sqlite_request "create table if not exists setxml (
322
                    file text,
323
                    variantof integer,
324
                    $(for col in ${!data[@]}; do printf "'%s' %s, " $col ${data[$col]}; done)
325
                    installed integer)"
ajout de gestion de bdd pour...
Sébastien MARQUE authored on 2020-08-24
326

            
complete rewrite (use svn in...
Sébastien MARQUE authored on 2020-09-07
327
latest_revision=$(sqlite_request "select max(revision) from aircrafts")
328

            
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
329
# for debugging purpose
330
if test -n "$2"; then
331
    ac=_${1%/*}
fix variable name conflict
Sébastien MARQUE authored on 2020-09-23
332
    revindex[$ac]=1
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
333
    revdate[$ac]=0
334
    revauthor[$ac]=foobar
335
    setxmlmodified[${ac:1}/${1#*/}]=1
336
    set -x
337
    update_database
338
    set +x
339
    exit
340
elif test -n "$1"; then
341
    ac=_${1%/*}
fix variable name conflict
Sébastien MARQUE authored on 2020-09-23
342
    eval $(sqlite_request "select printf('revindex[_%s]=%s;revdate[_%s]=%i;revauthor[_%s]=%s;',
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
343
                                            name, revision,
344
                                            name, date,
345
                                            name, author)
346
                           from aircrafts
347
                           where name = '${ac:1}'")
348
    setxmlmodified[${ac:1}/${1#*/}]=1
fix variable name conflict
Sébastien MARQUE authored on 2020-09-23
349
    if test -z "${revindex[$ac]}"; then
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
350
        echo "aircraft ${ac:1} not found"
351
        rm $in_ram_database
352
        exit
353
    fi
354
    update_database
355
    exit
356
fi
357

            
complete rewrite (use svn in...
Sébastien MARQUE authored on 2020-09-07
358
echo "downloading FGADDON history from revision ${latest_revision:-0}"
359
svn log --revision ${latest_revision:-0}:HEAD --xml --verbose $fgaddon_svn > $aircrafts
360

            
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
361
total=$(grep -c '<logentry' $aircrafts)
362
progress=0
363

            
364
echo parsing history
365

            
complete rewrite (use svn in...
Sébastien MARQUE authored on 2020-09-07
366
while xmlgetnext; do
367
    case "$TAG" in
368
        'logentry revision='*)
369
            eval $(echo ${TAG#* })
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
370
            for action in ${!revpath[@]}; do
371
                unset revpath[$action]
372
            done
complete rewrite (use svn in...
Sébastien MARQUE authored on 2020-09-07
373
        ;;
374
        'author')
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
375
            revauthor=${VALUE//\'/\'\'}
complete rewrite (use svn in...
Sébastien MARQUE authored on 2020-09-07
376
        ;;
377
        'date')
378
            revdate=$(date +%s -d "$VALUE")
379
        ;;
380
        'path '*)
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
381
            TAG=${TAG#* }
382
            TAG=${TAG// /;}
383
            TAG=${TAG//-/_}
384
            eval $(echo ${TAG// /;})
385
            path=(${VALUE//\// })
386
            if test $kind = 'file' -a ${#path[@]} -gt 3; then
387
                revpath[$action]+="$VALUE "
388
            elif test $kind = 'dir' -a ${#path[@]} -eq 3 -a $action = 'D'; then
389
                files[_${path[2]}]=0
fix variable name conflict
Sébastien MARQUE authored on 2020-09-23
390
                unset revindex[_${path[2]}] revauthor[_${path[2]}] revdate[_${path[2]}]
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
391
                for sx in ${!setxmlmodified[@]}; do
392
                    [[ "$sx" =~ "${path[2]}/" ]] && unset setxmlmodified[$sx]
393
                done
394
            fi
complete rewrite (use svn in...
Sébastien MARQUE authored on 2020-09-07
395
        ;;
396
        '/logentry')
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
397
            for item in ${revpath[D]}; do
398
                path=(${item//\// })
manage aircraft deletion
Sébastien MARQUE authored on 2020-09-23
399
                if [[ "${path[3]}" =~ "-set.xml" ]]; then
400
                    unset setxmlmodified[${path[2]}/${path[3]/-set.xml}]
401
                    sqlite_request "delete from setxml where file = '${path[3]/-set.xml}'"
402
                fi
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
403
                files[_${path[2]}]=$(( --files[_${path[2]}] ))
404
                if test ${files[_${path[2]}]} -le 0; then
fix variable name conflict
Sébastien MARQUE authored on 2020-09-23
405
                    unset revindex[_${path[2]}] revauthor[_${path[2]}] revdate[_${path[2]}]
manage aircraft deletion
Sébastien MARQUE authored on 2020-09-23
406
                    sqlite_request "delete from aircrafts where name = '${path[2]}'"
many improvement
Sébastien MARQUE authored on 2020-09-08
407
                fi
complete rewrite (use svn in...
Sébastien MARQUE authored on 2020-09-07
408
            done
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
409
            for action in A M R; do
410
                for item in ${revpath[$action]}; do
411
                    path=(${item//\// })
fix variable name conflict
Sébastien MARQUE authored on 2020-09-23
412
                    revindex[_${path[2]}]=$revision
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
413
                    revauthor[_${path[2]}]=$revauthor
414
                    revdate[_${path[2]}]=$revdate
415
                    [[ "${path[3]}" =~ "-set.xml" ]] && setxmlmodified[${path[2]}/${path[3]/-set.xml}]=1
416
                    test $action = 'A' && files[_${path[2]}]=$(( ++files[_${path[2]}] ))
417
                done
418
            done
419
            newprogress=$((++logentry * 100 / $total))
420
            if test $(( $newprogress - $progress )) -ge ${progress_granularity:-1}; then
421
                progress=$newprogress
fix variable name conflict
Sébastien MARQUE authored on 2020-09-23
422
                echo "$progress% (${#revindex[@]})"
ré-écriture complète
Sébastien MARQUE authored on 2020-09-20
423
            fi
424
        ;;
425
        '/log')
426
            apply_revision
complete rewrite (use svn in...
Sébastien MARQUE authored on 2020-09-07
427
            break
428
        ;;
429
    esac
430
done < $aircrafts