From bdf0ed4231618548c9c9fd66f2da4631e5406753 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Thu, 5 Jan 2017 12:06:30 -0500 Subject: [PATCH] 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. --- src/apps/packageinstaller/UninstallView.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/apps/packageinstaller/UninstallView.cpp b/src/apps/packageinstaller/UninstallView.cpp index d187a96008..ba6fba49e1 100644 --- a/src/apps/packageinstaller/UninstallView.cpp +++ b/src/apps/packageinstaller/UninstallView.cpp @@ -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); }