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 1F0921396D9 for ; Tue, 14 Nov 2017 21:46:46 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6B170E0EE3; Tue, 14 Nov 2017 21:46:45 +0000 (UTC) Received: from smtp.gentoo.org (mail.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 47AD1E0EE3 for ; Tue, 14 Nov 2017 21:46:45 +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 7C3F733BE68 for ; Tue, 14 Nov 2017 21:46:44 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 4444E99E6 for ; Tue, 14 Nov 2017 21:46:43 +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: <1510694053.4c4559f45b653a6b816ae66b1a6c4e7dd2ef7e8c.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: repoman/ X-VCS-Repository: proj/portage X-VCS-Files: repoman/setup.py X-VCS-Directories: repoman/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 4c4559f45b653a6b816ae66b1a6c4e7dd2ef7e8c X-VCS-Branch: master Date: Tue, 14 Nov 2017 21:46:43 +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: 4cea8a03-1cd0-4b3a-9ffb-077e99d4d9c6 X-Archives-Hash: ab6091c18b83d1f56792cbe3acdd308a commit: 4c4559f45b653a6b816ae66b1a6c4e7dd2ef7e8c Author: Zac Medico gentoo org> AuthorDate: Tue Nov 14 21:11:22 2017 +0000 Commit: Zac Medico gentoo org> CommitDate: Tue Nov 14 21:14:13 2017 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=4c4559f4 repoman/setup.py: create pym -> lib symlink for unit tests (bug 637460) Various code involving the .repoman_not_installed file assumes that the 'pym' directory should be added to sys.path, therefore create a pym -> lib symlink during unit tests. Bug: https://bugs.gentoo.org/637460 repoman/setup.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/repoman/setup.py b/repoman/setup.py index 6411231e0..ce0bc493a 100755 --- a/repoman/setup.py +++ b/repoman/setup.py @@ -147,6 +147,11 @@ class x_clean(clean): print('removing %s symlink' % repr(conf_dir)) os.unlink(conf_dir) + pym_dir = os.path.join(top_dir, 'pym') + if os.path.islink(pym_dir): + print('removing %s sylink' % repr(pym_dir)) + os.unlink(pym_dir) + pni_file = os.path.join(top_dir, '.repoman_not_installed') if os.path.exists(pni_file): print('removing %s' % repr(pni_file)) @@ -393,6 +398,17 @@ class build_tests(x_build_scripts_custom): print('Symlinking %s -> %s' % (conf_dir, conf_src)) os.symlink(conf_src, conf_dir) + # symlink 'pym' directory + pym_dir = os.path.join(self.top_dir, 'pym') + if os.path.exists(pym_dir): + if not os.path.islink(pym_dir): + raise SystemError('%s exists and is not a symlink (collision)' + % repr(pym_dir)) + os.unlink(pym_dir) + pym_src = 'lib' + print('Symlinking %s -> %s' % (pym_dir, pym_src)) + os.symlink(pym_src, pym_dir) + # create $build_lib/../.repoman_not_installed # to enable proper paths in tests with open(os.path.join(self.top_dir, '.repoman_not_installed'), 'w'):