From f1d3960f4ddcd28b44c08f63a4370306a36e39f7 Mon Sep 17 00:00:00 2001 From: typebrook Date: Fri, 15 Nov 2019 11:36:51 +0800 Subject: update --- utils/osm | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'utils/osm') diff --git a/utils/osm b/utils/osm index e6b4eaa..cca9ec8 100644 --- a/utils/osm +++ b/utils/osm @@ -161,23 +161,24 @@ osm.file.get.full() { } # $1 as osm file osm.osm.update() { + (tee; cat > $1.osc) |\ while read -r line do array=( $(echo $line) ) cat $1 |\ - sed -nr "/<$array[1] id=$array[2]/,/<\/$array[1]/ { + sed -nr " + /<$array[1] id=$array[2]/,/<\/$array[1]/ { /<$array[1] id=$array[2]/ a \ \ \ \ /> updated.$1 - done - - sed -ir '1 i - $ a ' updated.$1 + }" >> $1.osc + done - osmium derive-changes $1 updated.$1 --output=$1.osc --overwrite &&\ - rm updated.$1 + sed -ir '1 i + 1 i + $ a + $ a ' $1.osc } # create a new changeset osm.api.changeset.create() { -- cgit v1.2.3-70-g09d2