commit: f98b1b5a10ef2723df36ebdc12930adb9b2c88de Author: Sheng Yu <syu.os <AT> protonmail <DOT> com> AuthorDate: Tue Jul 12 06:50:34 2022 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Tue Jul 12 23:30:22 2022 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=f98b1b5a
Include gnupg keys during setup.py build test. Signed-off-by: Sheng Yu <syu.os <AT> protonmail.com> Closes: https://github.com/gentoo/portage/pull/855 Signed-off-by: Sam James <sam <AT> gentoo.org> setup.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/setup.py b/setup.py index d2e45b281..ba6194b29 100755 --- a/setup.py +++ b/setup.py @@ -681,6 +681,17 @@ class build_tests(x_build_scripts_custom): print("Symlinking %s -> %s" % (conf_dir, conf_src)) os.symlink(conf_src, conf_dir) + source_path = os.path.realpath(__file__) + + # copy GPG test keys + copy_tree( + os.path.join( + os.path.dirname(source_path), "lib", "portage", "tests", ".gnupg" + ), + os.path.join(self.build_lib, "portage", "tests", ".gnupg"), + ) + os.chmod(os.path.join(self.build_lib, "portage", "tests", ".gnupg"), 0o700) + # create $build_lib/../.portage_not_installed # to enable proper paths in tests with open(os.path.join(self.top_dir, ".portage_not_installed"), "w"): @@ -701,15 +712,6 @@ class test(Command): def run(self): self.run_command("build_tests") - # copy GPG test keys - copy_tree( - os.path.join( - self.build_lib, "..", "..", "lib", "portage", "tests", ".gnupg" - ), - os.path.join(self.build_lib, "portage", "tests", ".gnupg"), - ) - os.chmod(os.path.join(self.build_lib, "portage", "tests", ".gnupg"), 0o700) - subprocess.check_call( [ sys.executable,