summaryrefslogtreecommitdiff
path: root/uefi-tools/edk2-to-git-am.sh
diff options
context:
space:
mode:
Diffstat (limited to 'uefi-tools/edk2-to-git-am.sh')
-rwxr-xr-xuefi-tools/edk2-to-git-am.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/uefi-tools/edk2-to-git-am.sh b/uefi-tools/edk2-to-git-am.sh
new file mode 100755
index 00000000..d3f8a27e
--- /dev/null
+++ b/uefi-tools/edk2-to-git-am.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Convert one or more git patches that have had it's CR:s stripped out by SMTP
+# into something th
+
+if [ $# -lt 1 ]; then
+ echo "usage: `basename $0` <filename>" >&2
+ exit 1
+fi
+
+convert_file()
+{
+ sed -i "s/$/\r/g" "$1"
+ sed -i "s:^\(---\|+++ \)\(.*\)\r$:\1\2:g" "$1"
+}
+
+while [ $# -gt 0 ]; do
+ convert_file "$1"
+ shift
+done