Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Heusel <christian@heusel.eu>2023-07-21 11:04:13 +0200
committerChristian Heusel <christian@heusel.eu>2023-10-02 11:29:03 +0200
commit0669315821ea0af00fcc2c6271eb474174173e0a (patch)
tree774529c5c8a545a81eafbca30bda92d15b8d6219 /src
parenta6d43aca01eadcb4df8b888aebc58fe3d89b51d2 (diff)
chore: refactor variable names in valid-{tags,repos}.sh
Even though the variables in these files are globablly used they have a weirdly local sounding name. This commit fixes this by refactoring all usages throughout our codebase. Signed-off-by: Christian Heusel <christian@heusel.eu>
Diffstat (limited to 'src')
-rw-r--r--src/archrelease.in2
-rw-r--r--src/lib/build/build.sh2
-rw-r--r--src/lib/release.sh2
-rw-r--r--src/lib/valid-repos.sh4
-rw-r--r--src/lib/valid-tags.sh4
-rw-r--r--src/sogrep.in8
6 files changed, 11 insertions, 11 deletions
diff --git a/src/archrelease.in b/src/archrelease.in
index 818b0ca..84aed28 100644
--- a/src/archrelease.in
+++ b/src/archrelease.in
@@ -35,7 +35,7 @@ fi
# validate repo is really repo-arch
if [[ -z $FORCE ]]; then
for tag in "$@"; do
- if ! in_array "$tag" "${_tags[@]}"; then
+ if ! in_array "$tag" "${DEVTOOLS_VALID_TAGS[@]}"; then
die "archrelease: Invalid tag: '%s' (use -f to force release)" "$tag"
fi
done
diff --git a/src/lib/build/build.sh b/src/lib/build/build.sh
index a5a272d..f2549f2 100644
--- a/src/lib/build/build.sh
+++ b/src/lib/build/build.sh
@@ -274,7 +274,7 @@ pkgctl_build() {
if [[ -z ${REPO} ]]; then
update_pacman_repo_cache
# Check valid repos if not resolved dynamically
- elif ! in_array "${REPO}" "${_repos[@]}"; then
+ elif ! in_array "${REPO}" "${DEVTOOLS_VALID_REPOS[@]}"; then
die "Invalid repository target: %s" "${REPO}"
fi
diff --git a/src/lib/release.sh b/src/lib/release.sh
index aabbd35..028d92e 100644
--- a/src/lib/release.sh
+++ b/src/lib/release.sh
@@ -126,7 +126,7 @@ pkgctl_release() {
if [[ -z ${REPO} ]]; then
update_pacman_repo_cache
# Check valid repos if not resolved dynamically
- elif ! in_array "${REPO}" "${_repos[@]}"; then
+ elif ! in_array "${REPO}" "${DEVTOOLS_VALID_REPOS[@]}"; then
die "Invalid repository target: %s" "${REPO}"
fi
diff --git a/src/lib/valid-repos.sh b/src/lib/valid-repos.sh
index 14f90ce..af8a552 100644
--- a/src/lib/valid-repos.sh
+++ b/src/lib/valid-repos.sh
@@ -4,7 +4,7 @@
:
# shellcheck disable=2034
-_repos=(
+DEVTOOLS_VALID_REPOS=(
core core-staging core-testing
extra extra-staging extra-testing
multilib multilib-staging multilib-testing
@@ -13,7 +13,7 @@ _repos=(
)
# shellcheck disable=2034
-_build_repos=(
+DEVTOOLS_VALID_BUILDREPOS=(
core-staging core-testing
extra extra-staging extra-testing
multilib multilib-staging multilib-testing
diff --git a/src/lib/valid-tags.sh b/src/lib/valid-tags.sh
index ca8d7d7..cef0cc6 100644
--- a/src/lib/valid-tags.sh
+++ b/src/lib/valid-tags.sh
@@ -4,13 +4,13 @@
:
# shellcheck disable=2034
-_arch=(
+DEVTOOLS_VALID_ARCHES=(
x86_64
any
)
# shellcheck disable=2034
-_tags=(
+DEVTOOLS_VALID_TAGS=(
core-x86_64 core-any
core-staging-x86_64 core-staging-any
core-testing-x86_64 core-testing-any
diff --git a/src/sogrep.in b/src/sogrep.in
index 0ee05cc..9f51e53 100644
--- a/src/sogrep.in
+++ b/src/sogrep.in
@@ -31,7 +31,7 @@ recache() {
(( VERBOSE )) && verbosity=--progress-bar
- for repo in "${_repos[@]}"; do
+ for repo in "${DEVTOOLS_VALID_REPOS[@]}"; do
if [[ -n "$SOLINKS_MIRROR" ]]; then
mirror="$SOLINKS_MIRROR"
elif ! mirror="$(set -o pipefail; pacman-conf --repo "$repo" Server 2>/dev/null | head -n1)"; then
@@ -72,7 +72,7 @@ is_outdated_cache() {
# links databases are generated at about the same time every day; we should
# attempt to check for new database files if any of them are over a day old
- for repo in "${_repos[@]}"; do
+ for repo in "${DEVTOOLS_VALID_REPOS[@]}"; do
for arch in "${arches[@]}"; do
local dbpath=${SOCACHE_DIR}/${arch}/${repo}.links.tar.gz
if [[ ! -f ${dbpath} ]] || [[ $(find "${dbpath}" -mtime +0) ]]; then
@@ -85,10 +85,10 @@ is_outdated_cache() {
}
search() {
- local repo=$1 arch lib=$2 srepos=("${_repos[@]}")
+ local repo=$1 arch lib=$2 srepos=("${DEVTOOLS_VALID_REPOS[@]}")
if [[ $repo != all ]]; then
- if ! in_array "${repo}" "${_repos[@]}"; then
+ if ! in_array "${repo}" "${DEVTOOLS_VALID_REPOS[@]}"; then
echo "${BASH_SOURCE[0]##*/}: unrecognized repo '$repo'"
echo "Try '${BASH_SOURCE[0]##*/} --help' for more information."
exit 1