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"
|
2021-10-12 13:01:42 +00:00
|
|
|
#repo="https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x"
|
2023-12-08 11:09:28 +00:00
|
|
|
ver=2.4.58
|
2012-04-27 12:40:37 +00:00
|
|
|
prefix="httpd-${ver}"
|
2020-04-17 10:57:16 +00:00
|
|
|
suffix="${SUFFIX:-r$1${2:++}}"
|
2012-04-27 12:40:37 +00:00
|
|
|
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
|
2020-04-17 10:57:16 +00:00
|
|
|
case $r in
|
|
|
|
http*) url=$r ;;
|
|
|
|
*) url=${vcurl}${r} ;;
|
|
|
|
esac
|
|
|
|
if ! grep -q "^${url}" ${fn}; then
|
|
|
|
echo "${url}"
|
2012-04-27 12:40:37 +00:00
|
|
|
new=1
|
|
|
|
fi
|
|
|
|
done >> ${fn}
|
|
|
|
|
|
|
|
[ $new -eq 0 ] || echo >> ${fn}
|
|
|
|
|
|
|
|
prev=/dev/null
|
|
|
|
for r in $*; do
|
|
|
|
echo "+ fetching ${r}"
|
|
|
|
this=`mktemp /tmp/pullrevXXXXXX`
|
2020-04-17 10:57:16 +00:00
|
|
|
case $r in
|
|
|
|
http*) curl -s "$r" | filterdiff --strip=3 ;;
|
|
|
|
*) svn diff -c ${r} ${repo} ;;
|
|
|
|
esac | filterdiff --remove-timestamps --clean \
|
2023-12-08 11:09:28 +00:00
|
|
|
-x 'CHANGES' -x '*/next-number' -x 'STATUS' -x '*.xml' -x 'changes-entries/*' \
|
2020-04-17 10:57:16 +00:00
|
|
|
--addprefix="${prefix}/" > ${this}
|
2012-04-27 12:40:37 +00:00
|
|
|
next=`mktemp /tmp/pullrevXXXXXX`
|
2020-04-17 10:57:16 +00:00
|
|
|
if ! combinediff -w ${prev} ${this} > ${next}; then
|
|
|
|
echo "Failed combining previous ${prev} with ${this}";
|
|
|
|
exit 1
|
|
|
|
fi
|
2012-04-27 12:40:37 +00:00
|
|
|
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}"
|
2023-12-08 11:09:28 +00:00
|
|
|
echo "%patch -PN -p1 -b .${suffix}"
|