From 4b743a1f2435454da297ff55d531157101d77f7e Mon Sep 17 00:00:00 2001 From: IkiWiki Date: Tue, 3 Mar 2020 03:49:46 -0500 Subject: install bsvup locally if missing --- .gitmodules | 4 ++++ backend/dep/bsvup | 1 + backend/resilient/__init__.py | 1 - backend/resilient/bsv_metanet.py | 9 ++++++++- 4 files changed, 13 insertions(+), 2 deletions(-) create mode 160000 backend/dep/bsvup diff --git a/.gitmodules b/.gitmodules index 1da5bc3..c3df40a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,7 @@ [submodule "backend/dep/ikiwiki"] path = backend/dep/ikiwiki url = git://git.ikiwiki.info/ +[submodule "backend/dep/bsvup"] + path = backend/dep/bsvup + url = https://github.com/xloem/bsvup.git + branch = paramsadjust4 diff --git a/backend/dep/bsvup b/backend/dep/bsvup new file mode 160000 index 0000000..062592d --- /dev/null +++ b/backend/dep/bsvup @@ -0,0 +1 @@ +Subproject commit 062592d6f259780f3cc0a81c15662e43b39c8371 diff --git a/backend/resilient/__init__.py b/backend/resilient/__init__.py index 73ad2db..1df09bd 100644 --- a/backend/resilient/__init__.py +++ b/backend/resilient/__init__.py @@ -108,7 +108,6 @@ class ikiwiki: if not found: print("ikiwiki not found: attempting to build") os.system("%s/build_ikiwiki.sh" % dep_path) - binary = "%s/prefix/bin/ikiwiki" % dep_path found = (os.system("%s --version" % binary) == 0) if not found: print("WARNING: ikiwiki not found. did build fail on this platform?") diff --git a/backend/resilient/bsv_metanet.py b/backend/resilient/bsv_metanet.py index 3d21b3e..62bf6c1 100644 --- a/backend/resilient/bsv_metanet.py +++ b/backend/resilient/bsv_metanet.py @@ -7,8 +7,15 @@ import time class bsvup(): binary = "bsvup" - found = (os.system("%s" % binary) == 0) + found = (os.system("%s --version" % binary) == 0) # TODO: check dep_path for alternate location for binary + if not found: + binary = "%s/prefix/bin/bsvup" % dep_path + found = (os.system("%s --version" % binary) == 0) + if not found: + print("bsvup not found: attempting to install") + os.system("npm install --prefix %s/prefix -g %s/bsvup" % (dep_path, dep_path)) + found = (os.system("%s --version" % binary) == 0) if not found: print("WARNING: bsvup not found. bsv metanet won't be updated") -- cgit v1.2.3