aboutsummaryrefslogtreecommitdiff
path: root/upload/diffpatch
diff options
context:
space:
mode:
authorAndrew Harvey <andrew@alantgeo.com.au>2021-07-04 20:48:39 +1000
committerAndrew Harvey <andrew@alantgeo.com.au>2021-07-04 20:48:39 +1000
commitdeffe3e80b786f5782c6915e3adabf855bd54ac4 (patch)
tree23bd569e18dc64b07ce9204eb67a929776d57e2f /upload/diffpatch
parent7f59a0a9a9a8d3a739a08bbb0336fbf9aaf8b85d (diff)
directly commit upload.py as some local changes were made
Diffstat (limited to 'upload/diffpatch')
-rw-r--r--upload/diffpatch13
1 files changed, 13 insertions, 0 deletions
diff --git a/upload/diffpatch b/upload/diffpatch
new file mode 100644
index 0000000..1538a31
--- /dev/null
+++ b/upload/diffpatch
@@ -0,0 +1,13 @@
+#! /bin/bash
+[ $# -ge 2 ] || exit -1
+
+fn="$1"
+shift
+grep old_id "$fn" | \
+while read line; do
+ old=`echo "$line" | grep -o 'old_id="[0-9-]*'`
+ new=`echo "$line" | grep -o 'new_id="[0-9-]*'`
+ old=${old:8}
+ new=${new:8}
+ sed -i "s/ref=\"${old}\"/ref=\"${new}\"/g" $*
+done