diff --git a/NEWS b/NEWS index dc4fdb36..489be208 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,8 @@ xbps-0.6.0 (2010-07-01): + * xbps-bin(8): added a new target 'show-orphans' that list all package + orphans currently installed. + * Removed asciidoc build dependency, simply use the troff manpages. xbps-0.5.0 (2010-05-01): diff --git a/bin/xbps-bin/defs.h b/bin/xbps-bin/defs.h index abc5d75f..f2f33f35 100644 --- a/bin/xbps-bin/defs.h +++ b/bin/xbps-bin/defs.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009 Juan Romero Pardines. + * Copyright (c) 2009-2010 Juan Romero Pardines. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,7 +29,7 @@ int xbps_install_new_pkg(const char *); int xbps_update_pkg(const char *); int xbps_autoupdate_pkgs(bool); -int xbps_autoremove_pkgs(bool, bool); +int xbps_autoremove_pkgs(bool, bool, bool); int xbps_exec_transaction(bool); int xbps_remove_installed_pkgs(int, char **, bool, bool); int xbps_check_pkg_integrity(const char *); diff --git a/bin/xbps-bin/main.c b/bin/xbps-bin/main.c index 254c0793..3ffe8fa0 100644 --- a/bin/xbps-bin/main.c +++ b/bin/xbps-bin/main.c @@ -52,6 +52,7 @@ usage(void) " show\t\t\n" " show-deps\t\t\n" " show-files\t\t\n" + " show-orphans\n" " show-revdeps\t\n" " update\t\t\n" " Options shared by all targets:\n" @@ -268,6 +269,16 @@ main(int argc, char **argv) rv = xbps_autoupdate_pkgs(yes); + } else if (strcasecmp(argv[0], "show-orphans") == 0) { + /* + * Only show the package name of all currently package + * orphans. + */ + if (argc != 1) + usage(); + + rv = xbps_autoremove_pkgs(yes, purge, true); + } else if (strcasecmp(argv[0], "autoremove") == 0) { /* * Removes orphan pkgs. These packages were installed @@ -277,7 +288,7 @@ main(int argc, char **argv) if (argc != 1) usage(); - rv = xbps_autoremove_pkgs(yes, purge); + rv = xbps_autoremove_pkgs(yes, purge, false); } else if (strcasecmp(argv[0], "purge") == 0) { /* diff --git a/bin/xbps-bin/remove.c b/bin/xbps-bin/remove.c index f0965507..3dc78028 100644 --- a/bin/xbps-bin/remove.c +++ b/bin/xbps-bin/remove.c @@ -62,7 +62,7 @@ pkg_remove_and_purge(const char *pkgname, const char *version, bool purge) } int -xbps_autoremove_pkgs(bool force, bool purge) +xbps_autoremove_pkgs(bool force, bool purge, bool only_show) { prop_array_t orphans = NULL; prop_object_t obj = NULL; @@ -115,6 +115,9 @@ xbps_autoremove_pkgs(bool force, bool purge) prop_object_iterator_reset(iter); printf("\n\n"); + if (only_show) + goto out; + if (!force && !xbps_noyes("Do you want to continue?")) { printf("Cancelled!\n"); goto out; diff --git a/bin/xbps-bin/xbps-bin.8 b/bin/xbps-bin/xbps-bin.8 index aa215177..180c60e7 100644 --- a/bin/xbps-bin/xbps-bin.8 +++ b/bin/xbps-bin/xbps-bin.8 @@ -228,6 +228,13 @@ Shows the list of files that contains\&. .RE .PP +\fBshow\-orphans\fR +.RS 4 +Shows the list of package orphans currently installed. Package orphans +are packages that were installed as dependencies of another package, but +no other package currently depends on. +.RE +.PP \fBshow\-revdeps \fR\fB\fIpkgname\fR\fR .RS 4 Shows the reverse dependencies for