Added support to list and remove orphaned packages.

A new target has been added to xbps-bin: autoremove. It works in
the same way than 'apt-get', but there's no stdin input. By default
it will list you all orphaned packages, and -f flag must be set
to really remove them.

The following is a real example for the git package, which requires
directly perl and curl-libs, and indirectly libidn and openssl.

$ xbps-bin -r ~/testing-xbps remove git
Removing package git-1.6.1.3 ... done.
$

$ xbps-bin -r ~/testing-xbps autoremove
The following packages were installed automatically
(as dependencies) and aren't needed anymore:

	perl-5.10.0 curl-libs-7.19.0 libidn-1.10 openssl-0.9.8j

If you are really sure you don't need them, use -f to confirm.
$

--HG--
extra : convert_revision : 70eebaa3d99be27753b94f580c8ec86330c7c2d3
This commit is contained in:
Juan RP 2009-03-02 02:26:20 +01:00
parent ef6b5290af
commit 0d8f08e8ea
5 changed files with 274 additions and 26 deletions

View file

@ -26,7 +26,7 @@
#ifndef _XBPS_UTIL_H_
#define _XBPS_UTIL_H_
/* from lib/util.c */
/* From lib/util.c */
char * xbps_append_full_path(bool, const char *, const char *);
int xbps_check_file_hash(const char *, const char *);
int xbps_check_is_installed_pkg(const char *);
@ -37,4 +37,7 @@ const char * xbps_get_pkg_version(const char *);
bool xbps_pkg_has_rundeps(prop_dictionary_t);
void xbps_set_rootdir(const char *);
/* From lib/orphans.c */
prop_array_t xbps_find_orphan_packages(void);
#endif /* !_XBPS_UTIL_H_ */