AlinsRan commented on code in PR #10729:
URL: https://github.com/apache/apisix/pull/10729#discussion_r1440056389


##########
utils/install-dependencies.sh:
##########
@@ -107,12 +103,46 @@ function multi_distro_installation() {
         install_dependencies_with_aur
     else
         echo "Non-supported operating system version"
+        exit 1
+    fi
+    install_apisix_runtime
+}
+
+function multi_distro_uninstallation() {
+    if grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
+        sudo yum autoremove -y openresty-zlib-devel openresty-pcre-devel
+    elif grep -Eqi -e "Red Hat" -e "rhel" /etc/*-release; then
+        sudo yum autoremove -y openresty-zlib-devel openresty-pcre-devel
+    elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; 
then
+        sudo yum autoremove -y openresty-zlib-devel openresty-pcre-devel
+    elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; 
then
+        sudo apt-get autoremove -y openresty-zlib-dev openresty-pcre-dev
+    elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; 
then
+        sudo apt-get autoremove -y openresty-zlib-dev openresty-pcre-dev
+    else
+        echo "Non-supported operating system version"
+        exit 1
     fi
 }
 
+function install_apisix_runtime() {
+    export runtime_version=${APISIX_RUNTIME:?}
+    wget 
"https://raw.githubusercontent.com/api7/apisix-build-tools/apisix-runtime/${APISIX_RUNTIME}/build-apisix-runtime.sh";
+    chmod +x build-apisix-runtime.sh
+    ./build-apisix-runtime.sh latest
+    rm build-apisix-runtime.sh
+}
+
 # Install LuaRocks
 function install_luarocks() {
-    curl 
https://raw.githubusercontent.com/apache/apisix/master/utils/linux-install-luarocks.sh
 -sL | bash -
+    if [ -f "./utils/linux-install-luarocks.sh" ]; then
+        ./utils/linux-install-luarocks.sh
+    elif [ -f "./linux-install-luarocks.sh" ]; then
+        ./linux-install-luarocks.sh

Review Comment:
   The script can be executed separately in the `utils/` directory.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to