[dbscripts] Handle split packages properly in staging repos check.

Message ID 20190113225419.30342-1-eschwartz@archlinux.org
State Accepted, archived
Headers show
Series [dbscripts] Handle split packages properly in staging repos check. | expand

Commit Message

Emil Velikov via arch-projects Jan. 13, 2019, 10:54 p.m. UTC
This needs to check the pkgbase, not the pkgname, as for split packages
we need to lookup a PKGBUILD using the basename.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
---
 db-functions | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Patch

diff --git a/db-functions b/db-functions
index 5c363578..65e7700f 100644
--- a/db-functions
+++ b/db-functions
@@ -380,15 +380,16 @@  check_pkgrepos() {
 check_stagingrepos() {
 	local pkgfile=${1}
 	local pkgrepo=${2}
+	local pkgbase=$(getpkgbase "${pkgfile}")
 	local pkgname=$(getpkgname "${pkgfile}")
 	local pkgarch=$(getpkgarch "${pkgfile}")
 	local candidate candidates=()
 
 	if in_array "${pkgrepo}" "${STABLE_REPOS[@]}"; then
-		candidates+=($(find_repo_for_package "${pkgname}" "${pkgarch}" "${TESTING_REPOS[@]}"))
+		candidates+=($(find_repo_for_package "${pkgbase}" "${pkgarch}" "${TESTING_REPOS[@]}"))
 	fi
 	if in_array "${pkgrepo}" "${STABLE_REPOS[@]}" "${TESTING_REPOS[@]}"; then
-		candidates+=($(find_repo_for_package "${pkgname}" "${pkgarch}" "${STAGING_REPOS[@]}"))
+		candidates+=($(find_repo_for_package "${pkgbase}" "${pkgarch}" "${STAGING_REPOS[@]}"))
 	fi
 	(( ${#candidates[@]} == 0 )) && return 0