local _found_pkgname=($(echo "${_aur_json}" | jq -r ".Name" ))
- local _found_package __pkgver __popularity __vote __pkgdesc __orphaned
+ local _found_package __pkgver __popularity __vote __pkgdesc __orphaned __installed
for _found_package in ${_found_pkgname[@]}; do
__orphaned=false
+ __installed=false
_found_json="$(echo ${_aur_json} | jq "select(.Name == \"${_found_package}\")")"
#echo "${_found_json}"
if ! echo "${_found_json}" | jq -r --exit-status ".Maintainer"; then
__orphaned=true
fi
+
+ # インストール済み判定
+ if check_installed_package "${_found_package}"; then
+ __installed=true
+ fi
+
- echo "$(text -c blue -b "aur")/$(text -b "${_found_package}") $(text -c cyan "${__pkgver}") (+$(text -b ${__vote} ${__popularity})) $(if [[ "${__orphaned}" = true ]]; then text -bc red "(Orphaned)"; fi)"
+ echo "$(text -c blue -b "aur")/$(text -b "${_found_package}") $(text -c cyan "${__pkgver}") (+$(text -b ${__vote} ${__popularity})) $(if [[ "${__orphaned}" = true ]]; then text -bc red "(Orphaned)"; fi) $(if [[ "${__installed}" = true ]]; then text -bc cyan "(Installed)"; fi)"
echo " ${__pkgdesc}"
- unset __pkgver __popularity __vote __pkgdesc _found_json __orphaned
+ unset __pkgver __popularity __vote __pkgdesc _found_json __orphaned __installed
done
}