From 44f34b379169c4d6ac8955f37156178d890b74bf Mon Sep 17 00:00:00 2001 From: yungwine Date: Wed, 25 Dec 2024 16:57:46 +0400 Subject: [PATCH 1/2] update update.sh --- mytonctrl/scripts/update.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/mytonctrl/scripts/update.sh b/mytonctrl/scripts/update.sh index 8bd4ecd9..c9de406b 100644 --- a/mytonctrl/scripts/update.sh +++ b/mytonctrl/scripts/update.sh @@ -12,7 +12,7 @@ author="ton-blockchain" repo="mytonctrl" branch="master" srcdir="/usr/src/" -bindir="/usr/bin/" +tmpdir="/tmp/mytonctrl_src/" # Get arguments while getopts a:r:b: flag @@ -28,16 +28,18 @@ done COLOR='\033[92m' ENDC='\033[0m' -# Go to work dir -cd ${srcdir} +mkdir -p ${tmpdir} +cd ${tmpdir} +rm -rf ${tmpdir}/${repo} +echo "https://github.com/${author}/${repo}.git -> ${branch}" +git clone --recursive https://github.com/${author}/${repo}.git || exit 1 -# uninstall previous version rm -rf ${srcdir}/${repo} pip3 uninstall -y mytonctrl # Update code -echo "https://github.com/${author}/${repo}.git -> ${branch}" -git clone --recursive https://github.com/${author}/${repo}.git +cd ${srcdir} +cp -rf ${tmpdir}/${repo} ${srcdir} cd ${repo} && git checkout ${branch} pip3 install -U . From a7c6c027b94d8cef8fc88e3ac7f68207c17dc037 Mon Sep 17 00:00:00 2001 From: yungwine Date: Thu, 26 Dec 2024 12:07:25 +0400 Subject: [PATCH 2/2] update upgrade.sh --- mytonctrl/scripts/upgrade.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mytonctrl/scripts/upgrade.sh b/mytonctrl/scripts/upgrade.sh index c3c4c52b..fe952562 100644 --- a/mytonctrl/scripts/upgrade.sh +++ b/mytonctrl/scripts/upgrade.sh @@ -13,6 +13,7 @@ repo="ton" branch="master" srcdir="/usr/src/" bindir="/usr/bin/" +tmpdir="/tmp/ton_src/" # Get arguments while getopts a:r:b: flag @@ -59,13 +60,18 @@ else opensslPath=${bindir}/openssl_3 fi +rm -rf ${tmpdir}/${repo} +mkdir -p ${tmpdir}/${repo} +cd ${tmpdir}/${repo} +echo "https://github.com/${author}/${repo}.git -> ${branch}" +git clone --recursive https://github.com/${author}/${repo}.git . || exit 1 + # Go to work dir cd ${srcdir}/${repo} ls -A1 | xargs rm -rf # Update code -echo "https://github.com/${author}/${repo}.git -> ${branch}" -git clone --recursive https://github.com/${author}/${repo}.git . +cp -rfT ${tmpdir}/${repo} . git checkout ${branch} git submodule sync --recursive