Unverified Commit eb1a090c authored by Eli Schwartz's avatar Eli Schwartz
Browse files

rewrite issplitpkg check to be compatible with pacman 5.1

We tried to optimize out checking packages which aren't even split
packages, by skipping the ones with no pkgbase. But pacman 5.1 always
writes the pkgbase in order to simplify parsing of the .PKGINFO, so this
was no longer reliable. Instead, check how many pkgnames are in the
corresponding PKGBUILD. This is the master source of truth anyway.
parent e7d06173
......@@ -196,17 +196,6 @@ getpkgbase() {
fi
}
issplitpkg() {
local _base
_base="$(_grep_pkginfo "$1" "pkgbase")"
if [[ -z $_base ]]; then
return 1
else
return 0
fi
}
# Get the package name
getpkgname() {
local _name
......@@ -338,14 +327,16 @@ check_splitpkgs() {
pushd "${WORKDIR}/check_splitpkgs" >/dev/null
for pkgfile in "${pkgfiles[@]}"; do
issplitpkg "${pkgfile}" || continue
local _pkgbase="$(getpkgbase "${pkgfile}")"
local _pkgname="$(getpkgname "${pkgfile}")"
local _pkgarch="$(getpkgarch "${pkgfile}")"
local vcsnames=($(source_pkgbuild "${_pkgbase}" "repos/${repo}-${_pkgarch}"; echo "${pkgname[@]}"))
# not a split package
(( ${#vcsnames[@]} > 1 )) || continue
mkdir -p "${repo}/${_pkgarch}/${_pkgbase}"
echo "${_pkgname}" >> "${repo}/${_pkgarch}/${_pkgbase}/staging"
local vcsnames=($(source_pkgbuild "${_pkgbase}" "repos/${repo}-${_pkgarch}"; echo "${pkgname[@]}"))
printf '%s\n' "${vcsnames[@]}" >> "${repo}/${_pkgarch}/${_pkgbase}/vcs"
done
popd >/dev/null
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment