File: debinstall.sh

package info (click to toggle)
odoo 18.0.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 878,716 kB
  • sloc: javascript: 927,937; python: 685,670; xml: 388,524; sh: 1,033; sql: 415; makefile: 26
file content (27 lines) | stat: -rwxr-xr-x 762 bytes parent folder | download
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
#!/bin/sh
#
# Install Debian packages needed to run Odoo.


if [ "$1" = "-l" -o "$1" = "--list" ]; then
    cmd="echo"
else
    cmd="apt-get install -y --no-install-recommends"
    if [ "$(id -u)" -ne "0" ]; then
        echo "\033[0;31mThis script must be run as root to install dependencies, starting a dry run.\033[0m" >&2
        cmd="$cmd -s"
    else
        apt-get update
    fi
    if [ "$1" = "-q" -o "$1" = "--quiet" ]; then
        cmd="$cmd -qq"
    fi
fi

script_path=$(realpath "$0")
script_dir=$(dirname "$script_path")
control_path=$(realpath "$script_dir/../debian/control")

sed -n '/^Depends:/,/^[A-Z]/p' "$control_path" \
| awk '/^ [a-z]/ { gsub(/,/,"") ; gsub(" ", "") ; print $NF }' | sort -u \
| DEBIAN_FRONTEND=noninteractive xargs $cmd