isaacpittman-hitachi / rpms / openssl

Forked from rpms/openssl 2 years ago
Clone

Blame SOURCES/genpatches

2871ff
#!/bin/bash
2871ff
2871ff
if [ $# -ne 2 ] ; then
2871ff
    echo "Usage:"
2871ff
    echo "   $0 <git-dir> <base-tag>"
2871ff
    exit 1
2871ff
fi
2871ff
2871ff
git_dir="$1"
2871ff
base_tag="$2"
2871ff
2871ff
target_dir="$(pwd)"
2871ff
2871ff
pushd "$git_dir" >/dev/null
2871ff
git format-patch -k -o "$target_dir" "$base_tag" >/dev/null
2871ff
popd >/dev/null
2871ff
2871ff
echo "# Patches exported from source git"
2871ff
2871ff
i=1
2871ff
for p in *.patch ; do
2871ff
    printf "# "
2871ff
    sed '/^Subject:/{s/^Subject: //;p};d' "$p"
2871ff
    printf "Patch%s: %s\n" $i "$p"
2871ff
    i=$(($i + 1))
2871ff
done