mirror of
https://github.com/amnezia-vpn/OpenVPNAdapter.git
synced 2026-05-17 00:05:46 +03:00
chore: pull out functions from the separate file to the apply_patches.sh
This commit is contained in:
@@ -2,7 +2,45 @@
|
||||
|
||||
set -e
|
||||
|
||||
. Scripts/functions.sh
|
||||
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
|
||||
|
||||
REVERSED_PATCHES=$(ls -1 ${CURRENT_DIR}/${DEP_PATCH_DIR}/*.patch | sort -r)
|
||||
|
||||
for FILE in $REVERSED_PATCHES; do
|
||||
echo Reverse patch: $FILE
|
||||
git apply --reverse --directory ${CURRENT_DIR}/${DEP_SRC_DIR} --unsafe-path $FILE
|
||||
done
|
||||
|
||||
popd
|
||||
}
|
||||
|
||||
ASIO_SRC_DIR="Sources/ASIO"
|
||||
ASIO_PATCH_DIR="Sources/OpenVPN3/deps/asio/patches"
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
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
|
||||
|
||||
REVERSED_PATCHES=$(ls -1 ${CURRENT_DIR}/${DEP_PATCH_DIR}/*.patch | sort -r)
|
||||
|
||||
for FILE in $REVERSED_PATCHES; 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