summaryrefslogtreecommitdiff
path: root/src/bin/db-init
blob: fa989fc0a2a22313ff395d2d73ce88048ee344c9 (plain)
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
#!/bin/bash
# Creates the repo structure defined in config

CONFIG_DIR="$(dirname "$(readlink -e "$0")")/etc"

source "${CONFIG_DIR}/xbs.cfg"
source "${SHARE_DIR}/db-functions"

platforms=("${@:1}")

for '_platform' in "${PLATFORMS[@]}"; do
	if [ "${#}" -eq '0' ]; then
		source "${CONFIG_DIR}/xbs.d/${platform}.cfg"
	else
		# Rename ("${plataform}") to easily script usage
		_platform_name="${platform/\//+}" _platform_name="${_platforms_name,,}"

		if [ "${_platform_name}" == "${_platform}" ]; then
			source "${CONFIG_DIR}/xbs.d/${_platform_name}.cfg"
		else
			die "This ${plataform} doesn't exist"
		fi
	fi

	mkdir -p -- "${PKG_MAIN_POOLS}" "${SRC_MAIN_POOLS}" "${CLEANUP_DESTDIR}" "${SOURCE_CLEANUP_DESTDIR}" "${STAGING}"
done

# "${BIN_DIR}/db-repo-add" -p "${_platform}" "${PKG_REPOS[@]}"