Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
56a2817649 | ||
|
97d6852e92 |
16
prm
16
prm
@@ -34,7 +34,7 @@ usage() {
|
|||||||
aur.search() {
|
aur.search() {
|
||||||
declare i aur_api_search_data aur_search_result_num aur_search_results version description
|
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" )
|
aur_search_result_num=$( jshon -e resultcount -u <<< "$aur_api_search_data" )
|
||||||
|
|
||||||
# Exit if nothing was found
|
# Exit if nothing was found
|
||||||
@@ -57,7 +57,7 @@ aur.search() {
|
|||||||
aur.info() {
|
aur.info() {
|
||||||
declare pkg_aur_info aur_query_result
|
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=$( jshon -e resultcount -u <<< "$pkg_aur_info" )
|
||||||
|
|
||||||
(( aur_query_result )) || { return 1; }
|
(( aur_query_result )) || { return 1; }
|
||||||
@@ -75,7 +75,7 @@ aur.get_updates() {
|
|||||||
aur_api_multireq+="&arg\[\]=$p"
|
aur_api_multireq+="&arg\[\]=$p"
|
||||||
done
|
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=$( jshon -e results -l <<< "$aur_api_data" )
|
||||||
(( aur_api_data_length-- ))
|
(( aur_api_data_length-- ))
|
||||||
|
|
||||||
@@ -108,7 +108,7 @@ aur.get() {
|
|||||||
read -r pkg_aur_info
|
read -r pkg_aur_info
|
||||||
|
|
||||||
# A temporary hack till AUR4 becomes the main version
|
# A temporary hack till AUR4 becomes the main version
|
||||||
read -r pkg_base < <( jshon -e results -e PackageBase -u <<< "$pkg_aur_info" )
|
read -r pkg_base < <( jshon -e results -a -e Name -u <<< "$pkg_aur_info" )
|
||||||
tarball_path="/cgit/aur.git/snapshot/${pkg_base}.tar.gz"
|
tarball_path="/cgit/aur.git/snapshot/${pkg_base}.tar.gz"
|
||||||
|
|
||||||
cd "$cfg_workdir"
|
cd "$cfg_workdir"
|
||||||
@@ -136,8 +136,8 @@ aur.get() {
|
|||||||
cd "${cfg_workdir}/${pkg_base}"
|
cd "${cfg_workdir}/${pkg_base}"
|
||||||
|
|
||||||
read -d '' -r -a depends < <(
|
read -d '' -r -a depends < <(
|
||||||
jshon -e results -e Depends -a -u <<< "$pkg_aur_info" 2>/dev/null
|
jshon -Q -e results -a -e Depends -a -u <<< "$pkg_aur_info"
|
||||||
jshon -e results -e MakeDepends -a -u <<< "$pkg_aur_info" 2>/dev/null
|
jshon -Q -e results -a -e MakeDepends -a -u <<< "$pkg_aur_info"
|
||||||
)
|
)
|
||||||
|
|
||||||
for i in "${depends[@]}"; do
|
for i in "${depends[@]}"; do
|
||||||
@@ -145,7 +145,7 @@ aur.get() {
|
|||||||
aur_api_multireq+="&arg\[\]=$dep_name"
|
aur_api_multireq+="&arg\[\]=$dep_name"
|
||||||
done
|
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" )
|
aur_deps_count=$( jshon -e resultcount <<< "$aur_deps_api_data" )
|
||||||
|
|
||||||
if (( aur_deps_count )); then
|
if (( aur_deps_count )); then
|
||||||
@@ -272,7 +272,7 @@ main() {
|
|||||||
unset flag_search_aur flag_search_syncdb
|
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
|
if (( flag_search )); then
|
||||||
action=search
|
action=search
|
||||||
|
Reference in New Issue
Block a user