forked from cromer/pamac-classic
push to right file
This commit is contained in:
parent
3694d5f263
commit
c0d8266d7a
21
src/aur.vala
21
src/aur.vala
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* pamac-vala
|
* pamac-vala
|
||||||
*
|
*
|
||||||
* Copyright (C) 2014 Guillaume Benoit <guillaume@manjaro.org>
|
* Copyright (C) 2014-2015 Guillaume Benoit <guillaume@manjaro.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -41,11 +41,16 @@ namespace AUR {
|
|||||||
}
|
}
|
||||||
unowned Json.Node? root = parser.get_root ();
|
unowned Json.Node? root = parser.get_root ();
|
||||||
if (root != null) {
|
if (root != null) {
|
||||||
|
if (root.get_object ().get_string_member ("type") == "error") {
|
||||||
|
stderr.printf ("Failed to search %s from AUR\n", needles[0]);
|
||||||
|
} else {
|
||||||
prev_inter = root.get_object ().get_array_member ("results");
|
prev_inter = root.get_object ().get_array_member ("results");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
int length = needles.length;
|
int length = needles.length;
|
||||||
if (length == 1)
|
if (length == 1) {
|
||||||
return prev_inter;
|
return prev_inter;
|
||||||
|
}
|
||||||
int i = 1;
|
int i = 1;
|
||||||
var inter = new Json.Array ();
|
var inter = new Json.Array ();
|
||||||
var found = new Json.Array ();
|
var found = new Json.Array ();
|
||||||
@ -61,8 +66,12 @@ namespace AUR {
|
|||||||
}
|
}
|
||||||
root = parser.get_root ();
|
root = parser.get_root ();
|
||||||
if (root != null) {
|
if (root != null) {
|
||||||
|
if (root.get_object ().get_string_member ("type") == "error") {
|
||||||
|
stderr.printf ("Failed to search %s from AUR\n", needles[i]);
|
||||||
|
} else {
|
||||||
found = root.get_object ().get_array_member ("results");
|
found = root.get_object ().get_array_member ("results");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
foreach (var prev_inter_node in prev_inter.get_elements ()) {
|
foreach (var prev_inter_node in prev_inter.get_elements ()) {
|
||||||
foreach (var found_node in found.get_elements ()) {
|
foreach (var found_node in found.get_elements ()) {
|
||||||
if (strcmp (prev_inter_node.get_object ().get_string_member ("Name"),
|
if (strcmp (prev_inter_node.get_object ().get_string_member ("Name"),
|
||||||
@ -94,8 +103,12 @@ namespace AUR {
|
|||||||
}
|
}
|
||||||
unowned Json.Node? root = parser.get_root ();
|
unowned Json.Node? root = parser.get_root ();
|
||||||
if (root != null) {
|
if (root != null) {
|
||||||
|
if (root.get_object ().get_string_member ("type") == "error") {
|
||||||
|
stderr.printf ("Failed to get infos about %s from AUR\n", pkgname);
|
||||||
|
} else {
|
||||||
pkg_info = root.get_object ().get_object_member ("results");
|
pkg_info = root.get_object ().get_object_member ("results");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return pkg_info;
|
return pkg_info;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,8 +132,12 @@ namespace AUR {
|
|||||||
}
|
}
|
||||||
unowned Json.Node? root = parser.get_root ();
|
unowned Json.Node? root = parser.get_root ();
|
||||||
if (root != null) {
|
if (root != null) {
|
||||||
|
if (root.get_object ().get_string_member ("type") == "error") {
|
||||||
|
stderr.printf ("Failed to multiinfo %s from AUR\n", builder.str);
|
||||||
|
} else {
|
||||||
results = root.get_object ().get_array_member ("results");
|
results = root.get_object ().get_array_member ("results");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user