Просмотр исходного кода

fix(install): dependency checking for CentOS 8 and upgrade gsquery to python3 (#2526)

Frisasky 6 лет назад
Родитель
Сommit
4cb2417db7
3 измененных файлов с 16 добавлено и 11 удалено
  1. 1 1
      .travis.yml
  2. 13 8
      lgsm/functions/check_deps.sh
  3. 2 2
      lgsm/functions/query_gsquery.py

+ 1 - 1
.travis.yml

@@ -19,7 +19,7 @@ addons:
     - gzip
     - gzip
     - unzip
     - unzip
     - bsdmainutils
     - bsdmainutils
-    - python
+    - python3
     - util-linux
     - util-linux
     - ca-certificates
     - ca-certificates
     - binutils
     - binutils

+ 13 - 8
lgsm/functions/check_deps.sh

@@ -42,7 +42,10 @@ fn_install_mono_repo(){
 					monoautoinstall="1"
 					monoautoinstall="1"
 				fi
 				fi
 			elif [ "${distroid}" == "debian" ]; then
 			elif [ "${distroid}" == "debian" ]; then
-				if [ "${distroversion}" == "9" ]; then
+				if [ "${distroversion}" == "10" ]; then
+					cmd="sudo apt install apt-transport-https dirmngr;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/debian stable-buster main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update"
+					eval ${cmd}
+				elif [ "${distroversion}" == "9" ]; then
 					cmd="sudo apt install apt-transport-https dirmngr;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/debian stable-stretch main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update"
 					cmd="sudo apt install apt-transport-https dirmngr;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/debian stable-stretch main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update"
 					eval ${cmd}
 					eval ${cmd}
 				elif [ "${distroversion}" == "8" ]; then
 				elif [ "${distroversion}" == "8" ]; then
@@ -332,7 +335,7 @@ fn_deps_build_debian(){
 	array_deps_missing=()
 	array_deps_missing=()
 
 
 	# LinuxGSM requirements.
 	# LinuxGSM requirements.
-	array_deps_required=( curl wget ca-certificates file bsdmainutils util-linux python bzip2 gzip unzip binutils bc jq )
+	array_deps_required=( curl wget ca-certificates file bsdmainutils util-linux python3 bzip2 gzip unzip binutils bc jq )
 
 
 	# All servers except ts3 require tmux.
 	# All servers except ts3 require tmux.
 	if [ "${shortname}" != "ts3" ]; then
 	if [ "${shortname}" != "ts3" ]; then
@@ -443,17 +446,19 @@ fn_deps_build_redhat(){
 	array_deps_missing=()
 	array_deps_missing=()
 
 
 	# LinuxGSM requirements.
 	# LinuxGSM requirements.
-	# CentOS 6
+	# CentOS
 	if [ "${distroversion}" == "6" ]; then
 	if [ "${distroversion}" == "6" ]; then
-		array_deps_required=( epel-release curl wget util-linux-ng python file gzip bzip2 unzip binutils bc jq )
+		array_deps_required=( epel-release curl wget util-linux-ng python3 file gzip bzip2 unzip binutils bc jq )
 	elif [ "${distroversion}" == "7" ]; then
 	elif [ "${distroversion}" == "7" ]; then
-		array_deps_required=( epel-release curl wget util-linux python file gzip bzip2 unzip binutils bc jq )
+		array_deps_required=( epel-release curl wget util-linux python3 file gzip bzip2 unzip binutils bc jq )
+	elif [ "${distroversion}" == "8" ]; then
+		array_deps_required=( epel-release curl wget util-linux python3 file gzip bzip2 unzip binutils bc jq )
 	elif [ "${distroid}" == "fedora" ]; then
 	elif [ "${distroid}" == "fedora" ]; then
-			array_deps_required=( curl wget util-linux python2 file gzip bzip2 unzip binutils bc jq )
+			array_deps_required=( curl wget util-linux python3 file gzip bzip2 unzip binutils bc jq )
 	elif [[ "${distroname}" == *"Amazon Linux AMI"* ]]; then
 	elif [[ "${distroname}" == *"Amazon Linux AMI"* ]]; then
-			array_deps_required=( curl wget util-linux python27 file gzip bzip2 unzip binutils bc jq )
+			array_deps_required=( curl wget util-linux python3 file gzip bzip2 unzip binutils bc jq )
 	else
 	else
-		array_deps_required=( curl wget util-linux python file gzip bzip2 unzip binutils bc jq )
+		array_deps_required=( curl wget util-linux python3 file gzip bzip2 unzip binutils bc jq )
 	fi
 	fi
 
 
 	# All servers except ts3 require tmux.
 	# All servers except ts3 require tmux.

+ 2 - 2
lgsm/functions/query_gsquery.py

@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 # query_gsquery.py
 # query_gsquery.py
 # Author: Anonymous & Daniel Gibbs
 # Author: Anonymous & Daniel Gibbs
@@ -82,7 +82,7 @@ class gsquery:
 
 
 if __name__ == '__main__':
 if __name__ == '__main__':
     parser = optparse.OptionParser(
     parser = optparse.OptionParser(
-        usage='usage: python %prog [options]',
+        usage='usage: python3 %prog [options]',
         version='%prog 0.0.1'
         version='%prog 0.0.1'
     )
     )
     parser.add_option(
     parser.add_option(