From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 3A3D6138D11 for ; Mon, 13 Jul 2015 13:26:35 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 45DDAE0901; Mon, 13 Jul 2015 13:26:33 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E01CCE0901 for ; Mon, 13 Jul 2015 13:26:32 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BE717340991 for ; Mon, 13 Jul 2015 13:26:31 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 10B4874B for ; Mon, 13 Jul 2015 13:26:30 +0000 (UTC) From: "Devan Franchini" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Devan Franchini" Message-ID: <1436793939.a3ef79ecdc93c82a599cab3eef1be49d7ca40a9d.twitch153@gentoo> Subject: [gentoo-commits] proj/layman:master commit in: layman/ X-VCS-Repository: proj/layman X-VCS-Files: layman/dbbase.py layman/remotedb.py X-VCS-Directories: layman/ X-VCS-Committer: twitch153 X-VCS-Committer-Name: Devan Franchini X-VCS-Revision: a3ef79ecdc93c82a599cab3eef1be49d7ca40a9d X-VCS-Branch: master Date: Mon, 13 Jul 2015 13:26:30 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: b1509d95-2759-4535-aefd-c11a3f8c71f4 X-Archives-Hash: 5538ac0ffb110cd08f1818505cc8af5f commit: a3ef79ecdc93c82a599cab3eef1be49d7ca40a9d Author: Devan Franchini gentoo org> AuthorDate: Mon Jul 13 13:25:36 2015 +0000 Commit: Devan Franchini gentoo org> CommitDate: Mon Jul 13 13:25:39 2015 +0000 URL: https://gitweb.gentoo.org/proj/layman.git/commit/?id=a3ef79ec Adds switch on read_db if text is provided Logically speaking, if the database "document" text is provided then it will likely not be universal to every database provided. Therefore adding another parameter that specifies the type of text that is being provided will help distinguish which database type it is. layman/dbbase.py | 11 ++++++++--- layman/remotedb.py | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/layman/dbbase.py b/layman/dbbase.py index 56ef158..09133c2 100644 --- a/layman/dbbase.py +++ b/layman/dbbase.py @@ -167,12 +167,17 @@ class DbBase(object): return - def read_db(self, path, text=None): + def read_db(self, path, text=None, text_type=None): ''' Read the overlay database for installed overlay definitions. ''' - for types in self.db_types: - db_ctl = self.mod_ctl.get_class(types)(self.config, + if text and text_type: + types = [text_type] + else: + types = self.db_types + + for t in types: + db_ctl = self.mod_ctl.get_class(t)(self.config, self.overlays, self.paths, self.ignore, diff --git a/layman/remotedb.py b/layman/remotedb.py index cd6ece3..89caf7a 100644 --- a/layman/remotedb.py +++ b/layman/remotedb.py @@ -280,7 +280,7 @@ class RemoteDB(DbBase): def _check_download(self, olist, url): try: - self.read_db(url, text=olist) + self.read_db(url, text=olist, text_type="xml_db") except Exception as error: self.output.debug("RemoteDB._check_download(), url=%s \nolist:\n" % url,2)