Remove PackagesOnHold from xbps.conf; use xbps-pkgdb -m hold|unhold instead.
To put a package on hold mode: $ xbps-pkgdb -m hold foo To unhold the package: $ xbps-pkgdb -m unhold foo To list packages on hold mode: $ xbps-query -H This also close #12 from github.
This commit is contained in:
@@ -61,6 +61,7 @@ unsigned int find_longest_pkgver(struct xbps_handle *, xbps_object_t);
|
||||
|
||||
int list_pkgs_in_dict(struct xbps_handle *, xbps_object_t, const char *, void *, bool *);
|
||||
int list_manual_pkgs(struct xbps_handle *, xbps_object_t, const char *, void *, bool *);
|
||||
int list_hold_pkgs(struct xbps_handle *, xbps_object_t, const char *, void *, bool *);
|
||||
int list_orphans(struct xbps_handle *);
|
||||
int list_pkgs_pkgdb(struct xbps_handle *);
|
||||
|
||||
|
@@ -116,6 +116,24 @@ list_manual_pkgs(struct xbps_handle *xhp,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
list_hold_pkgs(struct xbps_handle *xhp, xbps_object_t obj,
|
||||
const char *key, void *arg, bool *loop_done)
|
||||
{
|
||||
const char *pkgver;
|
||||
|
||||
(void)xhp;
|
||||
(void)key;
|
||||
(void)arg;
|
||||
(void)loop_done;
|
||||
|
||||
if (xbps_dictionary_get(obj, "hold")) {
|
||||
xbps_dictionary_get_cstring_nocopy(obj, "pkgver", &pkgver);
|
||||
printf("%s\n", pkgver);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
int
|
||||
list_orphans(struct xbps_handle *xhp)
|
||||
{
|
||||
|
@@ -50,6 +50,7 @@ usage(bool fail)
|
||||
"\nMODE [only one mode may be specified]\n"
|
||||
" -l --list-pkgs List available packages\n"
|
||||
" -L --list-repos List working repositories\n"
|
||||
" -H --list-hold-pkgs List packages on hold state\n"
|
||||
" -m --list-manual-pkgs List packages installed explicitly\n"
|
||||
" -O --list-orphans List package orphans\n"
|
||||
" -o --ownedby PATTERN(s) Search for packages owning PATTERN(s)\n"
|
||||
@@ -65,7 +66,7 @@ usage(bool fail)
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
const char *shortopts = "C:c:D:dfhLlmOop:Rr:sVvXx";
|
||||
const char *shortopts = "C:c:D:dfhHLlmOop:Rr:sVvXx";
|
||||
const struct option longopts[] = {
|
||||
{ "config", required_argument, NULL, 'C' },
|
||||
{ "cachedir", required_argument, NULL, 'c' },
|
||||
@@ -74,6 +75,7 @@ main(int argc, char **argv)
|
||||
{ "help", no_argument, NULL, 'h' },
|
||||
{ "list-repos", no_argument, NULL, 'L' },
|
||||
{ "list-pkgs", no_argument, NULL, 'l' },
|
||||
{ "list-hold-pkgs", no_argument, NULL, 'H' },
|
||||
{ "list-manual-pkgs", no_argument, NULL, 'm' },
|
||||
{ "list-orphans", no_argument, NULL, 'O' },
|
||||
{ "ownedby", no_argument, NULL, 'o' },
|
||||
@@ -92,12 +94,12 @@ main(int argc, char **argv)
|
||||
const char *rootdir, *cachedir, *conffile, *props, *defrepo;
|
||||
int c, flags, rv, show_deps = 0;
|
||||
bool list_pkgs, list_repos, orphans, own;
|
||||
bool list_manual, show_prop, show_files, show_rdeps;
|
||||
bool list_manual, list_hold, show_prop, show_files, show_rdeps;
|
||||
bool show, search, repo_mode, opmode, fulldeptree;
|
||||
|
||||
rootdir = cachedir = conffile = defrepo = props = NULL;
|
||||
flags = rv = c = 0;
|
||||
list_pkgs = list_repos = orphans = search = own = false;
|
||||
list_pkgs = list_repos = list_hold = orphans = search = own = false;
|
||||
list_manual = show_prop = show_files = false;
|
||||
show = show_rdeps = fulldeptree = false;
|
||||
repo_mode = opmode = false;
|
||||
@@ -119,6 +121,9 @@ main(int argc, char **argv)
|
||||
case 'f':
|
||||
show_files = opmode = true;
|
||||
break;
|
||||
case 'H':
|
||||
list_hold = true;
|
||||
break;
|
||||
case 'h':
|
||||
usage(false);
|
||||
/* NOTREACHED */
|
||||
@@ -195,6 +200,10 @@ main(int argc, char **argv)
|
||||
/* list repositories */
|
||||
rv = repo_list(&xh);
|
||||
|
||||
} else if (list_hold) {
|
||||
/* list on hold pkgs */
|
||||
rv = xbps_pkgdb_foreach_cb(&xh, list_hold_pkgs, NULL);
|
||||
|
||||
} else if (list_manual) {
|
||||
/* list manual pkgs */
|
||||
rv = xbps_pkgdb_foreach_cb(&xh, list_manual_pkgs, NULL);
|
||||
|
@@ -1,4 +1,4 @@
|
||||
.Dd July 26, 2013
|
||||
.Dd August 12, 2013
|
||||
.Os Void Linux
|
||||
.Dt xbps-query 8
|
||||
.Sh NAME
|
||||
@@ -78,6 +78,8 @@ option is specified, the target
|
||||
will be queried in the root directory, otherwise it will be
|
||||
queried in registered repositories.
|
||||
.Bl -tag -width -x
|
||||
.If Fl H, Fl -list-hold-pkgs
|
||||
List packages that are put on hold, and won't be updated in full system upgrades.
|
||||
.It Fl l, Fl -list-pkgs
|
||||
Lists registered packages in the package database (pkgdb).
|
||||
A package can be in any of the following states:
|
||||
|
Reference in New Issue
Block a user