From: Michael Tremer Date: Wed, 3 May 2023 18:45:16 +0000 (+0000) Subject: builds: Drop unused function X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d9cd0fe401f809f73ce5ad3790b861f30a04b7c1;p=pbs.git builds: Drop unused function Signed-off-by: Michael Tremer --- diff --git a/src/buildservice/builds.py b/src/buildservice/builds.py index 16714f60..9116f9ce 100644 --- a/src/buildservice/builds.py +++ b/src/buildservice/builds.py @@ -67,40 +67,6 @@ class Builds(base.Object): """, uuid, ) - def get_by_name(self, name, type=None, user=None, limit=None, offset=None): - args = [name,] - conditions = [ - "packages.name = %s", - ] - - if type: - conditions.append("builds.type = %s") - args.append(type) - - or_conditions = [] - if user and not user.is_admin(): - or_conditions.append("builds.owner_id = %s") - args.append(user.id) - - query = "SELECT builds.* AS id FROM builds \ - JOIN packages ON builds.pkg_id = packages.id" - - if or_conditions: - conditions.append(" OR ".join(or_conditions)) - - if conditions: - query += " WHERE %s" % " AND ".join(conditions) - - if type == "release": - query += " ORDER BY packages.name,packages.epoch,packages.version,packages.release,id ASC" - elif type == "scratch": - query += " ORDER BY created_at DESC" - - query += " LIMIT %s OFFSET %s" - args.extend([offset, limit]) - - return [Build(self.backend, b.id, b) for b in self.db.query(query, *args)] - def get_latest_by_name(self, name): """ Returns the latest build that matches the package name