summaryrefslogtreecommitdiff
path: root/uefi-tools/edk2-to-git-am.sh
blob: d3f8a27e67bb8e36eeccf2f64d6109ad785596ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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