Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
7fedda7342 | |||
|
cdc83819f5 | ||
|
96b7584153 | ||
aacf420a68 |
31
prm
31
prm
@@ -32,7 +32,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 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" )
|
||||||
@@ -40,18 +40,13 @@ aur.search() {
|
|||||||
# Exit if nothing was found
|
# Exit if nothing was found
|
||||||
(( aur_search_result_num )) || { return 1; }
|
(( aur_search_result_num )) || { return 1; }
|
||||||
|
|
||||||
aur_search_results=( $( jshon -e results -a -e Name -u <<< "$aur_api_search_data" ) )
|
while {
|
||||||
|
read -r name
|
||||||
for i in "${!aur_search_results[@]}"; do
|
read -r version
|
||||||
{
|
read -r description
|
||||||
read -r version
|
} do
|
||||||
read -r description
|
printf '%s %s\n %s\n' "aur/$name" "$version" "$description"
|
||||||
} < <(
|
done < <( jshon -C -e results -a -e Name -u -p -e Version -u -p -e Description -u <<< "$aur_api_search_data" )
|
||||||
jshon -e results -e $i -e Version -u -p -e Description -u <<< "$aur_api_search_data"
|
|
||||||
)
|
|
||||||
|
|
||||||
printf '%s %s\n %s\n' "aur/${aur_search_results[$i]}" "$version" "$description"
|
|
||||||
done
|
|
||||||
}
|
}
|
||||||
|
|
||||||
aur.info() {
|
aur.info() {
|
||||||
@@ -103,13 +98,11 @@ aur.get_updates() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
aur.get() {
|
aur.get() {
|
||||||
declare i pkg_aur_info pkg_base tarball_path depends makedepends dep_name aur_api_multireq dep_name aur_deps_api_data aur_deps_count aur_deps
|
declare i pkg_aur_info pkg_base depends makedepends dep_name aur_api_multireq dep_name aur_deps_api_data aur_deps_count aur_deps
|
||||||
|
|
||||||
read -r pkg_aur_info
|
read -r pkg_aur_info
|
||||||
|
|
||||||
# A temporary hack till AUR4 becomes the main version
|
|
||||||
read -r pkg_base < <( jshon -e results -a -e Name -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"
|
|
||||||
|
|
||||||
cd "$cfg_workdir"
|
cd "$cfg_workdir"
|
||||||
|
|
||||||
@@ -310,11 +303,7 @@ main() {
|
|||||||
if (( ! "$?" )); then
|
if (( ! "$?" )); then
|
||||||
repo='aur'
|
repo='aur'
|
||||||
else
|
else
|
||||||
while read -r; do
|
read -r repo < <( pacman -Sp --print-format '%r' "$package" )
|
||||||
if [[ "$REPLY" =~ ^Repository ]]; then
|
|
||||||
repo="${REPLY##* }"
|
|
||||||
fi
|
|
||||||
done < <( pacman -Si "$package" )
|
|
||||||
|
|
||||||
[[ "$repo" ]] || {
|
[[ "$repo" ]] || {
|
||||||
err "Can't find package %s\n" "$package"
|
err "Can't find package %s\n" "$package"
|
||||||
|
Reference in New Issue
Block a user