commit: d2dc5a816c2ececad408bfbf6205ec8a4a01a5b5 Author: Oskari Pirhonen <xxc3ncoredxx <AT> gmail <DOT> com> AuthorDate: Tue Mar 21 03:00:31 2023 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Tue Mar 21 23:52:40 2023 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=d2dc5a81
archive-conf: switch from os.popen() to subprocess.run() Signed-off-by: Oskari Pirhonen <xxc3ncoredxx <AT> gmail.com> Closes: https://github.com/gentoo/portage/pull/1008 Signed-off-by: Sam James <sam <AT> gentoo.org> bin/archive-conf | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/archive-conf b/bin/archive-conf index a11677753..a6de29da6 100755 --- a/bin/archive-conf +++ b/bin/archive-conf @@ -9,6 +9,7 @@ # Jeremy Wohl's dispatch-conf script and the portage chkcontents script. # +import subprocess import sys from os import path as osp @@ -45,8 +46,12 @@ def archive_conf(): # Find all the CONTENTS files in VDB_PATH. eroot_vdb_path = os.path.join(portage.settings["EROOT"], portage.VDB_PATH) - with os.popen(f"find {eroot_vdb_path} -type f -name CONTENTS") as f: - content_files += f.readlines() + find = subprocess.run( + ["find", eroot_vdb_path, "-type", "f", "-name", "CONTENTS"], + capture_output=True, + text=True, + ) + content_files += find.stdout.splitlines() # Search for the saved md5 checksum of all the specified config files # and see if the current file is unmodified or not.