xbps-query: in local mode print all objs from pkgdb.

This commit is contained in:
Juan RP 2014-03-21 11:14:16 +01:00
parent f60501c3f9
commit f2868856ee
2 changed files with 13 additions and 18 deletions

3
NEWS
View File

@ -1,6 +1,7 @@
xbps-0.34 (???): xbps-0.34 (???):
* xbps-query(8): now also prints the 'hold' object on installed packages. * xbps-query(8): in local mode now prints all objects stored on its pkgdb entry
and its metaplist.
* Fix #34 (xbps-uhelper fetch fails to download files from https://alioth.debian.org). * Fix #34 (xbps-uhelper fetch fails to download files from https://alioth.debian.org).
The issue is that this HTTP server returns 406 (Not Acceptable) when the HTTP The issue is that this HTTP server returns 406 (Not Acceptable) when the HTTP

View File

@ -1,5 +1,5 @@
/*- /*-
* Copyright (c) 2008-2013 Juan Romero Pardines. * Copyright (c) 2008-2014 Juan Romero Pardines.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -237,10 +237,10 @@ show_pkg_info_from_metadir(struct xbps_handle *xhp,
const char *pkg, const char *pkg,
const char *option) const char *option)
{ {
xbps_array_t allkeys;
xbps_object_t obj, obj2;
xbps_dictionary_t d, pkgdb_d; xbps_dictionary_t d, pkgdb_d;
const char *instdate; const char *key;
bool autoinst, hold;
pkg_state_t state;
pkgdb_d = xbps_pkgdb_get_pkg(xhp, pkg); pkgdb_d = xbps_pkgdb_get_pkg(xhp, pkg);
if (pkgdb_d == NULL) if (pkgdb_d == NULL)
@ -250,19 +250,13 @@ show_pkg_info_from_metadir(struct xbps_handle *xhp,
if (d == NULL) if (d == NULL)
return ENOENT; return ENOENT;
if (xbps_dictionary_get_cstring_nocopy(pkgdb_d, allkeys = xbps_dictionary_all_keys(pkgdb_d);
"install-date", &instdate)) for (unsigned int i = 0; i < xbps_array_count(allkeys); i++) {
xbps_dictionary_set_cstring_nocopy(d, "install-date", obj = xbps_array_get(allkeys, i);
instdate); obj2 = xbps_dictionary_get_keysym(pkgdb_d, obj);
key = xbps_dictionary_keysym_cstring_nocopy(obj);
if (xbps_dictionary_get_bool(pkgdb_d, "automatic-install", &autoinst)) xbps_dictionary_set(d, key, obj2);
xbps_dictionary_set_bool(d, "automatic-install", autoinst); }
if (xbps_dictionary_get_bool(pkgdb_d, "hold", &hold))
xbps_dictionary_set_bool(d, "hold", hold);
xbps_pkg_state_dictionary(pkgdb_d, &state);
xbps_set_pkg_state_dictionary(d, state);
if (option == NULL) if (option == NULL)
show_pkg_info(d); show_pkg_info(d);