diff --git a/scripts/renamepatches b/scripts/renamepatches index f86d7da..fa2b5bc 100755 --- a/scripts/renamepatches +++ b/scripts/renamepatches @@ -32,8 +32,9 @@ temp=$(mktemp) git grep -iE '^(Git-commit:|No-fix:|\(cherry picked from commit)' $branch | grep -vF patches.kernel.org > $temp grep -E "^[[:space:]]*patches\.[a-z]+\/" < series.conf | while read patch ; do - commit="$([ -f $patch ] && { grep -iE "^(Git-commit|No-fix):" < $patch | awk '{ print $2}' ; - grep -i "^(cherry picked from commit" < $patch | awk '{ print $5}' ; } )" + [ ! -f "$patch" ] && continue + commit="$(awk -v IGNORECASE=1 '/^(Git-commit|No-fix):/ { print $2} + /^\(cherry picked from commit/ { print $5}' $patch)" [ -n "$commit" ] && echo "$commit" | while read c ; do grep -F $c < $temp | tr ':' ' ' | while read junk fn blah ; do [ -n "$fn" ] && [ $fn != $patch ] && git mv $patch $fn && sed -i -e "s,$patch,$fn," series.conf