summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcreate-repo4
-rwxr-xr-xcron-jobs/check_archlinux/parse_pkgbuilds.sh22
-rwxr-xr-xcron-jobs/ftpdir-cleanup10
-rwxr-xr-xcron-jobs/repo-sanity-check4
-rwxr-xr-xcron-jobs/sourceballs28
-rwxr-xr-xcron-jobs/sourceballs24
-rwxr-xr-xdb-check-nonfree22
-rw-r--r--db-functions26
-rwxr-xr-xdb-list-unsigned-packages2
-rwxr-xr-xdb-move28
-rwxr-xr-xdb-update8
-rwxr-xr-xget-repos6
-rwxr-xr-xrepo-restore-to-normal6
13 files changed, 85 insertions, 85 deletions
diff --git a/create-repo b/create-repo
index 21a2a9c..1ec9798 100755
--- a/create-repo
+++ b/create-repo
@@ -10,12 +10,12 @@ if [ $# -eq 0 ]; then
fi
msg "Creating repos..."
-for _repo in $@; do
+for _repo in "$@"; do
msg2 "Creating [${_repo}]"
mkdir -p "${FTP_BASE}/staging/${_repo}" || \
error "Failed creating staging dir"
- for _arch in ${ARCHES[@]}; do
+ for _arch in "${ARCHES[@]}"; do
mkdir -p "${FTP_BASE}/${_repo}/os/${_arch}" || \
error "Failed creating ${_arch} dir"
done
diff --git a/cron-jobs/check_archlinux/parse_pkgbuilds.sh b/cron-jobs/check_archlinux/parse_pkgbuilds.sh
index 3f92169..c8d8618 100755
--- a/cron-jobs/check_archlinux/parse_pkgbuilds.sh
+++ b/cron-jobs/check_archlinux/parse_pkgbuilds.sh
@@ -6,18 +6,18 @@
exit() { return; }
splitpkg_overrides=('depends' 'optdepends' 'provides' 'conflicts')
-variables=('pkgname' 'pkgbase' 'epoch' 'pkgver' 'pkgrel' 'makedepends' 'arch' ${splitpkg_overrides[@]})
+variables=('pkgname' 'pkgbase' 'epoch' 'pkgver' 'pkgrel' 'makedepends' 'arch' "${splitpkg_overrides[@]}")
readonly -a variables splitpkg_overrides
backup_package_variables() {
- for var in ${splitpkg_overrides[@]}; do
+ for var in "${splitpkg_overrides[@]}"; do
indirect="${var}_backup"
eval "${indirect}=(\${$var[@]})"
done
}
restore_package_variables() {
- for var in ${splitpkg_overrides[@]}; do
+ for var in "${splitpkg_overrides[@]}"; do
indirect="${var}_backup"
if [ -n "${!indirect}" ]; then
eval "${var}=(\${$indirect[@]})"
@@ -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
+ for i in "${depends[@]}"; do
echo $i
done
echo ""
fi
if [ -n "$makedepends" ]; then
echo "%MAKEDEPENDS%"
- for i in ${makedepends[@]}; do
+ for i in "${makedepends[@]}"; do
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
}
@@ -75,7 +75,7 @@ source_pkgbuild() {
ret=0
dir=$1
pkgbuild=$dir/PKGBUILD
- for var in ${variables[@]}; do
+ for var in "${variables[@]}"; do
unset ${var}
done
source $pkgbuild &>/dev/null || ret=$?
@@ -88,7 +88,7 @@ source_pkgbuild() {
if [ "${#pkgname[@]}" -gt "1" ]; then
pkgbase=${pkgbase:-${pkgname[0]}}
- for pkg in ${pkgname[@]}; do
+ for pkg in "${pkgname[@]}"; do
if [ "$(type -t package_${pkg})" != "function" ]; then
echo -e "%INVALID%\n$pkgbuild\n"
return 1
@@ -98,7 +98,7 @@ source_pkgbuild() {
while IFS= read -r line; do
var=${line%%=*}
var="${var#"${var%%[![:space:]]*}"}" # remove leading whitespace characters
- for realvar in ${variables[@]}; do
+ for realvar in "${variables[@]}"; do
if [ "$var" == "$realvar" ]; then
eval $line
break
diff --git a/cron-jobs/ftpdir-cleanup b/cron-jobs/ftpdir-cleanup
index b290138..6455ed7 100755
--- a/cron-jobs/ftpdir-cleanup
+++ b/cron-jobs/ftpdir-cleanup
@@ -25,8 +25,8 @@ clean_pkg() {
${CLEANUP_DRYRUN} && warning 'dry run mode is active'
-for repo in ${PKGREPOS[@]}; do
- for arch in ${ARCHES[@]}; do
+for repo in "${PKGREPOS[@]}"; do
+ for arch in "${ARCHES[@]}"; do
if [ ! -f "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT}" ]; then
continue
fi
@@ -69,7 +69,7 @@ if [ ${#old_pkgs[@]} -ge 1 ]; then
fi
# cleanup of legacy $repo/os/any directories
-for repo in ${PKGREPOS[@]}; do
+for repo in "${PKGREPOS[@]}"; do
if [ ! -d "${FTP_BASE}/${repo}/os/any" ]; then
continue
fi
@@ -103,8 +103,8 @@ if [ ${#old_pkgs[@]} -ge 1 ]; then
done
fi
-for repo in ${PKGREPOS[@]}; do
- for arch in ${ARCHES[@]}; do
+for repo in "${PKGREPOS[@]}"; do
+ for arch in "${ARCHES[@]}"; do
repo_unlock ${repo} ${arch}
done
done
diff --git a/cron-jobs/repo-sanity-check b/cron-jobs/repo-sanity-check
index ee4c061..9d351df 100755
--- a/cron-jobs/repo-sanity-check
+++ b/cron-jobs/repo-sanity-check
@@ -5,7 +5,7 @@
. "$(dirname "$(readlink -e "$0")")/../db-functions"
# Traverse all repos
-for _repo in ${PKGREPOS[@]}; do
+for _repo in "${PKGREPOS[@]}"; do
msg "Cleaning up [${_repo}]"
# Find all pkgnames on this repo's abs
@@ -19,7 +19,7 @@ for _repo in ${PKGREPOS[@]}; do
>/dev/null 2>&1
# also cleanup package functions
- for _pkg in ${pkgname[@]}; do
+ for _pkg in "${pkgname[@]}"; do
unset package_${pkg} >/dev/null 2>&1
done
diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs
index c9aadba..8171980 100755
--- a/cron-jobs/sourceballs
+++ b/cron-jobs/sourceballs
@@ -7,8 +7,8 @@ pushd "${WORKDIR}" >/dev/null
script_lock
-for repo in ${PKGREPOS[@]}; do
- for arch in ${ARCHES[@]}; do
+for repo in "${PKGREPOS[@]}"; do
+ for arch in "${ARCHES[@]}"; do
repo_lock ${repo} ${arch} || exit 1
done
done
@@ -18,8 +18,8 @@ renice +10 -p $$ > /dev/null
# Create a readable file for each repo with the following format
# <pkgbase|pkgname> <pkgver>-<pkgrel> <arch> <license>[ <license>]
-for repo in ${PKGREPOS[@]}; do
- for arch in ${ARCHES[@]}; do
+for repo in "${PKGREPOS[@]}"; do
+ for arch in "${ARCHES[@]}"; do
# Repo does not exist; skip it
if [ ! -f "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT}" ]; then
continue
@@ -39,8 +39,8 @@ for repo in ${PKGREPOS[@]}; do
done | sort -u > "${WORKDIR}/db-${repo}"
done
-for repo in ${PKGREPOS[@]}; do
- for arch in ${ARCHES[@]}; do
+for repo in "${PKGREPOS[@]}"; do
+ for arch in "${ARCHES[@]}"; do
repo_unlock ${repo} ${arch}
done
done
@@ -49,15 +49,15 @@ done
find "${FTP_BASE}/${SRCPOOL}" -xtype f -name "*${SRCEXT}" -printf '%f\n' | sort -u > "${WORKDIR}/available-src-pkgs"
# Check for all packages if we need to build a source package
-for repo in ${PKGREPOS[@]}; do
+for repo in "${PKGREPOS[@]}"; do
newpkgs=()
failedpkgs=()
while read line; do
- pkginfo=(${line})
+ pkginfo=("${line}")
pkgbase=${pkginfo[0]}
pkgver=${pkginfo[1]}
pkgarch=${pkginfo[2]}
- pkglicense=(${pkginfo[@]:3})
+ pkglicense=("${pkginfo[@]:3}")
# Should this package be skipped?
if grep -Fqx "${pkgbase}" "${dirname}/sourceballs.skip"; then
@@ -88,7 +88,7 @@ for repo in ${PKGREPOS[@]}; do
cp -r "${SVNREPO}/libre/${pkgbase}" "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/" >/dev/null 2>&1 || \
cp -r "${SVNREPO}/libre-testing/${pkgbase}" "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/" >/dev/null 2>&1
if [ $? -ge 1 ]; then
- failedpkgs[${#failedpkgs[*]}]="${pkgbase}-${pkgver}${SRCEXT}"
+ failedpkgs+=("${pkgbase}-${pkgver}${SRCEXT}")
continue
fi
@@ -109,13 +109,13 @@ for repo in ${PKGREPOS[@]}; do
if [ ${#newpkgs[@]} -ge 1 ]; then
msg "Adding source packages for [${repo}]..."
- for new_pkg in ${newpkgs[@]}; do
+ for new_pkg in "${newpkgs[@]}"; do
msg2 "${new_pkg}"
done
fi
if [ ${#failedpkgs[@]} -ge 1 ]; then
msg "Failed to create source packages for [${repo}]..."
- for failed_pkg in ${failedpkgs[@]}; do
+ for failed_pkg in "${failedpkgs[@]}"; do
msg2 "${failed_pkg}"
done
fi
@@ -129,7 +129,7 @@ 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'
- for old_pkg in ${old_pkgs[@]}; do
+ for old_pkg in "${old_pkgs[@]}"; do
msg2 "${old_pkg}"
if ! ${SOURCE_CLEANUP_DRYRUN}; then
mv "$FTP_BASE/${SRCPOOL}/${old_pkg}" "${SOURCE_CLEANUP_DESTDIR}"
@@ -141,7 +141,7 @@ fi
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
+ for old_pkg in "${old_pkgs[@]}"; do
msg2 "${old_pkg}"
${SOURCE_CLEANUP_DRYRUN} || rm -f "${SOURCE_CLEANUP_DESTDIR}/${old_pkg}"
done
diff --git a/cron-jobs/sourceballs2 b/cron-jobs/sourceballs2
index 1432bdf..2a26e6a 100755
--- a/cron-jobs/sourceballs2
+++ b/cron-jobs/sourceballs2
@@ -21,7 +21,7 @@ find "${FTP_BASE}/${SRCPOOL}" -xtype f -name "*${SRCEXT}" -printf '%f\n' | sort
pushd "${SVNREPO}" >/dev/null
-for repo in ${PKGREPOS[@]}; do
+for repo in "${PKGREPOS[@]}"; do
msg "Sourceballing [${repo}]"
pushd $repo >/dev/null
@@ -40,7 +40,7 @@ for repo in ${PKGREPOS[@]}; do
unset build package url pkgdesc source md5sums depends makedepends \
optdepends license arch options check mksource
- for _pkg in ${pkgname[@]}; do
+ for _pkg in "${pkgname[@]}"; do
unset package_${_pkg} >/dev/null 2>&1
done
diff --git a/db-check-nonfree b/db-check-nonfree
index 5cb7f6f..6e2dc17 100755
--- a/db-check-nonfree
+++ b/db-check-nonfree
@@ -9,16 +9,16 @@ if [ $# -ge 1 ]; then
fi
# TODO: this might lock too much (architectures)
-for repo in ${repos[@]}; do
- for pkgarch in ${ARCHES[@]}; do
+for repo in "${repos[@]}"; do
+ for pkgarch in "${ARCHES[@]}"; do
repo_lock ${repo} ${pkgarch} || exit 1
done
done
msg "Check nonfree in repo:"
nonfree=($(cut -d: -f1 ${BLACKLIST_FILE} | sort -u))
-for repo in ${ARCHREPOS[@]}; do
- for pkgarch in ${ARCHES[@]}; do
+for repo in "${ARCHREPOS[@]}"; do
+ for pkgarch in "${ARCHES[@]}"; do
msg2 "$repo $pkgarch"
if [ ! -f "${FTP_BASE}/${repo}/os/${pkgarch}/${repo}${DBEXT}" ]; then
continue
@@ -27,20 +27,20 @@ for repo in ${ARCHREPOS[@]}; do
unset cleanpkgs
cleanpkgs=()
dbpkgs=($(bsdtar -xOf "${FTP_BASE}/${repo}/os/${pkgarch}/${repo}${DBEXT}" | awk '/^%NAME%/{getline;print}' | sort -u ))
- for pkgname in ${dbpkgs[@]}; do
- if in_array ${pkgname} ${nonfree[@]}; then
- cleanpkgs+=(${pkgname})
+ for pkgname in "${dbpkgs[@]}"; do
+ if in_array "${pkgname}" "${nonfree[@]}"; then
+ cleanpkgs+=("${pkgname}")
fi
done
if [ ${#cleanpkgs[@]} -ge 1 ]; then
- msg2 "Nonfree: ${cleanpkgs[@]}"
- arch_repo_remove "${repo}" "${pkgarch}" ${cleanpkgs[@]}
+ msg2 "Nonfree: ${cleanpkgs[*]}"
+ arch_repo_remove "${repo}" "${pkgarch}" "${cleanpkgs[@]}"
fi
done
done
-for repo in ${repos[@]}; do
- for pkgarch in ${ARCHES[@]}; do
+for repo in "${repos[@]}"; do
+ for pkgarch in "${ARCHES[@]}"; do
repo_unlock ${repo} ${pkgarch}
done
done
diff --git a/db-functions b/db-functions
index e681504..83e0613 100644
--- a/db-functions
+++ b/db-functions
@@ -115,7 +115,7 @@ cleanup() {
local arch
trap - EXIT INT QUIT TERM
- for l in ${LOCKS[@]}; do
+ for l in "${LOCKS[@]}"; do
repo=${l%.*}
arch=${l#*.}
if [ -d "$TMPDIR/.repolock.$repo.$arch" ]; then
@@ -299,7 +299,7 @@ getpkgfiles() {
exit 1
fi
- for f in ${@}; do
+ for f in "${@}"; do
if [ ! -f "${f}" ]; then
error "Package ${f} not found!"
exit 1
@@ -309,7 +309,7 @@ getpkgfiles() {
fi
done
- echo ${@}
+ echo "${@}"
}
check_pkgfile() {
@@ -322,7 +322,7 @@ check_pkgfile() {
local pkgarch="$(getpkgarch ${pkgfile})"
[ $? -ge 1 ] && return 1
- in_array "${pkgarch}" ${ARCHES[@]} 'any' || return 1
+ in_array "${pkgarch}" "${ARCHES[@]}" 'any' || return 1
if echo "$(basename ${pkgfile})" | grep -q "${pkgname}-${pkgver}-${pkgarch}"; then
return 0
@@ -343,7 +343,7 @@ check_pkgsvn() {
[ $? -ge 1 ] && return 1
local repo="${2}"
- in_array "${repo}" ${PKGREPOS[@]} || return 1
+ in_array "${repo}" "${PKGREPOS[@]}" || return 1
if [ ! -f "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}" ]; then
mkdir -p "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}"
@@ -356,7 +356,7 @@ check_pkgsvn() {
[ "${svnver}" == "${_pkgver}" ] || return 1
local svnnames=($(. "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}"; echo ${pkgname[@]}))
- in_array "${_pkgname}" ${svnnames[@]} || return 1
+ in_array "${_pkgname}" "${svnnames[@]}" || return 1
return 0
}
@@ -364,7 +364,7 @@ check_pkgsvn() {
check_splitpkgs() {
local repo="${1}"
shift
- local pkgfiles=(${@})
+ local pkgfiles=("${@}")
local pkgfile
local pkgdir
local svnname
@@ -372,7 +372,7 @@ check_splitpkgs() {
mkdir -p "${WORKDIR}/check_splitpkgs/"
pushd "${WORKDIR}/check_splitpkgs" >/dev/null
- for pkgfile in ${pkgfiles[@]}; do
+ for pkgfile in "${pkgfiles[@]}"; do
issplitpkg "${pkgfile}" || continue
local _pkgbase="$(getpkgbase ${pkgfile})"
msg2 "Checking $_pkgbase"
@@ -395,7 +395,7 @@ check_splitpkgs() {
fi
local svnnames=($(. "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}"; echo ${pkgname[@]}))
- for svnname in ${svnnames[@]}; do
+ for svnname in "${svnnames[@]}"; do
echo "${svnname}" >> "${repo}/${_pkgarch}/${_pkgbase}/svn"
done
done
@@ -430,8 +430,8 @@ check_pkgrepos() {
local repo
local arch
- for repo in ${PKGREPOS[@]}; do
- for arch in ${ARCHES[@]}; do
+ for repo in "${PKGREPOS[@]}"; do
+ for arch in "${ARCHES[@]}"; do
[ -f "${FTP_BASE}/${repo}/os/${arch}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT} ] && return 1
[ -f "${FTP_BASE}/${repo}/os/${arch}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT}.sig ] && return 1
[ -f "${FTP_BASE}/${repo}/os/${arch}/$(basename ${pkgfile})" ] && return 1
@@ -493,7 +493,7 @@ set_repo_permission() {
arch_repo_add() {
local repo=$1
local arch=$2
- local pkgs=(${@:3})
+ local pkgs=("${@:3}")
# package files might be relative to repo dir
pushd "${FTP_BASE}/${repo}/os/${arch}" >/dev/null
@@ -508,7 +508,7 @@ arch_repo_add() {
arch_repo_remove() {
local repo=$1
local arch=$2
- local pkgs=(${@:3})
+ local pkgs=("${@:3}")
local dbfile="${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT}"
local filesfile="${FTP_BASE}/${repo}/os/${arch}/${repo}${FILESEXT}"
diff --git a/db-list-unsigned-packages b/db-list-unsigned-packages
index 5105096..f593686 100755
--- a/db-list-unsigned-packages
+++ b/db-list-unsigned-packages
@@ -31,7 +31,7 @@ fi
arch=$1
shift
-for repo in ${PKGREPOS[@]}
+for repo in "${PKGREPOS[@]}"
do
db="${FTP_BASE}/${repo}/os/${arch}/${repo}.db"
[ -f "$db" ] && "$(dirname "$(readlink -e "$0")")/db-list-unsigned-packages.py" "$repo" "$@" < "$db"
diff --git a/db-move b/db-move
index eed48eb..a6abb8f 100755
--- a/db-move
+++ b/db-move
@@ -8,7 +8,7 @@ if [ $# -lt 3 ]; then
exit 1
fi
-args=(${@})
+args=("${@}")
repo_from="${args[0]}"
repo_to="${args[1]}"
ftppath_from="${FTP_BASE}/${repo_from}/os/"
@@ -19,14 +19,14 @@ if ! check_repo_permission $repo_to || ! check_repo_permission $repo_from; then
fi
# TODO: this might lock too much (architectures)
-for pkgarch in ${ARCHES[@]}; do
+for pkgarch in "${ARCHES[@]}"; do
repo_lock ${repo_to} ${pkgarch} || exit 1
repo_lock ${repo_from} ${pkgarch} || exit 1
done
# First loop is to check that all necessary files exist
-for pkgbase in ${args[@]:2}; do
- for pkgarch in ${ARCHES[@]} 'any'; do
+for pkgbase in "${args[@]:2}"; do
+ for pkgarch in "${ARCHES[@]}" 'any'; do
svnrepo_from="${SVNREPO}/${repo_from}/${pkgbase}"
if [ -r "${svnrepo_from}/PKGBUILD" ]; then
pkgnames=($(. "${svnrepo_from}/PKGBUILD"; echo ${pkgname[@]}))
@@ -40,13 +40,13 @@ for pkgbase in ${args[@]:2}; do
fi
if [ "${pkgarch}" == 'any' ]; then
- tarches=(${ARCHES[@]})
+ tarches=("${ARCHES[@]}")
else
tarches=("${pkgarch}")
fi
- for pkgname in ${pkgnames[@]}; do
- for tarch in ${tarches[@]}; do
+ for pkgname in "${pkgnames[@]}"; do
+ for tarch in "${tarches[@]}"; do
getpkgfile "${ftppath_from}/${tarch}/"${pkgname}-${pkgver}-${pkgarch}${PKGEXT} >/dev/null
done
done
@@ -60,8 +60,8 @@ msg "Moving packages from [${repo_from}] to [${repo_to}]..."
declare -A add_pkgs
declare -A remove_pkgs
-for pkgbase in ${args[@]:2}; do
- for pkgarch in ${ARCHES[@]} 'any'; do
+for pkgbase in "${args[@]:2}"; do
+ for pkgarch in "${ARCHES[@]}" 'any'; do
svnrepo_from="${SVNREPO}/${repo_from}/${pkgbase}"
if [ -f "${svnrepo_from}/PKGBUILD" ]; then
@@ -70,12 +70,12 @@ for pkgbase in ${args[@]:2}; do
else
tarches=("${pkgarch}")
fi
- msg2 "${pkgbase} ($(echo ${tarches[@]}))"
+ msg2 "${pkgbase} (${tarches[*]})"
pkgnames=($(. "${svnrepo_from}/PKGBUILD"; echo ${pkgname[@]}))
pkgver=$(. "${svnrepo_from}/PKGBUILD"; echo $(get_full_version ${epoch:-0} ${pkgver} ${pkgrel}))
- for pkgname in ${pkgnames[@]}; do
- for tarch in ${tarches[@]}; do
+ for pkgname in "${pkgnames[@]}"; do
+ for tarch in "${tarches[@]}"; do
pkgpath=$(getpkgfile "${ftppath_from}/${tarch}/"${pkgname}-${pkgver}-${pkgarch}${PKGEXT})
pkgfile=$(basename "${pkgpath}")
@@ -96,14 +96,14 @@ for pkgbase in ${args[@]:2}; do
done
done
-for tarch in ${ARCHES[@]}; do
+for tarch in "${ARCHES[@]}"; do
if [ -n "${add_pkgs[${tarch}]}" ]; then
arch_repo_add "${repo_to}" "${tarch}" ${add_pkgs[${tarch}]}
arch_repo_remove "${repo_from}" "${tarch}" ${remove_pkgs[${tarch}]}
fi
done
-for pkgarch in ${ARCHES[@]}; do
+for pkgarch in "${ARCHES[@]}"; do
repo_unlock ${repo_from} ${pkgarch}
repo_unlock ${repo_to} ${pkgarch}
done
diff --git a/db-update b/db-update
index e3da232..60cc6cd 100755
--- a/db-update
+++ b/db-update
@@ -28,7 +28,7 @@ for repo in "${repos[@]}"; do
if [ ${#pkgs[@]} -gt 0 ] && ! check_repo_permission "${repo}"; then
die "You don't have permission to update packages in ${repo}"
fi
- for pkg in ${pkgs[@]}; do
+ for pkg in "${pkgs[@]}"; do
if [ -h "${pkg}" ]; then
die "Package ${repo}/$(basename ${pkg}) is a symbolic link"
fi
@@ -40,7 +40,7 @@ for repo in "${repos[@]}"; do
fi
done
# This is fucking obnoxious
- #if ! check_splitpkgs ${repo} ${pkgs[@]}; then
+ #if ! check_splitpkgs ${repo} "${pkgs[@]}"; then
# die "Missing split packages for ${repo}"
#fi
else
@@ -51,10 +51,10 @@ done
for repo in "${repos[@]}"; do
msg "Updating [${repo}]..."
any_pkgs=($(getpkgfiles "${STAGING}/${repo}/"*-any${PKGEXT} 2>/dev/null))
- for pkgarch in ${ARCHES[@]}; do
+ for pkgarch in "${ARCHES[@]}"; do
add_pkgs=()
arch_pkgs=($(getpkgfiles "${STAGING}/${repo}/"*-${pkgarch}${PKGEXT} 2>/dev/null))
- for pkg in ${arch_pkgs[@]} ${any_pkgs[@]}; do
+ for pkg in "${arch_pkgs[@]}" "${any_pkgs[@]}"; do
pkgfile="$(basename ${pkg})"
msg2 "${pkgfile} (${pkgarch})"
# any packages might have been moved by the previous run
diff --git a/get-repos b/get-repos
index a477cf2..b98d601 100755
--- a/get-repos
+++ b/get-repos
@@ -23,8 +23,8 @@ TMPDIR="$(mktemp -dt "${0##*/}.XXXX")"
DBLIST=()
# Repos
-for _repo in ${PKGREPOS[@]}; do
- for _arch in ${ARCHES[@]}; do
+for _repo in "${PKGREPOS[@]}"; do
+ for _arch in "${ARCHES[@]}"; do
DBLIST+=("http://repo.parabolagnulinux.org/${_repo}/os/${_arch}/${_repo}${FILESEXT}")
done
done
@@ -35,7 +35,7 @@ wget --directory-prefix=${TMPDIR} \
--no-verbose \
--force-directories \
--no-host-directories \
- ${DBLIST[@]} || true
+ "${DBLIST[@]}" || true
# Always return true, some databases are expect to be missing
# Create the arches regexp arch1|arch2
diff --git a/repo-restore-to-normal b/repo-restore-to-normal
index 3fe4816..063aacf 100755
--- a/repo-restore-to-normal
+++ b/repo-restore-to-normal
@@ -12,7 +12,7 @@ PKGREPOS=(community)
# sed "s/^\(.\+-[^-]\+-[^-]\+\)-[^-]\+$/\1/"))
# Traverse all repos
-for _repo in ${PKGREPOS[@]}; do
+for _repo in "${PKGREPOS[@]}"; do
msg "Restoring [${_repo}]"
# Find all pkgnames on this repo's abs
@@ -27,7 +27,7 @@ for _repo in ${PKGREPOS[@]}; do
>/dev/null 2>&1
# also cleanup package functions
- for _pkg in ${pkgname[@]}; do
+ for _pkg in "${pkgname[@]}"; do
unset package_${pkg} >/dev/null 2>&1
# this fills the on_abs array
echo ${_pkg}-${pkgver}-${pkgrel}
@@ -49,7 +49,7 @@ for _repo in ${PKGREPOS[@]}; do
msg2 "Restoring the following packages:"
# plain "$(echo ${restore[@]} | tr ' ' "\n")"
- for _pkg in ${on_abs[@]}; do
+ for _pkg in "${on_abs[@]}"; do
find ${CLEANUP_DESTDIR} -name "${_pkg}*" -exec cp -v '{}' ${STAGING}/${_repo} \;
done