forked from tsuru/basebuilder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathso_dependencies
executable file
·32 lines (30 loc) · 1.05 KB
/
so_dependencies
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash -el
# Copyright 2015 basebuilder authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
function so_dependencies() {
export DEBIAN_FRONTEND=noninteractive
if [ -f ${CURRENT_DIR}/repositories.apt ]; then
set +e
sudo -E apt-get install software-properties-common -y --force-yes
status=$?
set -e
if [ ${status} != 0 ]; then
sudo apt-get update
sudo -E apt-get install software-properties-common -y --force-yes
fi
for repo in `cat ${CURRENT_DIR}/repositories.apt`; do
sudo -E add-apt-repository -y ${repo}
done
fi
if [ -f ${CURRENT_DIR}/requirements.apt ]; then
set +e
sudo -E apt-get install $(cat ${CURRENT_DIR}/requirements.apt) -y --force-yes
status=$?
set -e
if [ ${status} != 0 ]; then
sudo apt-get update
sudo -E apt-get install $(cat ${CURRENT_DIR}/requirements.apt) -y --force-yes
fi
fi
}