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 58819138BBE for ; Sun, 2 Nov 2014 21:14:33 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7266CE08AD; Sun, 2 Nov 2014 21:14:32 +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 EAB2AE08AD for ; Sun, 2 Nov 2014 21:14:31 +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 B805634046F for ; Sun, 2 Nov 2014 21:14:30 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id CF66694D8 for ; Sun, 2 Nov 2014 21:14:28 +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: <1413924653.dfdec124b39f67f77c95dcace8c22b7fad965c27.twitch153@gentoo> Subject: [gentoo-commits] proj/layman:master commit in: layman/ X-VCS-Repository: proj/layman X-VCS-Files: layman/db.py layman/dbbase.py X-VCS-Directories: layman/ X-VCS-Committer: twitch153 X-VCS-Committer-Name: Devan Franchini X-VCS-Revision: dfdec124b39f67f77c95dcace8c22b7fad965c27 X-VCS-Branch: master Date: Sun, 2 Nov 2014 21:14:28 +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: cece678d-b037-4a52-8354-1adf3ae48a3d X-Archives-Hash: a5ead672314064b1fbeddc4037491056 commit: dfdec124b39f67f77c95dcace8c22b7fad965c27 Author: W. Trevor King tremily us> AuthorDate: Tue Oct 21 20:45:59 2014 +0000 Commit: Devan Franchini gentoo org> CommitDate: Tue Oct 21 20:50:53 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/layman.git;a=commit;h=dfdec124 layman/db: Ignore an initially-missing installed file Avoid: $ emerge -av app-portage/layman $ echo 'source /var/lib/layman/make.conf' >> /etc/portage/make.conf $ layman --fetch $ layman --list-local * Warning: an installed db file was not found at: ['/var/lib/layman/installed.xml'] when that's the expected behavior before you've added any local repositories. Instead, interpret the lack of a local file listing installed repositories as "no repositories installed" and continue silently on. --- layman/db.py | 1 + layman/dbbase.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/layman/db.py b/layman/db.py index 4edf465..add8fa1 100644 --- a/layman/db.py +++ b/layman/db.py @@ -60,6 +60,7 @@ class DB(DbBase): config, paths=[config['installed'], ], ignore=ignore, + allow_missing=True, ) self.repo_conf = RepoConfManager(self.config, self.overlays) diff --git a/layman/dbbase.py b/layman/dbbase.py index aff48b8..7bfb60f 100644 --- a/layman/dbbase.py +++ b/layman/dbbase.py @@ -90,7 +90,7 @@ class DbBase(object): ''' Handle a list of overlays.''' def __init__(self, config, paths=None, ignore = 0, - ignore_init_read_errors=False + ignore_init_read_errors=False, allow_missing=False ): self.config = config @@ -111,7 +111,7 @@ class DbBase(object): self.read_file(path) path_found = True - if not path_found: + if not path_found and not allow_missing: self.output.warn("Warning: an installed db file was not found at: %s" % str(self.paths))