From dcff876533706fb6c3683d3b8e6d857e6255f0de Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 2 Feb 2013 12:02:10 +0100 Subject: [PATCH] xbps-query: explicitly use -R for repository mode; otherwise local. This closes #3 by radare. --- NEWS | 7 +++++++ bin/xbps-query/main.c | 23 +++++------------------ bin/xbps-query/xbps-query.8 | 4 ++-- 3 files changed, 14 insertions(+), 20 deletions(-) diff --git a/NEWS b/NEWS index 5c9e6626..b64a122f 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,12 @@ xbps-0.21 (???): + * xbps-query(8): fix issue #3 from github + "xbps-query -o only works for installed packages". + + The behaviour has been changed for all modes and to explicitly get + info from repositories the -R flag must be used; otherwise it will + use local packages. + * xbps-install(8): the -f, --force flag will now preserve configuration files if they were modified, and only unpack files that have been modified when re-installing packages. If -f is specified twice (-ff) diff --git a/bin/xbps-query/main.c b/bin/xbps-query/main.c index b739eb85..f390c16a 100644 --- a/bin/xbps-query/main.c +++ b/bin/xbps-query/main.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2008-2012 Juan Romero Pardines. + * Copyright (c) 2008-2013 Juan Romero Pardines. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -221,43 +221,30 @@ main(int argc, char **argv) /* show mode */ if (repo_mode) rv = repo_show_pkg_info(&xh, argv[optind], props); - else { + else rv = show_pkg_info_from_metadir(&xh, argv[optind], props); - if (rv == ENOENT) - rv = repo_show_pkg_info(&xh, - argv[optind], props); - } } else if (show_files) { /* show-files mode */ if (repo_mode) rv = repo_show_pkg_files(&xh, argv[optind]); - else { + else rv = show_pkg_files_from_metadir(&xh, argv[optind]); - if (rv == ENOENT) - rv = repo_show_pkg_files(&xh, argv[optind]); - } } else if (show_deps) { /* show-deps mode */ if (repo_mode) rv = repo_show_pkg_deps(&xh, argv[optind]); - else { + else rv = show_pkg_deps(&xh, argv[optind]); - if (rv == ENOENT) - rv = repo_show_pkg_deps(&xh, argv[optind]); - } } else if (show_rdeps) { /* show-rdeps mode */ if (repo_mode) rv = repo_show_pkg_revdeps(&xh, argv[optind]); - else { + else rv = show_pkg_revdeps(&xh, argv[optind]); - if (rv == ENOENT) - rv = repo_show_pkg_revdeps(&xh, argv[optind]); - } } exit(rv); diff --git a/bin/xbps-query/xbps-query.8 b/bin/xbps-query/xbps-query.8 index 4579e565..9aed1af7 100644 --- a/bin/xbps-query/xbps-query.8 +++ b/bin/xbps-query/xbps-query.8 @@ -1,4 +1,4 @@ -.Dd December 20, 2012 +.Dd February 2, 2013 .Os Void Linux .Dt xbps-query 8 .Sh NAME @@ -75,7 +75,7 @@ By default and unless the .Fl R option is specified, the target .Ar PKG -will be queried in the root directory, and if this fails, it will be +will be queried in the root directory, otherwise it will be queried in registered repositories. .Bl -tag -width -x .It Fl l, Fl -list-pkgs