From: "Matt Turner" <mattst88@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/catalyst:master commit in: catalyst/
Date: Thu, 28 Jan 2021 02:41:42 +0000 (UTC) [thread overview]
Message-ID: <1611799606.b8b6de7bc84677d9ae13cf8bfff2c0e6a281ff75.mattst88@gentoo> (raw)
Message-ID: <20210128024142.GKOGHa4vJvi73ThXv1FgRIaZ_fgQ1FZ_lzCASOEL7gc@z> (raw)
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)
next reply other threads:[~2021-01-28 2:41 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-29 23:50 Matt Turner [this message]
2021-01-28 2:09 ` [gentoo-commits] proj/catalyst:pending/mattst88 commit in: catalyst/ Matt Turner
2021-01-28 2:41 ` [gentoo-commits] proj/catalyst:master " Matt Turner
-- strict thread matches above, loose matches on Subject: below --
2022-11-20 0:21 [gentoo-commits] proj/catalyst:wip/mattst88 " Matt Turner
2021-06-11 3:30 [gentoo-commits] proj/catalyst:master " Matt Turner
2021-06-10 0:48 ` [gentoo-commits] proj/catalyst:wip/mattst88 " Matt Turner
2021-06-10 0:48 Matt Turner
2021-02-20 21:27 [gentoo-commits] proj/catalyst:master " Matt Turner
2021-06-10 0:48 ` [gentoo-commits] proj/catalyst:wip/mattst88 " Matt Turner
2021-01-29 23:50 Matt Turner
2020-11-14 16:37 [gentoo-commits] proj/catalyst:master " Matt Turner
2020-12-19 19:56 ` [gentoo-commits] proj/catalyst:wip/mattst88 " Matt Turner
2020-10-30 22:41 [gentoo-commits] proj/catalyst:master " Matt Turner
2020-12-19 19:56 ` [gentoo-commits] proj/catalyst:wip/mattst88 " Matt Turner
2020-05-21 20:26 [gentoo-commits] proj/catalyst:master " Matt Turner
2020-05-27 6:20 ` [gentoo-commits] proj/catalyst:wip/mattst88 " Matt Turner
2020-05-21 20:25 [gentoo-commits] proj/catalyst:master " Matt Turner
2020-05-20 1:52 ` [gentoo-commits] proj/catalyst:wip/mattst88 " Matt Turner
2020-05-21 20:25 [gentoo-commits] proj/catalyst:master " Matt Turner
2020-05-20 1:52 ` [gentoo-commits] proj/catalyst:wip/mattst88 " Matt Turner
2020-05-21 20:25 [gentoo-commits] proj/catalyst:master " Matt Turner
2020-05-20 1:52 ` [gentoo-commits] proj/catalyst:wip/mattst88 " Matt Turner
2020-05-20 3:39 [gentoo-commits] proj/catalyst:pending/mattst88 " Matt Turner
2020-05-20 3:39 ` [gentoo-commits] proj/catalyst:wip/mattst88 " Matt Turner
2020-05-20 3:39 [gentoo-commits] proj/catalyst:pending/mattst88 " Matt Turner
2020-05-20 1:52 ` [gentoo-commits] proj/catalyst:wip/mattst88 " Matt Turner
2020-05-20 2:33 Matt Turner
2020-05-20 2:29 Matt Turner
2020-05-20 1:52 Matt Turner
2020-05-20 1:52 Matt Turner
2020-05-20 1:52 Matt Turner
2020-05-20 1:52 Matt Turner
2020-05-20 1:52 Matt Turner
2020-05-20 0:26 Matt Turner
2020-05-20 0:26 Matt Turner
2020-05-20 0:26 Matt Turner
2020-05-20 0:26 Matt Turner
2020-05-20 0:26 Matt Turner
2020-05-20 0:26 Matt Turner
2020-05-20 0:26 Matt Turner
2020-05-19 23:45 Matt Turner
2020-05-19 23:45 Matt Turner
2020-05-19 23:39 Matt Turner
2020-05-19 23:39 Matt Turner
2020-05-19 23:30 Matt Turner
2020-05-19 23:30 Matt Turner
2020-05-19 23:04 Matt Turner
2020-05-19 23:04 Matt Turner
2020-05-19 22:55 Matt Turner
2020-05-19 22:55 Matt Turner
2020-05-19 22:55 Matt Turner
2020-05-19 22:55 Matt Turner
2020-05-19 22:55 Matt Turner
2020-05-19 22:55 Matt Turner
2020-05-19 22:55 Matt Turner
2020-05-19 22:55 Matt Turner
2020-05-19 22:55 Matt Turner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1611799606.b8b6de7bc84677d9ae13cf8bfff2c0e6a281ff75.mattst88@gentoo \
--to=mattst88@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox