diff --git a/slpkg/main.py b/slpkg/main.py index 0f06c44c..e5417111 100644 --- a/slpkg/main.py +++ b/slpkg/main.py @@ -314,7 +314,7 @@ class Menu(Configs): f'{args=}, {self.flags=}, {self.repository=}') def load_database(self): - if self.repository != '*': + if self.repository != '*' and not self.data: if self.is_binary: self.data: dict = BinQueries(self.repository).repository_data() else: @@ -637,14 +637,15 @@ class Menu(Configs): command: str = Menu.search.__name__ if len(self.args) >= 2: - self.load_database() self.check.is_database_empty() packages: list = self.is_file_list_packages() if self.utils.is_option(self.flag_no_cases, self.flags) or not self.case_sensitive: + self.load_database() packages: list = self.utils.case_insensitive_pattern_matching(packages, self.data) if self.utils.is_option(self.flag_searches, self.flags): + self.load_database() packages: list = self.choose.packages(self.data, packages, command) pkgs = SearchPackage(self.flags, packages, self.repository) diff --git a/slpkg/utilities.py b/slpkg/utilities.py index 43856984..77f6002c 100644 --- a/slpkg/utilities.py +++ b/slpkg/utilities.py @@ -205,7 +205,7 @@ class Utilities(Configs): repo_packages: tuple = tuple(data.keys()) for package in packages: for pkg in repo_packages: - if package == pkg.lower(): + if package.lower() == pkg.lower(): packages.append(pkg) packages.remove(package) return packages