Skip to content

Commit 35c9c84

Browse files
committed
Fix Bash syntax
Test -v should be followed by the variable name without $, otherwise the variable is expanded first. This bug made the import use the planet_osm_nodes table in the database but the diff updates use the flatnodes file. As a consequence, diff updates removed updated ways from the database if their nodes have not been changed since the first import.
1 parent aeb6227 commit 35c9c84

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

ansible/roles/tileserver/files/scripts/import.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ echo "[2/3] Filtering data extract"
3434
$OSMIUM tags-filter -o $PLANET_FILTERED $PLANET_FILE $OSMIUM_FILTER_EXPR
3535

3636
echo "[3/3] Import data into database"
37-
if [[ -v "$OSM2PGSQL_FLATNODES" ]]; then
37+
if [[ -v "OSM2PGSQL_FLATNODES" ]]; then
3838
FLATNODES_OPTION="--flat-node $FLATNODES_FILE"
3939
else
4040
FLATNODES_OPTION=""

ansible/roles/tileserver/files/scripts/update_osm.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function apply_diff_database {
4444
else
4545
FLATNODES_OPTION=""
4646
fi
47-
if [[ -v "$OSM2PGSQL_NUMBER_PROCESSES" ]]; then
47+
if [[ -v "OSM2PGSQL_NUMBER_PROCESSES" ]]; then
4848
NUMBER_PROCESSES_OPTION="--number-processes $OSM2PGSQL_NUMBER_PROCESSES"
4949
else
5050
NUMBER_PROCESSES_OPTION=""

0 commit comments

Comments
 (0)