From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1246249-garchives=archives.gentoo.org@lists.gentoo.org>
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 4DDD913835A
	for <garchives@archives.gentoo.org>; Thu, 28 Jan 2021 02:09:36 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 59EB9E09C0;
	Thu, 28 Jan 2021 02:09:35 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 3EB52E09C0
	for <gentoo-commits@lists.gentoo.org>; Thu, 28 Jan 2021 02:09:35 +0000 (UTC)
Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 0DDF4335CD8
	for <gentoo-commits@lists.gentoo.org>; Thu, 28 Jan 2021 02:09:34 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 941344AC
	for <gentoo-commits@lists.gentoo.org>; Thu, 28 Jan 2021 02:09:32 +0000 (UTC)
From: "Matt Turner" <mattst88@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Matt Turner" <mattst88@gentoo.org>
Message-ID: <1611799606.b8b6de7bc84677d9ae13cf8bfff2c0e6a281ff75.mattst88@gentoo>
Subject: [gentoo-commits] proj/catalyst:pending/mattst88 commit in: catalyst/
X-VCS-Repository: proj/catalyst
X-VCS-Files: catalyst/support.py
X-VCS-Directories: catalyst/
X-VCS-Committer: mattst88
X-VCS-Committer-Name: Matt Turner
X-VCS-Revision: b8b6de7bc84677d9ae13cf8bfff2c0e6a281ff75
X-VCS-Branch: pending/mattst88
Date: Thu, 28 Jan 2021 02:09:32 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 5701e09d-b738-4892-8d2b-db144bdccd9a
X-Archives-Hash: 0991849d4a3b2aeeeecb38fefc606920
Message-ID: <20210128020932.ciXHTu7us-ogArpdV3zB47GdC32FZQbQglxwi68KDKA@z>

commit:     b8b6de7bc84677d9ae13cf8bfff2c0e6a281ff75
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 24 02:34:06 2021 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Thu Jan 28 02:06:46 2021 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=b8b6de7b

catalyst: Remove fallback make.conf parsing code

Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 catalyst/support.py | 42 +++---------------------------------------
 1 file changed, 3 insertions(+), 39 deletions(-)

diff --git a/catalyst/support.py b/catalyst/support.py
index f3a865a7..fa652987 100644
--- a/catalyst/support.py
+++ b/catalyst/support.py
@@ -2,7 +2,6 @@
 import glob
 import sys
 import os
-import re
 import shutil
 import time
 from pathlib import Path
@@ -12,6 +11,8 @@ import libmount
 
 from portage.repository.config import RepoConfig
 
+from snakeoil.bash import read_bash_dict
+
 from catalyst import log
 
 BASH_BINARY = "/bin/bash"
@@ -135,47 +136,10 @@ defined are not preserved. In other words, "foo", "bar", "oni" ordering is prese
                                     print_traceback=True)
 
 
-def parse_makeconf(mylines):
-    mymakeconf = {}
-    pos = 0
-    pat = re.compile("([0-9a-zA-Z_]*)=(.*)")
-    while pos < len(mylines):
-        if len(mylines[pos]) <= 1:
-            # skip blanks
-            pos += 1
-            continue
-        if mylines[pos][0] in ["#", " ", "\t"]:
-            # skip indented lines, comments
-            pos += 1
-            continue
-        else:
-            myline = mylines[pos]
-            mobj = pat.match(myline)
-            pos += 1
-            if mobj.group(2):
-                clean_string = re.sub(r"\"", r"", mobj.group(2))
-                mymakeconf[mobj.group(1)] = clean_string
-    return mymakeconf
-
-
 def read_makeconf(mymakeconffile):
     if os.path.exists(mymakeconffile):
         try:
-            try:
-                import snakeoil.bash  # import snakeoil.fileutils
-                return snakeoil.bash.read_bash_dict(mymakeconffile, sourcing_command="source")
-            except ImportError:
-                try:
-                    import portage.util
-                    return portage.util.getconfig(mymakeconffile, tolerant=1, allow_sourcing=True)
-                except Exception:
-                    try:
-                        import portage_util
-                        return portage_util.getconfig(mymakeconffile, tolerant=1, allow_sourcing=True)
-                    except ImportError:
-                        with open(mymakeconffile, "r") as myf:
-                            mylines = myf.readlines()
-                        return parse_makeconf(mylines)
+            return read_bash_dict(mymakeconffile, sourcing_command="source")
         except Exception:
             raise CatalystError("Could not parse make.conf file " +
                                 mymakeconffile, print_traceback=True)