... | ... |
@@ -17,13 +17,11 @@ database=${DB:-$0.db} |
17 | 17 |
|
18 | 18 |
test -r "$0.conf" && source $0.conf && echo config red |
19 | 19 |
|
20 |
- |
|
21 | 20 |
aircrafts=$(mktemp --dry-run /dev/shm/Aircraft-XXXXXXXXX) |
22 | 21 |
aircraft=$(mktemp --dry-run /dev/shm/aircraft-XXXXXXX) |
23 | 22 |
setxml=$(mktemp --dry-run /dev/shm/setxml-XXXXXXXX) |
24 | 23 |
in_ram_database=$(mktemp --dry-run /dev/shm/XXXXXXX) |
25 | 24 |
|
26 |
- |
|
27 | 25 |
function xmlgetnext () { |
28 | 26 |
local IFS='>' |
29 | 27 |
read -d '<' TAG VALUE |
... | ... |
@@ -97,7 +95,9 @@ function trap_exit () { |
97 | 95 |
where name = '${ac/\/}' and setxml.variantof = id |
98 | 96 |
)" |
99 | 97 |
done |
100 |
- missing_setxml=$(sqlite_request "select printf(' - %s', name) from aircrafts where id not in (select variantof from setxml)") |
|
98 |
+ local missing_setxml=$(sqlite_request "select printf(' - %s', name) |
|
99 |
+ from aircrafts |
|
100 |
+ where id not in (select variantof from setxml)") |
|
101 | 101 |
if test -n "$missing_setxml"; then |
102 | 102 |
echo -e "missing setxml config for :\n$missing_setxml" |
103 | 103 |
fi |
... | ... |
@@ -196,12 +196,6 @@ function update_database () { |
196 | 196 |
if test "${TAG: -1}" != '/'; then |
197 | 197 |
property+=/${TAG%% *} |
198 | 198 |
fi;; |
199 |
-# property+=/${TAG%% *} |
|
200 |
-# if test "${TAG: -1}" = '/'; then |
|
201 |
-# _TAG=${TAG:0:-1} |
|
202 |
-# test "${_TAG#* }" != "${_TAG}" && eval "${_TAG#* }" |
|
203 |
-# property=${property%/*} |
|
204 |
-# fi;; |
|
205 | 199 |
esac |
206 | 200 |
|
207 | 201 |
if [[ "$TAG" =~ ^"PropertyList include=" ]]; then |
... | ... |
@@ -235,13 +229,6 @@ function update_database () { |
235 | 229 |
fi |
236 | 230 |
fi |
237 | 231 |
|
238 |
-# if test -n "$_TAG"; then |
|
239 |
-# # _TAG non-null means xml props ends with / |
|
240 |
-# # need to go back of last property |
|
241 |
-# property=${property/%\/${_TAG%% *}} |
|
242 |
-# unset _TAG |
|
243 |
-# fi |
|
244 |
- |
|
245 | 232 |
# continue parsing (while loop) until everything's found |
246 | 233 |
for col in ${!data[@]}; do |
247 | 234 |
test -z "${data[$col]}" && continue 2 |
... | ... |
@@ -330,11 +317,11 @@ if test -e $database; then |
330 | 317 |
fi |
331 | 318 |
|
332 | 319 |
sqlite_request "create table if not exists aircrafts ( |
333 |
- id integer primary key, |
|
334 |
- name text, |
|
320 |
+ id integer primary key, |
|
321 |
+ name text, |
|
335 | 322 |
revision integer, |
336 |
- date integer, |
|
337 |
- author text)" |
|
323 |
+ date integer, |
|
324 |
+ author text)" |
|
338 | 325 |
|
339 | 326 |
sqlite_request "create table if not exists setxml ( |
340 | 327 |
file text, |