mirror of
https://github.com/deneraraujo/OpenVPNAdapter.git
synced 2026-04-24 00:00:05 +08:00
Merge commit '86cc97e55fe346502462284d2e636a2b3708163e' as 'Sources/OpenVPN3'
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
function check_download()
|
||||
{
|
||||
if [ -f $DL/$FNAME ]; then
|
||||
CHECK=$(shasum -a 256 $DL/$FNAME |awk '{printf $1};')
|
||||
if [ "$CHECK" == "$CSUM" ]; then
|
||||
return 0
|
||||
else
|
||||
echo "Checksum mismatch for $FNAME. Was $CHECK, expected $CSUM"
|
||||
fi
|
||||
else
|
||||
echo "$FNAME not found."
|
||||
fi
|
||||
|
||||
return -1
|
||||
}
|
||||
|
||||
function download()
|
||||
{
|
||||
check_download && return 0
|
||||
|
||||
rm -f $DL/$FNAME
|
||||
if [ -n "$URL" ]; then
|
||||
wget $URL -O $DL/$FNAME
|
||||
else
|
||||
echo URL must be specified
|
||||
exit 1
|
||||
fi
|
||||
|
||||
check_download || return -1
|
||||
}
|
||||
|
||||
function apply_patches()
|
||||
{
|
||||
DEP_NAME=$1
|
||||
|
||||
# change directory since git apply got confused when
|
||||
# applying patches to files which are not found in index
|
||||
DIR=$(pwd)
|
||||
pushd ${DIR}
|
||||
cd /tmp
|
||||
# apply pre-generated patches
|
||||
for file in $O3/core/deps/${DEP_NAME}/patches/*.patch; do
|
||||
echo Applying patch: $file
|
||||
git apply --directory ${DIR} --unsafe-path $file
|
||||
done
|
||||
popd
|
||||
}
|
||||
Reference in New Issue
Block a user