Move checkdeps to buildscripts/, additionally add patch.sh

patch.sh patches any source codepath with the patch provided,
for now the patch file included is a way to Hide flags for
codegangsta until it is merged upstream.

Not part of the build yet.
This commit is contained in:
Harshavardhana
2015-03-18 11:20:26 -07:00
parent 635507453e
commit ac8a0e109f
4 changed files with 293 additions and 1 deletions
+43
View File
@@ -0,0 +1,43 @@
#!/bin/bash
usage() {
echo "Invalid arguments needs a <patch> <directory> "
exit 1
}
_init() {
if [ $# -lt 2 ]; then
usage;
fi
if [ ! -f $1 ]; then
usage;
fi
if [ ! -d $2 ]; then
usage;
fi
CODEPATH=$2
PATCH=$1
CP="/bin/cp"
P="/usr/bin/patch"
B="/usr/bin/basename"
R="/bin/rm"
}
main () {
echo ${PWD}
echo "Copying ${PATCH} to ${CODEPATH}"
${CP} -f ${PATCH} ${CODEPATH}
_pwd=${PWD}
cd ${CODEPATH}
patch=$(${B} ${PATCH})
${P} -p1 -R < ${patch}
${R} -f ${patch}
cd ${_pwd}
}
_init "$@" && main "$@"