Remane apt_opt to apt_cmd and use it also in install_build_depend.sh

This commit is contained in:
Timofey Turenko
2020-07-29 14:51:32 +03:00
parent 4a53db9483
commit 796fdf4e16
2 changed files with 23 additions and 23 deletions

View File

@ -65,34 +65,34 @@ then
sudo apt-get update sudo apt-get update
sudo dpkg-reconfigure libc6 sudo dpkg-reconfigure libc6
sudo -E apt-get -q -o Dpkg::Options::=--force-confold \ apt_cmd="sudo -E apt-get -q -o Dpkg::Options::=--force-confold \
-o Dpkg::Options::=--force-confdef \ -o Dpkg::Options::=--force-confdef \
-y --force-yes \ -y --force-yes"
install dpkg-dev git wget \ ${apt_cmd} install dpkg-dev git wget \
build-essential libssl-dev ncurses-dev bison flex \ build-essential libssl-dev ncurses-dev bison flex \
perl libtool libpcre3-dev tcl tcl-dev uuid \ perl libtool libpcre3-dev tcl tcl-dev uuid \
uuid-dev libsqlite3-dev liblzma-dev libpam0g-dev pkg-config \ uuid-dev libsqlite3-dev liblzma-dev libpam0g-dev pkg-config \
libedit-dev libedit-dev
# One of these will work, older systems use libsystemd-daemon-dev # One of these will work, older systems use libsystemd-daemon-dev
sudo apt-get install -y libsystemd-dev || \ ${apt_cmd} install libsystemd-dev || \
sudo apt-get install -y libsystemd-daemon-dev ${apt_cmd} install libsystemd-daemon-dev
## separatelibgnutls installation process for Ubuntu Trusty ## separate libgnutls installation process for Ubuntu Trusty
cat /etc/*release | grep -E "Trusty|wheezy" cat /etc/*release | grep -E "Trusty|wheezy"
if [ $? == 0 ] if [ $? == 0 ]
then then
sudo apt-get install -y --force-yes libgnutls-dev libgcrypt11-dev ${apt_cmd} install libgnutls-dev libgcrypt11-dev
else else
sudo apt-get install -y --force-yes libgnutls30 libgnutls-dev ${apt_cmd} install libgnutls30 libgnutls-dev
if [ $? != 0 ] if [ $? != 0 ]
then then
sudo apt-get install -y --force-yes libgnutls28-dev ${apt_cmd} install libgnutls28-dev
fi fi
sudo apt-get install -y --force-yes libgcrypt20-dev ${apt_cmd} install libgcrypt20-dev
if [ $? != 0 ] if [ $? != 0 ]
then then
sudo apt-get install -y --force-yes libgcrypt11-dev ${apt_cmd} install libgcrypt11-dev
fi fi
fi fi
fi fi

View File

@ -17,38 +17,38 @@ then
sudo cp mariadb.list /etc/apt/sources.list.d/ sudo cp mariadb.list /etc/apt/sources.list.d/
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0xF1656F24C74CD1D8 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0xF1656F24C74CD1D8
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
sudo apt-get update apt_cmd="sudo -E apt-get -q -o Dpkg::Options::=--force-confold \
apt_opt="sudo -E apt-get -q -o Dpkg::Options::=--force-confold \
-o Dpkg::Options::=--force-confdef \ -o Dpkg::Options::=--force-confdef \
-y --force-yes" -y --force-yes"
${apt_opt} install \ ${apt_cmd} update
${apt_cmd} install \
git wget build-essential \ git wget build-essential \
libssl-dev mariadb-client php perl \ libssl-dev mariadb-client php perl \
coreutils libjansson-dev zlib1g-dev \ coreutils libjansson-dev zlib1g-dev \
mariadb-test python python-pip cmake libpam0g-dev mariadb-test python python-pip cmake libpam0g-dev
## separatelibgnutls installation process for Ubuntu Trusty ## separate libgnutls installation process for Ubuntu Trusty
cat /etc/*release | grep -E "Trusty|wheezy" cat /etc/*release | grep -E "Trusty|wheezy"
if [ $? == 0 ] if [ $? == 0 ]
then then
${apt_opt} install libgnutls-dev libgcrypt11-dev ${apt_cmd} install libgnutls-dev libgcrypt11-dev
else else
${apt_opt} install libgnutls30 libgnutls-dev ${apt_cmd} install libgnutls30 libgnutls-dev
if [ $? != 0 ] if [ $? != 0 ]
then then
${apt_opt} install libgnutls28-dev ${apt_cmd} install libgnutls28-dev
fi fi
${apt_opt} install libgcrypt20-dev ${apt_cmd} install libgcrypt20-dev
if [ $? != 0 ] if [ $? != 0 ]
then then
${apt_opt} install libgcrypt11-dev ${apt_cmd} install libgcrypt11-dev
fi fi
fi fi
${apt_opt} install openjdk-8-jdk ${apt_cmd} install openjdk-8-jdk
${apt_opt} install php-mysql ${apt_cmd} install php-mysql
if [ $? != 0 ] if [ $? != 0 ]
then then
${apt_opt} install openjdk-7-jdk ${apt_cmd} install openjdk-7-jdk
fi fi
pip install --upgrade pip pip install --upgrade pip
pip install JayDeBeApi pip install JayDeBeApi