Skip to content

Commit

Permalink
send them to the atomizer
Browse files Browse the repository at this point in the history
  • Loading branch information
oklopfer authored Mar 30, 2024
1 parent 4fc6e45 commit 50150b1
Showing 1 changed file with 6 additions and 20 deletions.
26 changes: 6 additions & 20 deletions misc/scripts/checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -217,15 +217,18 @@ function lint_pipe_check() {

function lint_deps() {
local dep_type dep_array ret=0 dep idx
for dep_type in "depends" "makedepends" "pacdeps"; do
for dep_type in "depends" "makedepends" "optdepends" "pacdeps"; do
idx=0
local -n dep_array="${dep_type}"
if [[ -n ${dep_array[*]} ]]; then
for dep in "${dep_array[@]}"; do
if [[ -z ${dep} ]]; then
fancy_message error "'${dep_type}' index '${idx}' cannot be empty"
ret=1
elif [[ ${dep} == *"|"* ]] && [[ ${dep_type} == "pacdeps" ]] || ! lint_pipe_check "${dep}"; then
elif [[ ${dep_type} == "optdepends" && ${dep} != *": "* ]] \
|| [[ ${dep} == *"|"* ]] \
&& [[ ${dep_type} == "pacdeps" ]] \
|| ! lint_pipe_check "${dep}"; then
fancy_message error "'${dep_type}' index '${idx}' is not formatted correctly"
ret=1
fi
Expand Down Expand Up @@ -272,23 +275,6 @@ function lint_ppa() {
return "${ret}"
}

function lint_optdepends() {
local ret=0 optdepend idx=0
if [[ -n ${optdepends[*]} ]]; then
for optdepend in "${optdepends[@]}"; do
if [[ -z ${optdepend} ]]; then
fancy_message error "'optdepends' index '${idx}' cannot be empty"
ret=1
elif [[ $optdepend != *": "* ]] || [[ ${dep} == *"|"* ]] && ! lint_pipe_check "${dep}"; then
fancy_message error "'optdepends' index '${idx}' is not formatted correctly"
ret=1
fi
((idx++))
done
fi
return "${ret}"
}

function lint_conflicts() {
local ret=0 conflict idx=0
if [[ -n ${conflicts[*]} ]]; then
Expand Down Expand Up @@ -541,7 +527,7 @@ function lint_priority() {
}

function checks() {
local ret=0 check linting_checks=(lint_pkgname lint_gives lint_pkgrel lint_epoch lint_version lint_source lint_pkgdesc lint_maintainer lint_deps lint_ppa lint_optdepends lint_conflicts lint_breaks lint_replaces lint_hash lint_patch lint_provides lint_incompatible lint_arch lint_mask lint_priority)
local ret=0 check linting_checks=(lint_pkgname lint_gives lint_pkgrel lint_epoch lint_version lint_source lint_pkgdesc lint_maintainer lint_deps lint_ppa lint_conflicts lint_breaks lint_replaces lint_hash lint_patch lint_provides lint_incompatible lint_arch lint_mask lint_priority)
for check in "${linting_checks[@]}"; do
"${check}" || ret=1
done
Expand Down

0 comments on commit 50150b1

Please sign in to comment.