oolite/debian/apply-patches

37 lines
652 B
Bash
Executable File

#!/bin/sh
#
# Quick and dirty patching script.
# Copyright (C) 2007 Chris Crowther <hikari@hikari.org.uk>
#
# Additional Changes: Michael Werle <micha@michaelwerle.com>
#
# History:
# 2008.11.02 MKW Auto-read all patches from patch directory
#
# $Id$
#
PATCHES=`ls -1 debian/patches`
FLAGS=""
while getopts ":R" option
do
case $option in
R)
if test -f patch; then
echo "Patches have been applied: reversing."
export FLAGS="$FLAGS -R";
else
echo "Patches have not been applied: not reversing."
exit 0;
fi
;;
esac
done
echo "Using patch flags: $FLAGS"
for PATCH in $PATCHES; do
patch $FLAGS -p0 < debian/patches/$PATCH
done;