summaryrefslogtreecommitdiff
path: root/db-functions
diff options
context:
space:
mode:
Diffstat (limited to 'db-functions')
-rw-r--r--db-functions38
1 files changed, 19 insertions, 19 deletions
diff --git a/db-functions b/db-functions
index d76aa41..b993cd1 100644
--- a/db-functions
+++ b/db-functions
@@ -140,8 +140,8 @@ cleanup() {
rm -rf "$WORKDIR"
if (( REPO_MODIFIED )); then
- date +%s > "${FTP_BASE}/lastupdate"
- date -u +%s > "${FTP_BASE}/lastsync"
+ date +%s > "${root_dir}/lastupdate"
+ date -u +%s > "${root_dir}/lastsync"
fi
[ "$1" ] && exit "$1"
@@ -164,8 +164,8 @@ trap cleanup EXIT
#repo_lock <repo-name> <arch> [timeout]
repo_lock () {
local LOCKDIR="$TMPDIR/.repolock.$1.$2"
- local DBLOCKFILE="${FTP_BASE}/${1}/os/${2}/${1}${DBEXT}.lck"
- local FILESLOCKFILE="${FTP_BASE}/${1}/os/${2}/${1}${FILESEXT}.lck"
+ local DBLOCKFILE="${root_dir}/${1}/os/${2}/${1}${DBEXT}.lck"
+ local FILESLOCKFILE="${root_dir}/${1}/os/${2}/${1}${FILESEXT}.lck"
local _count
local _trial
local _timeout
@@ -417,19 +417,19 @@ check_pkgrepos() {
local pkgarch="$(getpkgarch "${pkgfile}")"
[ $? -ge 1 ] && return 1
- [ -f "${FTP_BASE}/${PKGPOOL}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT} ] && return 1
- [ -f "${FTP_BASE}/${PKGPOOL}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT}.sig ] && return 1
- [ -f "${FTP_BASE}/${PKGPOOL}/${pkgfile##*/}" ] && return 1
- [ -f "${FTP_BASE}/${PKGPOOL}/${pkgfile##*/}.sig" ] && return 1
+ [ -f "${root_dir}/${PKGPOOL}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT} ] && return 1
+ [ -f "${root_dir}/${PKGPOOL}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT}.sig ] && return 1
+ [ -f "${root_dir}/${PKGPOOL}/${pkgfile##*/}" ] && return 1
+ [ -f "${root_dir}/${PKGPOOL}/${pkgfile##*/}.sig" ] && return 1
local repo
local arch
for repo in "${PKGREPOS[@]}"; do
for arch in "${ARCHES[@]}"; do
- [ -f "${FTP_BASE}/${repo}/os/${arch}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT} ] && return 1
- [ -f "${FTP_BASE}/${repo}/os/${arch}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT}.sig ] && return 1
- [ -f "${FTP_BASE}/${repo}/os/${arch}/${pkgfile##*/}" ] && return 1
- [ -f "${FTP_BASE}/${repo}/os/${arch}/${pkgfile##*/}.sig" ] && return 1
+ [ -f "${root_dir}/${repo}/os/${arch}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT} ] && return 1
+ [ -f "${root_dir}/${repo}/os/${arch}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT}.sig ] && return 1
+ [ -f "${root_dir}/${repo}/os/${arch}/${pkgfile##*/}" ] && return 1
+ [ -f "${root_dir}/${repo}/os/${arch}/${pkgfile##*/}.sig" ] && return 1
done
done
@@ -454,11 +454,11 @@ check_repo_permission() {
in_array "${repo}" "${PKGREPOS[@]}" || return 1
- [ -w "$FTP_BASE/${PKGPOOL}" ] || return 1
+ [ -w "${root_dir}/${PKGPOOL}" ] || return 1
local arch
for arch in "${ARCHES[@]}"; do
- local dir="${FTP_BASE}/${repo}/os/${arch}/"
+ local dir="${root_dir}/${repo}/os/${arch}/"
[ -w "${dir}" ] || return 1
[ -f "${dir}${repo}"${DBEXT} -a ! -w "${dir}${repo}"${DBEXT} ] && return 1
[ -f "${dir}${repo}"${FILESEXT} -a ! -w "${dir}${repo}"${FILESEXT} ] && return 1
@@ -470,8 +470,8 @@ check_repo_permission() {
set_repo_permission() {
local repo=$1
local arch=$2
- local dbfile="${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT}"
- local filesfile="${FTP_BASE}/${repo}/os/${arch}/${repo}${FILESEXT}"
+ local dbfile="${root_dir}/${repo}/os/${arch}/${repo}${DBEXT}"
+ local filesfile="${root_dir}/${repo}/os/${arch}/${repo}${FILESEXT}"
if [ -w "${dbfile}" ]; then
local group=$(/usr/bin/stat --printf='%G' "$(dirname "${dbfile}")")
@@ -491,7 +491,7 @@ arch_repo_add() {
printf -v pkgs_str -- '%q ' "${pkgs[@]}"
# package files might be relative to repo dir
- pushd "${FTP_BASE}/${repo}/os/${arch}" >/dev/null
+ pushd "${root_dir}/${repo}/os/${arch}" >/dev/null
/usr/bin/repo-add -q "${repo}${DBEXT}" "${pkgs[@]}" >/dev/null \
|| error 'repo-add %q %s' "${repo}${DBEXT}" "${pkgs_str% }"
/usr/bin/repo-add -f -q "${repo}${FILESEXT}" "${pkgs[@]}" \
@@ -506,8 +506,8 @@ arch_repo_remove() {
local repo=$1
local arch=$2
local pkgs=("${@:3}")
- local dbfile="${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT}"
- local filesfile="${FTP_BASE}/${repo}/os/${arch}/${repo}${FILESEXT}"
+ local dbfile="${root_dir}/${repo}/os/${arch}/${repo}${DBEXT}"
+ local filesfile="${root_dir}/${repo}/os/${arch}/${repo}${FILESEXT}"
if [ ! -f "${dbfile}" ]; then
error "No database found at '%s'" "${dbfile}"