From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 16BB9138330 for ; Sun, 18 Sep 2016 22:26:34 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0409CE0941; Sun, 18 Sep 2016 22:26:32 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C1FBFE0941 for ; Sun, 18 Sep 2016 22:26:31 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5178F340AA1 for ; Sun, 18 Sep 2016 22:26:30 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 45CA72487 for ; Sun, 18 Sep 2016 22:26:28 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1474236825.9b31cd9f2823d742ce3431e480561244f00f1744.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/util/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/util/writeable_check.py X-VCS-Directories: pym/portage/util/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 9b31cd9f2823d742ce3431e480561244f00f1744 X-VCS-Branch: master Date: Sun, 18 Sep 2016 22:26: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: f3a84e7c-fd83-4d6f-b536-4eed4187c281 X-Archives-Hash: 4d7f21d354a889e8e8226d587c8f91f1 commit: 9b31cd9f2823d742ce3431e480561244f00f1744 Author: Zac Medico gentoo org> AuthorDate: Sun Sep 18 22:10:54 2016 +0000 Commit: Zac Medico gentoo org> CommitDate: Sun Sep 18 22:13:45 2016 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=9b31cd9f writeable_check: warn about invalid mountinfo lines (bug 594284) X-Gentoo-bug: 594284 X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=594284 pym/portage/util/writeable_check.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pym/portage/util/writeable_check.py b/pym/portage/util/writeable_check.py index 26fe199..e5b14c0 100644 --- a/pym/portage/util/writeable_check.py +++ b/pym/portage/util/writeable_check.py @@ -44,6 +44,7 @@ def linux_ro_checker(dir_list): read-only, may be empty. """ ro_filesystems = set() + invalids = [] try: with io.open("/proc/self/mountinfo", mode='r', @@ -61,6 +62,7 @@ def linux_ro_checker(dir_list): _dir, attr1 = mount[0].split()[4:6] except ValueError: # If it raises ValueError we can simply ignore the line. + invalids.append(line) continue # check for situation with invalid entries for /home and /root in /proc/self/mountinfo # root path is missing sometimes on WSL @@ -72,7 +74,11 @@ def linux_ro_checker(dir_list): try: attr2 = mount[1].split()[1] except IndexError: - attr2 = mount[1] + invalids.append(line) + continue + else: + invalids.append(line) + continue if attr1.startswith('ro') or attr2.startswith('ro'): ro_filesystems.add(_dir) @@ -83,6 +89,10 @@ def linux_ro_checker(dir_list): level=logging.WARNING, noiselevel=-1) return [] + for line in invalids: + writemsg_level(_("!!! /proc/self/mountinfo contains unrecognized line: %s\n") + % line.rstrip(), level=logging.WARNING, noiselevel=-1) + ro_devs = {} for x in ro_filesystems: try: