diff options
Diffstat (limited to 'cron-jobs')
-rwxr-xr-x | cron-jobs/ftpdir-cleanup | 14 | ||||
-rwxr-xr-x | cron-jobs/sourceballs | 34 |
2 files changed, 24 insertions, 24 deletions
diff --git a/cron-jobs/ftpdir-cleanup b/cron-jobs/ftpdir-cleanup index 452aa83..2b32eae 100755 --- a/cron-jobs/ftpdir-cleanup +++ b/cron-jobs/ftpdir-cleanup @@ -30,11 +30,11 @@ for repo in "${PKGREPOS[@]}"; do continue fi # get a list of actual available package files - find "${root_dir}/${repo}/os/${arch}" -xtype f -name "*${package_extension_suffixfile}" -printf '%f\n' | sort > "${WORKDIR}/repo-${repo}-${arch}" + find "${root_dir}/${repo}/os/${arch}" -xtype f -name "*${package_extension_suffixfile}" -printf '%f\n' | sort > "${work_directory}/repo-${repo}-${arch}" # get a list of package files defined in the repo db - bsdtar -xOf "${root_dir}/${repo}/os/${arch}/${repo}${database_extension_suffixfile}" | 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 > "${work_directory}/db-${repo}-${arch}" - missing_pkgs=($(comm -13 "${WORKDIR}/repo-${repo}-${arch}" "${WORKDIR}/db-${repo}-${arch}")) + missing_pkgs=($(comm -13 "${work_directory}/repo-${repo}-${arch}" "${work_directory}/db-${repo}-${arch}")) if [ ${#missing_pkgs[@]} -ge 1 ]; then error "Missing packages in [%s] (%s)..." "${repo}" "${arch}" for missing_pkg in "${missing_pkgs[@]}"; do @@ -42,7 +42,7 @@ for repo in "${PKGREPOS[@]}"; do done fi - old_pkgs=($(comm -23 "${WORKDIR}/repo-${repo}-${arch}" "${WORKDIR}/db-${repo}-${arch}")) + old_pkgs=($(comm -23 "${work_directory}/repo-${repo}-${arch}" "${work_directory}/db-${repo}-${arch}")) if [ ${#old_pkgs[@]} -ge 1 ]; then msg "Removing old packages from [%s] (%s)..." "${repo}" "${arch}" for old_pkg in "${old_pkgs[@]}"; do @@ -54,11 +54,11 @@ for repo in "${PKGREPOS[@]}"; do done # get a list of all available packages in the pacakge pool -find "${root_dir}/${PKGPOOL}" -name "*${package_extension_suffixfile}" -printf '%f\n' | sort > "${WORKDIR}/pool" +find "${root_dir}/${PKGPOOL}" -name "*${package_extension_suffixfile}" -printf '%f\n' | sort > "${work_directory}/pool" # create a list of packages in our db -cat "${WORKDIR}/db-"* | sort -u > "${WORKDIR}/db" +cat "${work_directory}/db-"* | sort -u > "${work_directory}/db" -old_pkgs=($(comm -23 "${WORKDIR}/pool" "${WORKDIR}/db")) +old_pkgs=($(comm -23 "${work_directory}/pool" "${work_directory}/db")) if [ ${#old_pkgs[@]} -ge 1 ]; then msg "Removing old packages from package pool..." for old_pkg in "${old_pkgs[@]}"; do diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 7df349c..53ffff9 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -3,7 +3,7 @@ dirname="$(dirname "$(readlink -e "$0")")" . "${dirname}/../config" . "${dirname}/../db-functions" -pushd "${WORKDIR}" >/dev/null +pushd "${work_directory}" >/dev/null script_lock @@ -36,7 +36,7 @@ for repo in "${PKGREPOS[@]}"; do printf "%s %s %s %s\n", b, v, a, l; l=""; }' - done | sort -u > "${WORKDIR}/db-${repo}" + done | sort -u > "${work_directory}/db-${repo}" done for repo in "${PKGREPOS[@]}"; do @@ -46,7 +46,7 @@ for repo in "${PKGREPOS[@]}"; do done # Create a list of all available source package file names -find "${root_dir}/${SRCPOOL}" -xtype f -name "*${source_extension_suffixfile}" -printf '%f\n' | sort -u > "${WORKDIR}/available-src-pkgs" +find "${root_dir}/${SRCPOOL}" -xtype f -name "*${source_extension_suffixfile}" -printf '%f\n' | sort -u > "${work_directory}/available-src-pkgs" # Check for all packages if we need to build a source package for repo in "${PKGREPOS[@]}"; do @@ -69,39 +69,39 @@ for repo in "${PKGREPOS[@]}"; do # continue # fi # Store the expected file name of the source package - echo "${pkgbase}-${pkgver}${source_extension_suffixfile}" >> "${WORKDIR}/expected-src-pkgs" + echo "${pkgbase}-${pkgver}${source_extension_suffixfile}" >> "${work_directory}/expected-src-pkgs" # Build the source package if its not already there - if ! grep -Fqx "${pkgbase}-${pkgver}${source_extension_suffixfile}" "${WORKDIR}/available-src-pkgs"; then + if ! grep -Fqx "${pkgbase}-${pkgver}${source_extension_suffixfile}" "${work_directory}/available-src-pkgs"; then # Check if we had failed before if in_array "${pkgbase}-${pkgver}${source_extension_suffixfile}" "${failedpkgs[@]}"; then continue fi # Get the sources from xbs - mkdir -p -m0770 "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}" + mkdir -p -m0770 "${work_directory}/pkgbuilds/${repo}-${pkgarch}" cp -a "$(xbs releasepath "${pkgbase}" "${repo}" "${pkgarch}")" \ - "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/${pkgbase}" >/dev/null 2>&1 + "${work_directory}/pkgbuilds/${repo}-${pkgarch}/${pkgbase}" >/dev/null 2>&1 if [ $? -ge 1 ]; then failedpkgs+=("${pkgbase}-${pkgver}${source_extension_suffixfile}") continue fi # Build the actual source package - pushd "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/${pkgbase}" >/dev/null - SRCPKGDEST=. makepkg --nocolor --allsource --ignorearch --skippgpcheck >"${WORKDIR}/${pkgbase}.log" 2>&1 + pushd "${work_directory}/pkgbuilds/${repo}-${pkgarch}/${pkgbase}" >/dev/null + SRCPKGDEST=. makepkg --nocolor --allsource --ignorearch --skippgpcheck >"${work_directory}/${pkgbase}.log" 2>&1 if [ $? -eq 0 ] && [ -f "${pkgbase}-${pkgver}${source_extension_suffixfile}" ]; then mv_acl "${pkgbase}-${pkgver}${source_extension_suffixfile}" "${root_dir}/${SRCPOOL}/${pkgbase}-${pkgver}${source_extension_suffixfile}" # Avoid creating the same source package for every arch - echo "${pkgbase}-${pkgver}${source_extension_suffixfile}" >> "${WORKDIR}/available-src-pkgs" + echo "${pkgbase}-${pkgver}${source_extension_suffixfile}" >> "${work_directory}/available-src-pkgs" newpkgs+=("${pkgbase}-${pkgver}${source_extension_suffixfile}") else failedpkgs+=("${pkgbase}-${pkgver}${source_extension_suffixfile}") - cat "${WORKDIR}/${pkgbase}.log" >> "${WORKDIR}/makepkg-fail.log" + cat "${work_directory}/${pkgbase}.log" >> "${work_directory}/makepkg-fail.log" fi popd >/dev/null fi - done < "${WORKDIR}/db-${repo}" + done < "${work_directory}/db-${repo}" if [ ${#newpkgs[@]} -ge 1 ]; then msg "Adding source packages for [%s]..." "${repo}" @@ -118,9 +118,9 @@ for repo in "${PKGREPOS[@]}"; do done # Cleanup old source packages -cat "${WORKDIR}/expected-src-pkgs" | sort -u > "${WORKDIR}/expected-src-pkgs.sort" -cat "${WORKDIR}/available-src-pkgs" | sort -u > "${WORKDIR}/available-src-pkgs.sort" -old_pkgs=($(comm -23 "${WORKDIR}/available-src-pkgs.sort" "${WORKDIR}/expected-src-pkgs.sort")) +cat "${work_directory}/expected-src-pkgs" | sort -u > "${work_directory}/expected-src-pkgs.sort" +cat "${work_directory}/available-src-pkgs" | sort -u > "${work_directory}/available-src-pkgs.sort" +old_pkgs=($(comm -23 "${work_directory}/available-src-pkgs.sort" "${work_directory}/expected-src-pkgs.sort")) if [ ${#old_pkgs[@]} -ge 1 ]; then msg "Removing old source packages..." @@ -143,9 +143,9 @@ if [ ${#old_pkgs[@]} -ge 1 ]; then done fi -if [ -f "${WORKDIR}/makepkg-fail.log" ]; then +if [ -f "${work_directory}/makepkg-fail.log" ]; then msg "Log of failed packages" - cat "${WORKDIR}/makepkg-fail.log" + cat "${work_directory}/makepkg-fail.log" fi script_unlock |