summaryrefslogtreecommitdiff
path: root/cron-jobs
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-06-17 22:54:15 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-06-17 22:54:15 -0400
commit6ce6d9f136122c8b8d6cf152216996de083328d4 (patch)
tree58ff873dcc8025b9c501cbb21bc504b84ba83a0d /cron-jobs
parent4143e0fe34e549e34e1bfb0efe3111430017046a (diff)
touch up a bunch of quoting
Diffstat (limited to 'cron-jobs')
-rwxr-xr-xcron-jobs/check_archlinux/parse_pkgbuilds.sh36
-rwxr-xr-xcron-jobs/devlist-mailer2
-rwxr-xr-xcron-jobs/ftpdir-cleanup18
-rwxr-xr-xcron-jobs/integrity-check4
-rwxr-xr-xcron-jobs/sourceballs14
-rwxr-xr-xcron-jobs/update-web-db16
6 files changed, 45 insertions, 45 deletions
diff --git a/cron-jobs/check_archlinux/parse_pkgbuilds.sh b/cron-jobs/check_archlinux/parse_pkgbuilds.sh
index c8d8618..38af179 100755
--- a/cron-jobs/check_archlinux/parse_pkgbuilds.sh
+++ b/cron-jobs/check_archlinux/parse_pkgbuilds.sh
@@ -12,7 +12,7 @@ readonly -a variables splitpkg_overrides
backup_package_variables() {
for var in "${splitpkg_overrides[@]}"; do
indirect="${var}_backup"
- eval "${indirect}=(\${$var[@]})"
+ eval "${indirect}=(\"\${$var[@]}\")"
done
}
@@ -20,9 +20,9 @@ restore_package_variables() {
for var in "${splitpkg_overrides[@]}"; do
indirect="${var}_backup"
if [ -n "${!indirect}" ]; then
- eval "${var}=(\${$indirect[@]})"
+ eval "${var}=(\"\${$indirect[@]}\")"
else
- unset ${var}
+ unset "${var}"
fi
done
}
@@ -42,31 +42,31 @@ print_info() {
if [ -n "$arch" ]; then
echo "%ARCH%"
- for i in "${arch[@]}"; do echo $i; done
+ for i in "${arch[@]}"; do echo "$i"; done
echo ""
fi
if [ -n "$depends" ]; then
echo "%DEPENDS%"
for i in "${depends[@]}"; do
- echo $i
+ echo "$i"
done
echo ""
fi
if [ -n "$makedepends" ]; then
echo "%MAKEDEPENDS%"
for i in "${makedepends[@]}"; do
- echo $i
+ echo "$i"
done
echo ""
fi
if [ -n "$conflicts" ]; then
echo "%CONFLICTS%"
- for i in "${conflicts[@]}"; do echo $i; done
+ for i in "${conflicts[@]}"; do echo "$i"; done
echo ""
fi
if [ -n "$provides" ]; then
echo "%PROVIDES%"
- for i in "${provides[@]}"; do echo $i; done
+ for i in "${provides[@]}"; do echo "$i"; done
echo ""
fi
}
@@ -76,9 +76,9 @@ source_pkgbuild() {
dir=$1
pkgbuild=$dir/PKGBUILD
for var in "${variables[@]}"; do
- unset ${var}
+ unset "${var}"
done
- source $pkgbuild &>/dev/null || ret=$?
+ source "$pkgbuild" &>/dev/null || ret=$?
# ensure $pkgname and $pkgver variables were found
if [ $ret -ne 0 -o -z "$pkgname" -o -z "$pkgver" ]; then
@@ -89,7 +89,7 @@ source_pkgbuild() {
if [ "${#pkgname[@]}" -gt "1" ]; then
pkgbase=${pkgbase:-${pkgname[0]}}
for pkg in "${pkgname[@]}"; do
- if [ "$(type -t package_${pkg})" != "function" ]; then
+ if [ "$(type -t "package_${pkg}")" != "function" ]; then
echo -e "%INVALID%\n$pkgbuild\n"
return 1
else
@@ -104,7 +104,7 @@ source_pkgbuild() {
break
fi
done
- done < <(type package_${pkg})
+ done < <(type "package_${pkg}")
print_info
restore_package_variables
fi
@@ -124,14 +124,14 @@ find_pkgbuilds() {
return
fi
- if [ -f $1/PKGBUILD ]; then
- source_pkgbuild $1
+ if [ -f "$1/PKGBUILD" ]; then
+ source_pkgbuild "$1"
return
fi
empty=1
- for dir in $1/*; do
- if [ -d $dir ]; then
- find_pkgbuilds $dir
+ for dir in "$1"/*; do
+ if [ -d "$dir" ]; then
+ find_pkgbuilds "$dir"
unset empty
fi
done
@@ -147,7 +147,7 @@ fi
CARCH=$1
shift
for dir in "$@"; do
- find_pkgbuilds $dir
+ find_pkgbuilds "$dir"
done
exit 0
diff --git a/cron-jobs/devlist-mailer b/cron-jobs/devlist-mailer
index ca2e46b..61cd32c 100755
--- a/cron-jobs/devlist-mailer
+++ b/cron-jobs/devlist-mailer
@@ -23,6 +23,6 @@ echo "Subject: $SUBJECT
To: $LIST
From: $FROM
-$stdin" | /usr/sbin/sendmail -F$FROM "$LIST"
+$stdin" | /usr/sbin/sendmail -F"$FROM" "$LIST"
fi
diff --git a/cron-jobs/ftpdir-cleanup b/cron-jobs/ftpdir-cleanup
index ad2e7f9..292952b 100755
--- a/cron-jobs/ftpdir-cleanup
+++ b/cron-jobs/ftpdir-cleanup
@@ -7,7 +7,7 @@ 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"
@@ -26,11 +26,11 @@ script_lock
for repo in "${PKGREPOS[@]}"; do
for arch in "${ARCHES[@]}"; do
- repo_lock ${repo} ${arch} || exit 1
+ repo_lock "${repo}" "${arch}" || exit 1
done
done
-${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
@@ -45,7 +45,7 @@ for repo in "${PKGREPOS[@]}"; do
missing_pkgs=($(comm -13 "${WORKDIR}/repo-${repo}-${arch}" "${WORKDIR}/db-${repo}-${arch}"))
if [ ${#missing_pkgs[@]} -ge 1 ]; then
error "Missing packages in [${repo}] (${arch})..."
- for missing_pkg in ${missing_pkgs[@]}; do
+ for missing_pkg in "${missing_pkgs[@]}"; do
msg2 "${missing_pkg}"
done
fi
@@ -69,18 +69,18 @@ cat "${WORKDIR}/db-"* | sort -u > "${WORKDIR}/db"
old_pkgs=($(comm -23 "${WORKDIR}/pool" "${WORKDIR}/db"))
if [ ${#old_pkgs[@]} -ge 1 ]; then
msg "Removing old packages from package pool..."
- for old_pkg in ${old_pkgs[@]}; do
+ for old_pkg in "${old_pkgs[@]}"; do
msg2 "${old_pkg}"
clean_pkg "$FTP_BASE/${PKGPOOL}/${old_pkg}"
done
fi
-old_pkgs=($(find ${CLEANUP_DESTDIR} -type f -name "*${PKGEXT}" -mtime +${CLEANUP_KEEP} -printf '%f\n'))
+old_pkgs=($(find "${CLEANUP_DESTDIR}" -type f -name "*${PKGEXT}" -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
+ for old_pkg in "${old_pkgs[@]}"; do
msg2 "${old_pkg}"
- if ! ${CLEANUP_DRYRUN}; then
+ if ! "${CLEANUP_DRYRUN}"; then
rm -f "${CLEANUP_DESTDIR}/${old_pkg}"
rm -f "${CLEANUP_DESTDIR}/${old_pkg}.sig"
fi
@@ -89,7 +89,7 @@ fi
for repo in "${PKGREPOS[@]}"; do
for arch in "${ARCHES[@]}"; do
- repo_unlock ${repo} ${arch}
+ repo_unlock "${repo}" "${arch}"
done
done
diff --git a/cron-jobs/integrity-check b/cron-jobs/integrity-check
index 86a8f1d..33a4eb6 100755
--- a/cron-jobs/integrity-check
+++ b/cron-jobs/integrity-check
@@ -13,12 +13,12 @@ fi
mailto=$1
check() {
- ${dirname}/check_archlinux/check_packages.py \
+ "${dirname}"/check_archlinux/check_packages.py \
--repos="${repos}" \
--abs-tree="/srv/abs/rsync/${arch},/srv/abs/rsync/any" \
--repo-dir="${FTP_BASE}" \
--arch="${arch}" \
- 2>&1 | ${dirname}/devlist-mailer "Integrity Check ${arch}: ${repos}" "${mailto}"
+ 2>&1 | "${dirname}"/devlist-mailer "Integrity Check ${arch}: ${repos}" "${mailto}"
}
repos='core,extra,community'
diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs
index d5bf54b..2c11de2 100755
--- a/cron-jobs/sourceballs
+++ b/cron-jobs/sourceballs
@@ -9,7 +9,7 @@ script_lock
for repo in "${PKGREPOS[@]}"; do
for arch in "${ARCHES[@]}"; do
- repo_lock ${repo} ${arch} || exit 1
+ repo_lock "${repo}" "${arch}" || exit 1
done
done
@@ -41,7 +41,7 @@ done
for repo in "${PKGREPOS[@]}"; do
for arch in "${ARCHES[@]}"; do
- repo_unlock ${repo} ${arch}
+ repo_unlock "${repo}" "${arch}"
done
done
@@ -74,7 +74,7 @@ for repo in "${PKGREPOS[@]}"; do
# Build the source package if its not already there
if ! grep -Fqx "${pkgbase}-${pkgver}${SRCEXT}" "${WORKDIR}/available-src-pkgs"; then
# Check if we had failed before
- if in_array "${pkgbase}-${pkgver}${SRCEXT}" ${failedpkgs[@]}; then
+ if in_array "${pkgbase}-${pkgver}${SRCEXT}" "${failedpkgs[@]}"; then
continue
fi
@@ -124,22 +124,22 @@ old_pkgs=($(comm -23 "${WORKDIR}/available-src-pkgs.sort" "${WORKDIR}/expected-s
if [ ${#old_pkgs[@]} -ge 1 ]; then
msg "Removing old source packages..."
- ${SOURCE_CLEANUP_DRYRUN} && warning 'dry run mode is active'
+ "${SOURCE_CLEANUP_DRYRUN}" && warning 'dry run mode is active'
for old_pkg in "${old_pkgs[@]}"; do
msg2 "${old_pkg}"
- if ! ${SOURCE_CLEANUP_DRYRUN}; then
+ if ! "${SOURCE_CLEANUP_DRYRUN}"; then
mv_acl "$FTP_BASE/${SRCPOOL}/${old_pkg}" "${SOURCE_CLEANUP_DESTDIR}/${old_pkg}"
touch "${SOURCE_CLEANUP_DESTDIR}/${old_pkg}"
fi
done
fi
-old_pkgs=($(find ${SOURCE_CLEANUP_DESTDIR} -type f -name "*${SRCEXT}" -mtime +${SOURCE_CLEANUP_KEEP} -printf '%f\n'))
+old_pkgs=($(find "${SOURCE_CLEANUP_DESTDIR}" -type f -name "*${SRCEXT}" -mtime +"${SOURCE_CLEANUP_KEEP}" -printf '%f\n'))
if [ ${#old_pkgs[@]} -ge 1 ]; then
msg "Removing old source packages from the cleanup directory..."
for old_pkg in "${old_pkgs[@]}"; do
msg2 "${old_pkg}"
- ${SOURCE_CLEANUP_DRYRUN} || rm -f "${SOURCE_CLEANUP_DESTDIR}/${old_pkg}"
+ "${SOURCE_CLEANUP_DRYRUN}" || rm -f "${SOURCE_CLEANUP_DESTDIR}/${old_pkg}"
done
fi
diff --git a/cron-jobs/update-web-db b/cron-jobs/update-web-db
index 713e75e..ec9d255 100755
--- a/cron-jobs/update-web-db
+++ b/cron-jobs/update-web-db
@@ -43,26 +43,26 @@ case "$cmd" in
esac
# Lock the repos and get a copy of the db files to work on
-for repo in ${REPOS[@]}; do
- for arch in ${ARCHES[@]}; do
- repo_lock ${repo} ${arch} || exit 1
+for repo in "${REPOS[@]}"; do
+ for arch in "${ARCHES[@]}"; do
+ repo_lock "${repo}" "${arch}" || exit 1
dbfile="/srv/ftp/${repo}/os/${arch}/${repo}${dbfileext}"
if [ -f "${dbfile}" ]; then
mkdir -p "${WORKDIR}/${repo}/${arch}"
cp "${dbfile}" "${WORKDIR}/${repo}/${arch}/${repo}${dbfileext}"
fi
- repo_unlock ${repo} ${arch}
+ repo_unlock "${repo}" "${arch}"
done
done
# Run reporead on our db copy
-pushd $SPATH >/dev/null
-for repo in ${REPOS[@]}; do
- for arch in ${ARCHES[@]}; do
+pushd "$SPATH" >/dev/null
+for repo in "${REPOS[@]}"; do
+ for arch in "${ARCHES[@]}"; do
dbcopy="${WORKDIR}/${repo}/${arch}/${repo}${dbfileext}"
if [ -f "${dbcopy}" ]; then
echo "Updating ${repo}-${arch}" >> "${LOGOUT}"
- ./manage.py reporead ${flags} ${arch} "${dbcopy}" >> "${LOGOUT}" 2>&1
+ ./manage.py reporead "${flags}" "${arch}" "${dbcopy}" >> "${LOGOUT}" 2>&1
echo "" >> "${LOGOUT}"
fi
done