Apply the patches using git apply instead of patch

Need to be in the empserver directory before applying
the "git apply" command, move the "cd empserver" to the
clone step. This change also fixes a bug when using
with an existing repository not being the correct
directory when executing the "git pull" command.
Fixes commit acd768e5e2 as it used git diff format.
This commit is contained in:
Ron Koenderink 2008-02-16 11:09:19 -06:00
parent 5461c86994
commit ffee7cd10d

View file

@ -112,7 +112,9 @@ then
RETR="`expr 1 + ${RETR}`" RETR="`expr 1 + ${RETR}`"
[ "${RETR}" -gt 5 ] && err "git-clone Timeout after ${RETR} retres." [ "${RETR}" -gt 5 ] && err "git-clone Timeout after ${RETR} retres."
done done
cd empserver || err "Could not cd to ${BOXDIR}/${WORKDIR}/empserver."
else else
cd empserver || err "Could not cd to ${BOXDIR}/${WORKDIR}/empserver."
while ! git pull $GITROOT master >/dev/null while ! git pull $GITROOT master >/dev/null
do do
sleep "`expr 5 + ${RETR}`" sleep "`expr 5 + ${RETR}`"
@ -142,7 +144,7 @@ echo "Applying global patches from ${BOXDIR}/${WORKDIR}/empserver/src/scripts/ni
for i in "${BOXDIR}/${WORKDIR}/empserver/src/scripts/nightly/patches/All"/*.patch for i in "${BOXDIR}/${WORKDIR}/empserver/src/scripts/nightly/patches/All"/*.patch
do do
[ -r "${i}" ] || continue [ -r "${i}" ] || continue
if ${PATCH:=patch} -Np0 < "${i}" >/dev/null if git apply "${i}" >/dev/null
then then
echo "${i}: OK" echo "${i}: OK"
else else
@ -159,7 +161,7 @@ then
for i in "${LOCALPATCHDIRECTORY}"/*.patch for i in "${LOCALPATCHDIRECTORY}"/*.patch
do do
[ -r "${i}" ] || continue [ -r "${i}" ] || continue
if ${PATCH:=patch} -Np0 < "${i}" >/dev/null if git apply "${i}" >/dev/null
then then
echo "${i}: OK" echo "${i}: OK"
else else
@ -170,8 +172,6 @@ then
echo "" echo ""
fi fi
cd empserver || err "Could not cd to ${BOXDIR}/${WORKDIR}/empserver."
git-pull git-pull
sh ./bootstrap sh ./bootstrap
./configure --prefix ${BOXDIR}/${WORKDIR}/emp4 ./configure --prefix ${BOXDIR}/${WORKDIR}/emp4