summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-12-22 23:01:29 +0800
committerruki <[email protected]>2022-12-22 23:01:29 +0800
commit438a728a323fa73bc1067c1b6df5daa0654384df (patch)
treeacce07357c7b6e6234eddcef0b2de35d9ca6e279
parent2080455f5e38f96c43a036bbbe0515b3a0da5bad (diff)
improve get2.sh and update
-rwxr-xr-xscripts/get2.sh18
-rw-r--r--xmake/actions/update/main.lua7
2 files changed, 13 insertions, 12 deletions
diff --git a/scripts/get2.sh b/scripts/get2.sh
index e72d59782..6d75bc119 100755
--- a/scripts/get2.sh
+++ b/scripts/get2.sh
@@ -186,23 +186,21 @@ else
fi
fi
-# do configure
-if [ "$prefix" = "" ]; then
+# do build
+if [ "x$prefix" = "x" ]; then
prefix=~/.local
fi
-if [ "x$prefix" != x ]; then
- ./configure --prefix="$prefix" || raise "configure failed!"
-else
- ./configure || raise "configure failed!"
-fi
-
-# do build
if [ 'x__install_only__' != "x$2" ]; then
+ if [ "x$prefix" != "x" ]; then
+ ./configure --prefix="$prefix" || raise "configure failed!"
+ else
+ ./configure || raise "configure failed!"
+ fi
$make || raise "make failed!"
fi
# do install
-if [ "x$prefix" != x ]; then
+if [ "x$prefix" != "x" ]; then
$make install || raise "install failed!"
else
$sudoprefix $make install || raise "install failed!"
diff --git a/xmake/actions/update/main.lua b/xmake/actions/update/main.lua
index bc4310290..79708904d 100644
--- a/xmake/actions/update/main.lua
+++ b/xmake/actions/update/main.lua
@@ -209,8 +209,11 @@ function _install(sourcedir)
raise("the installer(%s) not found!", win_installer_name)
end
else
- os.vrun("make build")
- process.openv("./scripts/get.sh", {"__local__", "__install_only__"}, {stdout = os.tmpfile(), stderr = os.tmpfile(), detach = true}):close()
+ if os.isfile("./configure") then
+ os.vrun("./configure")
+ end
+ os.vrun("make")
+ process.openv("./scripts/get2.sh", {"__local__", "__install_only__"}, {stdout = os.tmpfile(), stderr = os.tmpfile(), detach = true}):close()
end
return true
end,