diff options
| author | Joe Orton <jorton@redhat.com> | 2012-04-27 13:40:37 +0100 |
|---|---|---|
| committer | Joe Orton <jorton@redhat.com> | 2012-04-27 13:40:37 +0100 |
| commit | 44a360e599b8587bbdd03e263813c8f4b445cc80 (patch) | |
| tree | 63b9204b926764ba4b71af45124fa691d12de43d /pullrev.sh | |
| parent | b4edcbb8cb56c9143ddb270db301524805cffd7e (diff) | |
| download | httpd-44a360e599b8587bbdd03e263813c8f4b445cc80.tar.gz httpd-44a360e599b8587bbdd03e263813c8f4b445cc80.tar.xz httpd-44a360e599b8587bbdd03e263813c8f4b445cc80.zip | |
add script for pulling revs from upstream
Diffstat (limited to 'pullrev.sh')
| -rwxr-xr-x | pullrev.sh | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/pullrev.sh b/pullrev.sh new file mode 100755 index 0000000..14477ad --- /dev/null +++ b/pullrev.sh @@ -0,0 +1,51 @@ +#!/bin/sh + +if [ $# -lt 1 ]; then + echo "What?" + exit 1 +fi + +repo="https://svn.apache.org/repos/asf/httpd/httpd/trunk" +ver=2.4.2 +prefix="httpd-${ver}" +suffix="r$1${2:++}" +fn="${prefix}-${suffix}.patch" +vcurl="http://svn.apache.org/viewvc?view=revision&revision=" + +if test -f ${fn}; then + mv -v -f ${fn} ${fn}\~ + sed '/^--- /,$d' < ${fn}\~ > ${fn} +else + echo > ${fn} +fi + +new=0 +for r in $*; do + if ! grep -q "${vcurl}${r}" ${fn}; then + echo "${vcurl}${r}" + new=1 + fi +done >> ${fn} + +[ $new -eq 0 ] || echo >> ${fn} + +prev=/dev/null +for r in $*; do + echo "+ fetching ${r}" + this=`mktemp /tmp/pullrevXXXXXX` + svn diff -c ${r} ${repo} | filterdiff --remove-timestamps --addprefix="${prefix}/" > ${this} + next=`mktemp /tmp/pullrevXXXXXX` + combinediff --quiet ${prev} ${this} > ${next} + rm -f "${this}" + [ "${prev}" = "/dev/null" ] || rm -f "${prev}" + prev=${next} +done + +cat ${prev} >> ${fn} + +vi "${fn}" +echo "+ git add ${fn}" +git add "${fn}" +echo "+ spec template:" +echo "PatchN: ${fn}" +echo "%patchN -p1 -b .${suffix}" |
