libmakepkg/integrity: fix git signatures not seen with multiple files

In eaa82b4d07 source_has_signature() was
modified to check if git repositories are marked as signed. However, due
to a typo the unused variable $netfile was checked. This worked as long
as the last source element was marked as signed, due to $netfile being
mistakenly set as a global in check_vcs_software(), but usually failed
with multiple sources.

Break this more consistently by properly declaring $netfile as a local
variable in check_vcs_software() which it should be regardless. Fix it
again by completely moving over to $netfile in source_has_signature()
as netfile is more descriptive of the current state.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Eli Schwartz 2017-11-21 23:34:47 -05:00 committed by Allan McRae
parent 135f4397c2
commit 3d4e95e526
2 changed files with 5 additions and 5 deletions

View file

@ -256,14 +256,14 @@ parse_gpg_statusfile() {
} }
source_has_signatures() { source_has_signatures() {
local file all_sources proto local netfile all_sources proto
get_all_sources_for_arch 'all_sources' get_all_sources_for_arch 'all_sources'
for file in "${all_sources[@]}"; do for netfile in "${all_sources[@]}"; do
proto="$(get_protocol "$file")" proto="$(get_protocol "$netfile")"
query=$(get_uri_query "$netfile") query=$(get_uri_query "$netfile")
if [[ ${file%%::*} = *.@(sig?(n)|asc) || ( $proto = git* && $query = signed ) ]]; then if [[ ${netfile%%::*} = *.@(sig?(n)|asc) || ( $proto = git* && $query = signed ) ]]; then
return 0 return 0
fi fi
done done

View file

@ -914,7 +914,7 @@ get_vcsclient() {
} }
check_vcs_software() { check_vcs_software() {
local all_sources all_deps deps ret=0 local netfile all_sources all_deps deps ret=0
if (( SOURCEONLY == 1 )); then if (( SOURCEONLY == 1 )); then
# we will not download VCS sources # we will not download VCS sources