push to right file

This commit is contained in:
guinux 2015-02-18 10:19:26 +01:00
parent 3694d5f263
commit c0d8266d7a

View File

@ -1,7 +1,7 @@
/*
* 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
* 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 ();
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");
}
}
int length = needles.length;
if (length == 1)
if (length == 1) {
return prev_inter;
}
int i = 1;
var inter = new Json.Array ();
var found = new Json.Array ();
@ -61,8 +66,12 @@ namespace AUR {
}
root = parser.get_root ();
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");
}
}
foreach (var prev_inter_node in prev_inter.get_elements ()) {
foreach (var found_node in found.get_elements ()) {
if (strcmp (prev_inter_node.get_object ().get_string_member ("Name"),
@ -94,8 +103,12 @@ namespace AUR {
}
unowned Json.Node? root = parser.get_root ();
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");
}
}
return pkg_info;
}
@ -119,8 +132,12 @@ namespace AUR {
}
unowned Json.Node? root = parser.get_root ();
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");
}
}
return results;
}
}