summaryrefslogtreecommitdiff
path: root/db-functions
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2010-09-11 22:52:23 +0200
committerPierre Schmitz <pierre@archlinux.de>2010-09-11 22:52:23 +0200
commitf121126f8166fb6dc261ea82f2890ba6693d047e (patch)
treee909b76baee677c75970eff6f5ede36092abd391 /db-functions
parent8768380b62525537e55def81c3273eeb4f9a88d3 (diff)
Use local config instead of guessing by hostname
Using the hostname to decide which repos to use is not releiable and hard to test. Instead use config.local to configure these. config files for sigurd and gerolde were added which can be copied or symlinked to config.local on the specific host.
Diffstat (limited to 'db-functions')
-rw-r--r--db-functions29
1 files changed, 8 insertions, 21 deletions
diff --git a/db-functions b/db-functions
index 18029ee..939f2d5 100644
--- a/db-functions
+++ b/db-functions
@@ -294,7 +294,7 @@ check_pkgsvn() {
[ $? -ge 1 ] && return 1
local repo="${2}"
- in_array "${repo}" $(get_repos_for_host) || return 1
+ in_array "${repo}" ${PKGREPOS[@]} || return 1
if [ ! -f "${WORKDIR}/pkgbuilds/${repo}/${pkgbase}" ]; then
mkdir -p "${WORKDIR}/pkgbuilds/${repo}"
@@ -320,13 +320,13 @@ check_pkgrepos() {
local pkgver="$(getpkgver ${pkgfile})"
[ $? -ge 1 ] && return 1
- if [ -f "${FTP_BASE}/$(get_pkgpool_for_host)/${pkgname}-${pkgver}-"*${PKGEXT} ]; then
+ if [ -f "${FTP_BASE}/${PKGPOOL}/${pkgname}-${pkgver}-"*${PKGEXT} ]; then
return 1
fi
local repo
local arch
- for repo in $(get_repos_for_host); do
+ for repo in ${PKGREPOS[@]}; do
for arch in ${ARCHES[@]}; do
if [ -f "${FTP_BASE}/${repo}/os/${arch}/${pkgname}-${pkgver}"*${PKGEXT} ]; then
return 1
@@ -337,22 +337,6 @@ check_pkgrepos() {
return 0
}
-get_repos_for_host() {
- if [ -n "${PKGREPO[$(hostname -s)]}" ]; then
- echo "${PKGREPO[$(hostname -s)]}"
- else
- echo "${PKGREPO['default']}"
- fi
-}
-
-get_pkgpool_for_host() {
- if [ -n "${PKGPOOL[$(hostname -s)]}" ]; then
- echo "${PKGPOOL[$(hostname -s)]}"
- else
- echo "${PKGPOOL['default']}"
- fi
-}
-
#usage: chk_license ${license[@]}"
chk_license() {
local l
@@ -397,9 +381,12 @@ pkgver_from_src() {
check_repo_permission() {
local repo=$1
- in_array "${repo}" $(get_repos_for_host) || return 1
+ [ ${#PKGREPOS[@]} -eq 0 ] && return 1
+ [ -z "${PKGPOOL}" ] && return 1
+
+ in_array "${repo}" ${PKGREPOS[@]} || return 1
- [ -w "$FTP_BASE/$(get_pkgpool_for_host)" ] || return 1
+ [ -w "$FTP_BASE/${PKGPOOL}" ] || return 1
local arch
for arch in ${ARCHES}; do