Skip to content

Commit 60669f3

Browse files
committed
installJoinmarket: merge update and testPR
1 parent a5e5b56 commit 60669f3

2 files changed

Lines changed: 47 additions & 50 deletions

File tree

scripts/_functions.sh

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,10 @@ JMUptimeInSeconds=$(ps -p $JMpid -oetime= 2>/dev/null | tr '-' ':' | awk -F: '{
164164
JMUptime=$(printf '%dd:%dh:%dm\n' $((JMUptimeInSeconds/86400)) $((JMUptimeInSeconds%86400/3600)) $((JMUptimeInSeconds%3600/60)))
165165
}
166166

167+
168+
# installJoinMarket [update|testPR <PRnumber>]
167169
function installJoinMarket() {
168170
source /home/joinmarket/joinin.conf
169-
JMVersion="v0.7.2"
170171
cd /home/joinmarket
171172
# PySide2 for armf: https://packages.debian.org/buster/python3-pyside2.qtcore
172173
echo "# installing ARM specific dependencies to run the QT GUI"
@@ -176,13 +177,31 @@ function installJoinMarket() {
176177
sudo apt -y install build-essential automake pkg-config libffi-dev python3-dev libgmp-dev
177178
sudo -u joinmarket pip install libtool asn1crypto cffi pycparser coincurve
178179
echo "# installing JoinMarket"
180+
181+
if [ "$1" = "update" ] || [ "$1" = "testPR" ]; then
182+
echo "# deleting the old source code (joinmarket-clientserver directory)"
183+
sudo rm -rf /home/joinmarket/joinmarket-clientserver
184+
fi
185+
179186
sudo -u joinmarket git clone https://github.com/Joinmarket-Org/joinmarket-clientserver
180187
cd joinmarket-clientserver
181-
sudo -u joinmarket git reset --hard $JMVersion
188+
189+
if [ "$1" = "testPR" ]; then
190+
PRnumber=$2
191+
echo "# using the PR:"
192+
echo "# https://github.com/JoinMarket-Org/joinmarket-clientserver/pull/$PRnumber"
193+
git fetch origin pull/$PRnumber/head:pr$PRnumber
194+
git checkout pr$PRnumber
195+
else
196+
JMVersion="v0.7.2"
197+
sudo -u joinmarket git reset --hard $JMVersion
198+
fi
199+
182200
# do not stop at installing debian dependencies
183201
sudo -u joinmarket sed -i \
184202
"s#^ if ! sudo apt-get install \${deb_deps\[@\]}; then#\
185203
if ! sudo apt-get install -y \${deb_deps\[@\]}; then#g" install.sh
204+
186205
if [ ${cpu} != "x86_64" ]; then
187206
echo "# Make install.sh set up jmvenv with -- system-site-packages on arm"
188207
# and import the PySide2 armf package from the system

scripts/install.joinmarket.sh

Lines changed: 26 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -8,53 +8,8 @@ if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
88
fi
99

1010
source /home/joinmarket/_functions.sh
11-
12-
if [ "$1" = "testPR" ]; then
13-
PRnumber=$2
14-
echo "# deleting the old source code (joinmarket-clientserver directory)"
15-
sudo rm -rf /home/joinmarket/joinmarket-clientserver
16-
echo "# installing JoinMarket"
17-
echo "# using the PR:"
18-
echo "# https://github.com/JoinMarket-Org/joinmarket-clientserver/pull/$PRnumber"
19-
sudo -u joinmarket git clone https://github.com/Joinmarket-Org/joinmarket-clientserver
20-
cd joinmarket-clientserver
21-
git fetch origin pull/$PRnumber/head:pr$PRnumber
22-
git checkout pr$PRnumber
23-
# make install.sh set up jmvenv with -- system-site-packages
24-
# and import the PySide2 armf package from the system
25-
sudo -u joinmarket sed -i "s#^ virtualenv -p \"\${python}\" \"\${jm_source}/jmvenv\" || return 1#\
26-
virtualenv --system-site-packages -p \"\${python}\" \"\${jm_source}/jmvenv\" || return 1 ;\
27-
/home/joinmarket/joinmarket-clientserver/jmvenv/bin/python -c \'import PySide2\'\
28-
#g" install.sh
29-
# don't install PySide2 - using the system-site-package instead
30-
sudo -u joinmarket sed -i "s#^PySide2##g" requirements/gui.txt
31-
# don't install PyQt5 - using the system package instead
32-
sudo -u joinmarket sed -i "s#^PyQt5==5.14.2##g" requirements/gui.txt
33-
sudo -u joinmarket ./install.sh --with-qt
34-
echo "# installed JoinMarket with the PR:"
35-
echo "# https://github.com/JoinMarket-Org/joinmarket-clientserver/pull/$PRnumber"
36-
fi
37-
3811
source /home/joinmarket/joinin.conf
3912

40-
if [ "$1" = "install" ]; then
41-
# install joinmarket
42-
if [ ! -f "/home/joinmarket/joinmarket-clientserver/jmvenv/bin/activate" ] ; then
43-
echo
44-
echo "# JoinMarket is not yet installed - proceeding now"
45-
echo
46-
installJoinMarket
47-
errorOnInstall $?
48-
# run config after install
49-
/home/joinmarket/install.joinmarket.sh config
50-
else
51-
echo
52-
echo "# JoinMarket $currentJMversion is installed"
53-
echo
54-
fi
55-
exit 0
56-
fi
57-
5813
if [ "$1" = "config" ]; then
5914
# generate joinmarket.cfg
6015
if [ ! -f "/home/joinmarket/.joinmarket/joinmarket.cfg" ] ; then
@@ -95,11 +50,34 @@ if [ "$1" = "config" ]; then
9550
exit 0
9651
fi
9752

53+
if [ "$1" = "install" ]; then
54+
# install joinmarket
55+
if [ ! -f "/home/joinmarket/joinmarket-clientserver/jmvenv/bin/activate" ] ; then
56+
echo
57+
echo "# JoinMarket is not yet installed - proceeding now"
58+
echo
59+
installJoinMarket
60+
errorOnInstall $?
61+
# run config after install
62+
/home/joinmarket/install.joinmarket.sh config
63+
else
64+
echo
65+
echo "# JoinMarket $currentJMversion is installed"
66+
echo
67+
fi
68+
exit 0
69+
fi
70+
9871
if [ "$1" = "update" ]; then
9972
stopYG
100-
echo "# deleting the old source code (joinmarket-clientserver directory)"
101-
sudo rm -rf /home/joinmarket/joinmarket-clientserver
102-
installJoinMarket
73+
installJoinMarket update
10374
errorOnInstall $?
10475
exit 0
10576
fi
77+
78+
if [ "$1" = "testPR" ]; then
79+
stopYG
80+
installJoinMarket testPR $2
81+
errorOnInstall $?
82+
exit 0
83+
fi

0 commit comments

Comments
 (0)