From fa4ff798507ded0b26dcdc310d1f97e2e61198c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?coadde=20=5BM=C3=A1rcio=20Alexandre=20Silva=20Delgado=5D?= Date: Wed, 23 Sep 2015 18:30:39 -0300 Subject: rename FTP_BASE -> root_dir --- db-functions | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'db-functions') 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 [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}" -- cgit v1.2.3-2-g168b