xbps-bin(8): added a new target "find-files".

This new target 'find-files' can be used to find which installed
package(s) own a file. Exact matches like "/bin/mount" or patterns
like "/usr/lib/libb[ao]b\*" can be specified.
This commit is contained in:
Juan RP
2010-10-27 00:25:02 +02:00
parent 992583311b
commit ef7da88db1
6 changed files with 163 additions and 3 deletions

View File

@@ -43,6 +43,7 @@ usage(void)
" autoremove\n"
" autoupdate\n"
" check\t\t[<pkgname>|<all>]\n"
" find-files\t<pattern>\n"
" install\t\t[<pkgname(s)>|<pkgpattern(s)>]\n"
" list\n"
" list-manual\n"
@@ -343,6 +344,16 @@ main(int argc, char **argv)
rv = xbps_show_pkg_reverse_deps(argv[1]);
} else if (strcasecmp(argv[0], "find-files") == 0) {
/*
* Find files matched by a pattern from installed
* packages.
*/
if (argc != 2)
usage();
rv = find_files_in_packages(argv[1]);
} else {
usage();
}