I would also prefer it if apt-file list would "list all files included in _a_ package" instead of listing all the files in multiple packages.
The attached patch gets closer. If two packages have the same base-name and supply the same file then I believe it will still list them multiply. Even without this patch, using -F makes apt-file only list packages with the exact same name and can be a mostly usable alternative for most cases. With or without the patch using -F fails to list files that are in multiple packages so that could be improved. In the postfix example apt-file -F list postfix excludes usr/lib/sendmail and others with a package part like package1,package2,package3. -- Jacob
--- apt-file 2005-05-05 10:00:12.000000000 -0600 +++ apt-file-jla 2006-01-23 22:59:51.723666340 -0700 @@ -193,6 +193,8 @@ next if ! (($pack, $file) = /$regexp/); debug_line "."; foreach (split /,/, $file) { + next if ($Conf->{action} eq 'list' + && $_ !~ /$Conf->{pattern}/); push @{$ret->{$pack}}, basename $_; } }