From f3144bad5af9f577abc44a510ec656e688515877 Mon Sep 17 00:00:00 2001 From: gryf Date: Tue, 8 Oct 2019 08:04:39 +0200 Subject: [PATCH] Rearrange pip installed packages. Added pdbpp --- bootstrap_centos7.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/bootstrap_centos7.sh b/bootstrap_centos7.sh index bcc4a87..2f603e6 100755 --- a/bootstrap_centos7.sh +++ b/bootstrap_centos7.sh @@ -1,4 +1,6 @@ -#!/bin/bash -x +#!/bin/bash + +set -e # 1. update sudo yum -y install epel-release @@ -19,10 +21,17 @@ echo 'export EDITOR="vim"' | sudo tee -a /etc/profile.d/vim.sh # 5. install tools from pypi -if $(pip list |grep -e rainbow -e remote-pdb|wc -l|grep -qv 2); then - sudo pip install pip --upgrade - sudo pip install remote_pdb rainbow - sudo pip install -U setuptools +sudo pip install -U pip setuptools +installed_pkgs=$(pip list) +pkgs_to_install= +for pkg in remote_pdb pdbpp rainbow; do + if echo "${installed_pkgs}" | grep -qv "${pkg}"; then + pkgs_to_install="${pkgs_to_install} ${pkg}" + fi +done + +if [ -n "${pkgs_to_install}" ]; then + sudo pip install ${pkgs_to_install} fi # 6. copy configuration for bash, git, tmux