summaryrefslogtreecommitdiff
path: root/cron-jobs/ftpdir-cleanup
diff options
context:
space:
mode:
Diffstat (limited to 'cron-jobs/ftpdir-cleanup')
-rwxr-xr-xcron-jobs/ftpdir-cleanup26
1 files changed, 13 insertions, 13 deletions
diff --git a/cron-jobs/ftpdir-cleanup b/cron-jobs/ftpdir-cleanup
index 8718869..452aa83 100755
--- a/cron-jobs/ftpdir-cleanup
+++ b/cron-jobs/ftpdir-cleanup
@@ -7,32 +7,32 @@ clean_pkg() {
local pkg
local target
- if ! "${CLEANUP_DRYRUN}"; then
+ if ! "${cleanup_dryrun}"; then
for pkg in "$@"; do
if [ -h "$pkg" ]; then
rm -f "$pkg" "$pkg.sig"
else
- mv_acl "$pkg" "$CLEANUP_DESTDIR/${pkg##*/}"
+ mv_acl "$pkg" "${cleanup_destination_directory}/${pkg##*/}"
if [ -e "$pkg.sig" ]; then
- mv_acl "$pkg.sig" "$CLEANUP_DESTDIR/${pkg##*/}.sig"
+ mv_acl "$pkg.sig" "${cleanup_destination_directory}/${pkg##*/}.sig"
fi
- touch "${CLEANUP_DESTDIR}/${pkg##*/}"
+ touch "${cleanup_destination_directory}/${pkg##*/}"
fi
done
fi
}
-"${CLEANUP_DRYRUN}" && warning 'dry run mode is active'
+"${cleanup_dryrun}" && warning 'dry run mode is active'
for repo in "${PKGREPOS[@]}"; do
for arch in "${ARCHES[@]}"; do
- if [ ! -f "${root_dir}/${repo}/os/${arch}/${repo}${DBEXT}" ]; then
+ if [ ! -f "${root_dir}/${repo}/os/${arch}/${repo}${database_extension_suffixfile}" ]; then
continue
fi
# get a list of actual available package files
- find "${root_dir}/${repo}/os/${arch}" -xtype f -name "*${PKGEXT}" -printf '%f\n' | sort > "${WORKDIR}/repo-${repo}-${arch}"
+ find "${root_dir}/${repo}/os/${arch}" -xtype f -name "*${package_extension_suffixfile}" -printf '%f\n' | sort > "${WORKDIR}/repo-${repo}-${arch}"
# get a list of package files defined in the repo db
- bsdtar -xOf "${root_dir}/${repo}/os/${arch}/${repo}${DBEXT}" | awk '/^%FILENAME%/{getline;print}' | sort > "${WORKDIR}/db-${repo}-${arch}"
+ bsdtar -xOf "${root_dir}/${repo}/os/${arch}/${repo}${database_extension_suffixfile}" | 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
@@ -54,7 +54,7 @@ for repo in "${PKGREPOS[@]}"; do
done
# get a list of all available packages in the pacakge pool
-find "${root_dir}/${PKGPOOL}" -name "*${PKGEXT}" -printf '%f\n' | sort > "${WORKDIR}/pool"
+find "${root_dir}/${PKGPOOL}" -name "*${package_extension_suffixfile}" -printf '%f\n' | sort > "${WORKDIR}/pool"
# create a list of packages in our db
cat "${WORKDIR}/db-"* | sort -u > "${WORKDIR}/db"
@@ -67,14 +67,14 @@ if [ ${#old_pkgs[@]} -ge 1 ]; then
done
fi
-old_pkgs=($(find "${CLEANUP_DESTDIR}" -type f -name "*${PKGEXT}" -mtime +"${CLEANUP_KEEP}" -printf '%f\n'))
+old_pkgs=($(find "${cleanup_destination_directory}" -type f -name "*${package_extension_suffixfile}" -mtime +"${cleanup_keep}" -printf '%f\n'))
if [ ${#old_pkgs[@]} -ge 1 ]; then
msg "Removing old packages from the cleanup directory..."
for old_pkg in "${old_pkgs[@]}"; do
msg2 '%s' "${old_pkg}"
- if ! "${CLEANUP_DRYRUN}"; then
- rm -f "${CLEANUP_DESTDIR}/${old_pkg}"
- rm -f "${CLEANUP_DESTDIR}/${old_pkg}.sig"
+ if ! "${cleanup_dryrun}"; then
+ rm -f "${cleanup_destination_directory}/${old_pkg}"
+ rm -f "${cleanup_destination_directory}/${old_pkg}.sig"
fi
done
fi