2 # SPDX-license-identifier: Apache-2.0
3 ##############################################################################
4 # Copyright (c) 2020 Samsung Electronics
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
15 echo "Requirements validation"
16 # shellcheck disable=SC1091
17 source /etc/os-release || source /usr/lib/os-release
20 if ! command -v shellcheck; then
22 *suse*|rhel|centos|fedora)
31 if ! command -v pip; then
35 if [ -n "$pkgs" ]; then
36 echo "Requirements installation"
39 sudo zypper install --gpg-auto-import-keys refresh
40 sudo -H -E zypper install -y --no-recommends "$pkgs"
44 sudo -H -E apt-get -y --no-install-recommends install "$pkgs"
47 PKG_MANAGER=$(command -v dnf || command -v yum)
48 if ! sudo "$PKG_MANAGER" repolist | grep "epel/"; then
49 sudo -H -E "$PKG_MANAGER" -q -y install epel-release
51 sudo "$PKG_MANAGER" updateinfo --assumeyes
52 sudo -H -E "${PKG_MANAGER}" -y install "$pkgs"
57 echo "Server tools information:"
62 echo "Linting process execution"
64 bash -c 'shopt -s globstar; shellcheck -x **/*.sh'