Accept the patch file from argument

This commit is contained in:
Benito Palacios Sánchez 2016-02-29 14:15:06 +01:00
parent 1336b2c7b5
commit f8ba06c619

View File

@ -1,5 +1,10 @@
#!/bin/bash #!/bin/bash
if [[ -z "$1" ]] ; then
echo "The first argument must be the relative path to the patch to apply."
exit -1
fi
if [[ ! -d "desmume" ]] ; then if [[ ! -d "desmume" ]] ; then
# Checkout the desmume code if it doesn't exist # Checkout the desmume code if it doesn't exist
svn checkout svn://svn.code.sf.net/p/desmume/code/trunk desmume svn checkout svn://svn.code.sf.net/p/desmume/code/trunk desmume
@ -11,7 +16,7 @@ else
fi fi
# Apply our patch # Apply our patch
patch -p0 -i ../patch.diff patch -p0 -i ../"$1"
# Run the pre-steps # Run the pre-steps
# Yes, there is a desmume folder inside the root folder # Yes, there is a desmume folder inside the root folder
@ -22,10 +27,10 @@ cd desmume
./configure --enable-debug --enable-developer ./configure --enable-debug --enable-developer
# Make # Make
if [[ -z "$1" ]] ; then if [[ -z "$2" ]] ; then
make make
else else
make -j$1 make -j$2
fi fi
# We are not install but copying the executable # We are not install but copying the executable