LegacyPackageInstaller: Ignore files which do not end in ".pdb".

The LegacyPackageInstaller's data folder is (and has always been)
"~/config/packages", which is of course the same directory that Haiku's
(relatively) new package management system uses. We don't want the
"administrative" folder and any HPKGs in that directory to show up in
the "installed legacy packages" list, so ignore them.
This commit is contained in:
Augustin Cavalier 2017-01-05 12:06:30 -05:00
parent e6efd8f21c
commit bdf0ed4231

View File

@ -351,8 +351,6 @@ UninstallView::_ReloadAppList()
if (ret != B_OK)
return ret;
fprintf(stderr, "Ichi! %s\n", fToPackages.Path());
BEntry iter;
while (dir.GetNextEntry(&iter) == B_OK) {
char filename[B_FILE_NAME_LENGTH];
@ -363,6 +361,12 @@ UninstallView::_ReloadAppList()
if (iter.GetNodeRef(&ref) != B_OK)
continue;
if (strncmp(filename + (strnlen(filename, B_FILE_NAME_LENGTH) - 3),
"pdb", 3) != 0) {
printf("Ignoring non-package '%s'\n", filename);
continue;
}
printf("Found package '%s'\n", filename);
_AddFile(filename, ref);
}