4 Commits

Author SHA1 Message Date
fbt
7fedda7342 Should probably feed pacman the package name
Signed-off-by: fbt <fbt@fleshless.org>
2016-03-17 02:29:43 +03:00
Alad Wenter
cdc83819f5 Use pacman -Sp for figuring out the repo a package is in
Signed-off-by: fbt <fbt@fleshless.org>
2016-03-17 02:27:46 +03:00
Alad Wenter
96b7584153 Use one jshon call for search results
Signed-off-by: fbt <fbt@fleshless.org>
2016-03-17 02:25:32 +03:00
fbt
aacf420a68 There is no more tarball
Signed-off-by: fbt <fbt@fleshless.org>
2016-03-01 08:32:19 +03:00

27
prm
View File

@@ -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 version
read -r description read -r description
} < <( } do
jshon -e results -e $i -e Version -u -p -e Description -u <<< "$aur_api_search_data" 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" )
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"