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:
Executable
+43
@@ -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 "$@"
|
||||
Reference in New Issue
Block a user