2012-05-31 13:30:31 +00:00
|
|
|
#!/bin/sh -e
|
2012-04-27 12:40:37 +00:00
|
|
|
|
|
|
|
if [ $# -lt 1 ]; then
|
|
|
|
echo "What?"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
repo="https://svn.apache.org/repos/asf/httpd/httpd/trunk"
|
2017-09-13 13:21:17 +00:00
|
|
|
#repo="https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x"
|
|
|
|
ver=2.4.27
|
2012-04-27 12:40:37 +00:00
|
|
|
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}\~
|
2012-05-31 13:28:46 +00:00
|
|
|
echo "# $0 $*" > ${fn}
|
|
|
|
sed '1{/#.*pullrev/d;};/^--- /,$d' < ${fn}\~ >> ${fn}
|
2012-04-27 12:40:37 +00:00
|
|
|
else
|
2012-05-31 13:28:46 +00:00
|
|
|
echo "# $0 $*" > ${fn}
|
2012-04-27 12:40:37 +00:00
|
|
|
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`
|
2018-06-12 14:19:00 +00:00
|
|
|
svn diff -c ${r} ${repo} | filterdiff --remove-timestamps --clean -x 'CHANGES' -x 'next-number' -x 'STATUS' \
|
2012-05-31 14:01:40 +00:00
|
|
|
--addprefix="${prefix}/" > ${this}
|
2012-04-27 12:40:37 +00:00
|
|
|
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}"
|