summaryrefslogtreecommitdiff
path: root/cron-jobs/sourceballs
diff options
context:
space:
mode:
Diffstat (limited to 'cron-jobs/sourceballs')
-rwxr-xr-xcron-jobs/sourceballs34
1 files changed, 17 insertions, 17 deletions
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