mirror of
https://github.com/deneraraujo/OpenVPNAdapter.git
synced 2026-04-24 00:00:05 +08:00
Add scripts to apply patches
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
function apply_patches()
|
||||
{
|
||||
DEP_SRC_DIR=$1
|
||||
DEP_PATCH_DIR=$2
|
||||
|
||||
CURRENT_DIR=$(pwd)
|
||||
|
||||
pushd ${CURRENT_DIR}
|
||||
|
||||
cd /tmp
|
||||
|
||||
for file in ${CURRENT_DIR}/${DEP_PATCH_DIR}/*.patch; do
|
||||
echo Applying patch: $file
|
||||
git apply --directory ${CURRENT_DIR}/${DEP_SRC_DIR} --unsafe-path $file
|
||||
done
|
||||
|
||||
popd
|
||||
}
|
||||
|
||||
function reverse_patches()
|
||||
{
|
||||
DEP_SRC_DIR=$1
|
||||
DEP_PATCH_DIR=$2
|
||||
|
||||
CURRENT_DIR=$(pwd)
|
||||
|
||||
pushd ${CURRENT_DIR}
|
||||
|
||||
cd /tmp
|
||||
|
||||
for file in ${CURRENT_DIR}/${DEP_PATCH_DIR}/*.patch; do
|
||||
echo Reverse patch: $file
|
||||
git apply --reverse --directory ${CURRENT_DIR}/${DEP_SRC_DIR} --unsafe-path $file
|
||||
done
|
||||
|
||||
popd
|
||||
}
|
||||
Reference in New Issue
Block a user