xbps-bin: implemented (WIP) "autoupdate" target.

Some parts in the library related to findings pkgs in repositories
has been improved vastly by caching the dictionary once.

Duplicated code has been added in xbps-bin/install.c, but will
be fixed soon.

--HG--
extra : convert_revision : 2924012a8589a2a6ecaa3863b5091049006c0ef3
This commit is contained in:
Juan RP 2009-05-17 04:09:26 +02:00
parent 951a775432
commit 9f108b4cd2
9 changed files with 506 additions and 225 deletions

View file

@ -45,7 +45,8 @@ usage(void)
{
printf("Usage: xbps-bin [options] [target] [arguments]\n\n"
" Available targets:\n"
" autoremove, files, install, list, remove, show, update\n"
" autoremove, autoupdate, files, install, list, remove\n"
" show, update\n"
" Targets with arguments:\n"
" files\t<pkgname>\n"
" install\t<pkgname>\n"
@ -63,6 +64,7 @@ usage(void)
"\n"
" Examples:\n"
" $ xbps-bin autoremove\n"
" $ xbps-bin autoupdate\n"
" $ xbps-bin -C files klibc\n"
" $ xbps-bin install klibc\n"
" $ xbps-bin -r /path/to/root install klibc\n"
@ -204,6 +206,15 @@ main(int argc, char **argv)
exit(EXIT_FAILURE);
}
} else if (strcasecmp(argv[0], "autoupdate") == 0) {
/*
* To update all packages currently installed.
*/
if (argc != 1)
usage();
xbps_autoupdate_pkgs(force);
} else if (strcasecmp(argv[0], "autoremove") == 0) {
/*
* Removes orphan pkgs. These packages were installed