Add post_update.sh to fix up Android.bp

* Use the updater.sh update --refresh --keep_date command
  to check and fix local changes.
* Also fix non-standard line format in METADATA.

Test: tools/external_updater/updater.sh update --refresh --keep_date rust/crates/serde
Change-Id: I796bb2fc1e9db4a16c56aef4a560e0dcea17c8a1
diff --git a/METADATA b/METADATA
index 2ca368d..13e5248 100644
--- a/METADATA
+++ b/METADATA
@@ -1,7 +1,5 @@
 name: "serde"
-description:
-    "A generic serialization/deserialization framework"
-
+description: "A generic serialization/deserialization framework"
 third_party {
   url {
     type: HOMEPAGE
@@ -12,7 +10,10 @@
     value: "https://static.crates.io/crates/serde/serde-1.0.115.crate"
   }
   version: "1.0.115"
-  last_upgrade_date { year: 2020 month: 8 day: 21 }
   license_type: NOTICE
+  last_upgrade_date {
+    year: 2020
+    month: 8
+    day: 21
+  }
 }
-
diff --git a/post_update.sh b/post_update.sh
new file mode 100755
index 0000000..7de4f29
--- /dev/null
+++ b/post_update.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+# $1 Path to the new version.
+# $2 Path to the old version.
+
+set -x
+set -e
+
+# work around missing std_atomic64 on arm/arm64
+SRCFILE=Android.bp
+OLDSTR='"--cfg std_atomic64",'
+NEWSTR='// "--cfg std_atomic64", // not for arm/arm64'
+sed -i -e "s:$OLDSTR:$NEWSTR:" $SRCFILE
+# Make sure that sed replaced $OLDSTR with $NEWSTR
+grep "$NEWSTR" $SRCFILE > /dev/null