File: builddeps.sh

package info (click to toggle)
oregano 0.84.41+dfsg.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 11,856 kB
  • sloc: ansic: 22,476; python: 14,159; xml: 1,184; awk: 386; sh: 57; perl: 20; makefile: 17
file content (34 lines) | stat: -rwxr-xr-x 717 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
28
29
30
31
32
33
34
#!/usr/bin/env bash

distribution=$(cat /etc/os-release |grep "^NAME=" |cut -d '=' -f 2)

echo "Distribution detected is \"${distribution}\""

MODE="$1"

if [ ${MODE:="interactive"} != "ci" ]; then
	MODE="interactive"
fi

echo "Running $0 in $MODE mode"


if [ "${distribution}" = "\"Ubuntu\"" ]; then # idiots...
	PKGS="$(cat .concourse/ubuntu/pkg.lst)"
	if [ ${MODE} = "ci" ]; then
		apt-get update -y
		apt-get install -y $PKGS
	else
		apt-get install $PKGS
	fi
elif [ "${distribution}" = "Fedora" ]; then
	PKGS="$(cat .concourse/fedora/pkg.lst)"
	if [ ${MODE} = "ci" ]; then
		dnf update -y
		dnf install -y $PKGS
	else
		dnf install $PKGS
	fi
else
	echo "No idea what to do.. trying to run regular builddeps"
fi