Use RPC v5

Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
Alad Wenter 2016-02-29 15:22:18 +01:00 committed by fbt
parent 04ec3a81a5
commit 97d6852e92

10
prm
View File

@ -34,7 +34,7 @@ usage() {
aur.search() {
declare i aur_api_search_data aur_search_result_num aur_search_results version description
aur_api_search_data=$( curl "${cfg_curl_opts[@]}" "${cfg_aur_api}?type=search&arg=${1}" )
aur_api_search_data=$( curl "${cfg_curl_opts[@]}" "${cfg_aur_api}&type=search&arg=${1}" )
aur_search_result_num=$( jshon -e resultcount -u <<< "$aur_api_search_data" )
# Exit if nothing was found
@ -57,7 +57,7 @@ aur.search() {
aur.info() {
declare pkg_aur_info aur_query_result
pkg_aur_info=$( curl "${cfg_curl_opts[@]}" "${cfg_aur_api}?type=info&v=2&arg=${1}" 2>/dev/null )
pkg_aur_info=$( curl "${cfg_curl_opts[@]}" "${cfg_aur_api}&type=info&arg=${1}" 2>/dev/null )
aur_query_result=$( jshon -e resultcount -u <<< "$pkg_aur_info" )
(( aur_query_result )) || { return 1; }
@ -75,7 +75,7 @@ aur.get_updates() {
aur_api_multireq+="&arg\[\]=$p"
done
aur_api_data=$( curl "${cfg_curl_opts[@]}" "${cfg_aur_api}?type=multiinfo${aur_api_multireq}" )
aur_api_data=$( curl "${cfg_curl_opts[@]}" "${cfg_aur_api}&type=info${aur_api_multireq}" )
aur_api_data_length=$( jshon -e results -l <<< "$aur_api_data" )
(( aur_api_data_length-- ))
@ -145,7 +145,7 @@ aur.get() {
aur_api_multireq+="&arg\[\]=$dep_name"
done
aur_deps_api_data=$( curl "${cfg_curl_opts[@]}" "${cfg_aur_api}?type=multiinfo${aur_api_multireq}" )
aur_deps_api_data=$( curl "${cfg_curl_opts[@]}" "${cfg_aur_api}&type=info${aur_api_multireq}" )
aur_deps_count=$( jshon -e resultcount <<< "$aur_deps_api_data" )
if (( aur_deps_count )); then
@ -272,7 +272,7 @@ main() {
unset flag_search_aur flag_search_syncdb
}
cfg_aur_api="${cfg_aur_url}/rpc.php"
cfg_aur_api="${cfg_aur_url}/rpc.php/rpc/?v=5"
if (( flag_search )); then
action=search