summaryrefslogtreecommitdiff
path: root/cron-jobs/ftpdir-cleanup
diff options
context:
space:
mode:
Diffstat (limited to 'cron-jobs/ftpdir-cleanup')
-rwxr-xr-xcron-jobs/ftpdir-cleanup12
1 files changed, 6 insertions, 6 deletions
diff --git a/cron-jobs/ftpdir-cleanup b/cron-jobs/ftpdir-cleanup
index 4a2b418..8718869 100755
--- a/cron-jobs/ftpdir-cleanup
+++ b/cron-jobs/ftpdir-cleanup
@@ -26,13 +26,13 @@ clean_pkg() {
for repo in "${PKGREPOS[@]}"; do
for arch in "${ARCHES[@]}"; do
- if [ ! -f "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT}" ]; then
+ if [ ! -f "${root_dir}/${repo}/os/${arch}/${repo}${DBEXT}" ]; then
continue
fi
# get a list of actual available package files
- find "${FTP_BASE}/${repo}/os/${arch}" -xtype f -name "*${PKGEXT}" -printf '%f\n' | sort > "${WORKDIR}/repo-${repo}-${arch}"
+ find "${root_dir}/${repo}/os/${arch}" -xtype f -name "*${PKGEXT}" -printf '%f\n' | sort > "${WORKDIR}/repo-${repo}-${arch}"
# get a list of package files defined in the repo db
- bsdtar -xOf "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT}" | awk '/^%FILENAME%/{getline;print}' | sort > "${WORKDIR}/db-${repo}-${arch}"
+ bsdtar -xOf "${root_dir}/${repo}/os/${arch}/${repo}${DBEXT}" | awk '/^%FILENAME%/{getline;print}' | sort > "${WORKDIR}/db-${repo}-${arch}"
missing_pkgs=($(comm -13 "${WORKDIR}/repo-${repo}-${arch}" "${WORKDIR}/db-${repo}-${arch}"))
if [ ${#missing_pkgs[@]} -ge 1 ]; then
@@ -47,14 +47,14 @@ for repo in "${PKGREPOS[@]}"; do
msg "Removing old packages from [%s] (%s)..." "${repo}" "${arch}"
for old_pkg in "${old_pkgs[@]}"; do
msg2 '%s' "${old_pkg}"
- clean_pkg "${FTP_BASE}/${repo}/os/${arch}/${old_pkg}"
+ clean_pkg "${root_dir}/${repo}/os/${arch}/${old_pkg}"
done
fi
done
done
# get a list of all available packages in the pacakge pool
-find "$FTP_BASE/${PKGPOOL}" -name "*${PKGEXT}" -printf '%f\n' | sort > "${WORKDIR}/pool"
+find "${root_dir}/${PKGPOOL}" -name "*${PKGEXT}" -printf '%f\n' | sort > "${WORKDIR}/pool"
# create a list of packages in our db
cat "${WORKDIR}/db-"* | sort -u > "${WORKDIR}/db"
@@ -63,7 +63,7 @@ if [ ${#old_pkgs[@]} -ge 1 ]; then
msg "Removing old packages from package pool..."
for old_pkg in "${old_pkgs[@]}"; do
msg2 '%s' "${old_pkg}"
- clean_pkg "$FTP_BASE/${PKGPOOL}/${old_pkg}"
+ clean_pkg "${root_dir}/${PKGPOOL}/${old_pkg}"
done
fi