]> git.ipfire.org Git - pakfire.git/commitdiff
Remove some dead code.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 17 Jul 2011 11:02:25 +0000 (13:02 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 17 Jul 2011 11:02:25 +0000 (13:02 +0200)
pakfire/repository/__init__.py
pakfire/repository/base.py

index b866693415f5373f2820ab882a5281e4a996dbca..c4d8569dafc68728e72034cfd61b71e51e1fe283 100644 (file)
@@ -122,7 +122,3 @@ class Repositories(object):
        def whatprovides(self, what):
                for solv in self.pool.providers(what):
                        yield packages.SolvPackage(self.pakfire, solv)
-
-       def search(self, what):
-               raise NotImplementedError
-
index 9a60a8cd9371f25cc30a40cd78fc10f56b45fefb..448ac1a54d0e4029ce1f58be5488f34cc4a278d8 100644 (file)
@@ -85,106 +85,6 @@ class RepositoryFactory(object):
 
                self.index.update(force)
 
-       #def get_all(self):
-       #       """
-       #               Simply returns an instance of every package in this repository.
-       #       """
-       #       for pkg in self.packages:
-       #               yield pkg
-
-       #def get_by_name(self, name):
-       #       for pkg in self.packages:
-       #               if pkg.name == name:
-       #                       yield pkg
-
-       #def get_by_uuid(self, uuid):
-       #       for pkg in self.packages:
-       #               if pkg.uuid == uuid:
-       #                       return pkg
-
-       #def get_by_evr(self, name, evr):
-       #       m = re.match(r"([0-9]+\:)?([0-9A-Za-z\.\-]+)-([0-9]+\.?[a-z0-9]+|[0-9]+)", evr)
-
-       #       if not m:
-       #               raise Exception, "Invalid input: %s" % evr
-
-       #       (epoch, version, release) = m.groups()
-       #       if epoch and epoch.endswith(":"):
-       #               epoch = epoch[:-1]
-
-       #       pkgs = [p for p in self.index.get_by_evr(name, epoch, version, release)]
-
-       #       if not pkgs:
-       #               return
-
-       #       if not len(pkgs) == 1:
-       #               raise Exception
-
-       #       return pkgs[0]
-
-       #def get_by_glob(self, pattern):
-       #       """
-       #               Returns a list of all packages that names match the glob pattern
-       #               that is provided.
-       #       """
-       #       for pkg in self.packages:
-       #               if fnmatch.fnmatch(pkg.name, pattern):
-       #                       yield pkg
-
-       #def get_by_provides(self, requires):
-       #       """
-       #               Returns a list of all packages that offer a matching "provides"
-       #               of the given "requires".
-       #       """
-       #       for pkg in self.packages:
-       #               if pkg.does_provide(requires):
-       #                       yield pkg
-
-       #def get_by_requires(self, requires):
-       #       """
-       #               Returns a list of all packages that require the given requirement.
-       #       """
-       #       for pkg in self.packages:
-       #               # XXX does not use the cmp() function of Requires.
-       #               if requires.requires in pkg.requires:
-       #                       yield pkg
-
-       #def get_by_file(self, filename):
-       #       for pkg in self.packages:
-       #               match = False
-       #               for pkg_filename in pkg.filelist:
-       #                       if fnmatch.fnmatch(pkg_filename, filename):
-       #                               match = True
-       #                               break
-
-       #               if match:
-       #                       yield pkg
-
-       #def get_by_group(self, group):
-       #       """
-       #               Get all packages that belong to a specific group.
-       #       """
-       #       for pkg in self.packages:
-       #               if group in pkg.groups:
-       #                       yield pkg
-
-       #def get_by_friendly_name(self, name):
-       #       for pkg in self.packages:
-       #               if pkg.friendly_name == name:
-       #                       return pkg
-
-       def search(self, pattern):
-               """
-                       Returns a list of packages, that match the given pattern,
-                       which can be either a part of the name, summary or description
-                       or can be a glob pattern that matches one of these.
-               """
-               for pkg in self.packages:
-                       for item in (pkg.name, pkg.summary, pkg.description):
-                               if pattern.lower() in item.lower() or \
-                                               fnmatch.fnmatch(item, pattern):
-                                       yield pkg
-
 
 class RepositoryDummy(RepositoryFactory):
        """