From e156618b82420160a584482fcfb544c91dc38691 Mon Sep 17 00:00:00 2001 From: Luis Martinez de Bartolome Izquierdo Date: Tue, 25 Sep 2018 13:38:36 +0200 Subject: [PATCH] Check system requirements if the package is in the local cache --- conans/client/installer.py | 2 ++ conans/test/integration/system_reqs_test.py | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/conans/client/installer.py b/conans/client/installer.py index 7f92f69fb01..b2cee623596 100644 --- a/conans/client/installer.py +++ b/conans/client/installer.py @@ -319,6 +319,8 @@ def _handle_node_cache(self, node, package_id, keep_build, processed_package_ref self._registry.set_ref(conan_ref, node.binary_remote.name) elif node.binary == BINARY_CACHE: output.success('Already installed!') + _handle_system_requirements(conan_file, package_ref, self._client_cache, + self._out) log_package_got_from_local_cache(package_ref) self._recorder.package_fetched_from_cache(package_ref) clean_dirty(package_folder) diff --git a/conans/test/integration/system_reqs_test.py b/conans/test/integration/system_reqs_test.py index 5abb73ed774..027fba8b769 100644 --- a/conans/test/integration/system_reqs_test.py +++ b/conans/test/integration/system_reqs_test.py @@ -23,6 +23,24 @@ def system_requirements(self): class SystemReqsTest(unittest.TestCase): + def force_system_reqs_rerun_test(self): + client = TestClient() + files = {'conanfile.py': base_conanfile.replace("%GLOBAL%", "")} + client.save(files) + client.run("create . user/channel") + self.assertIn("*+Running system requirements+*", client.user_io.out) + client.run("install Test/0.1@user/channel") + self.assertNotIn("*+Running system requirements+*", client.user_io.out) + ref = ConanFileReference.loads("Test/0.1@user/channel") + pfs = client.client_cache.packages(ref) + pid = os.listdir(pfs)[0] + reqs_file = client.client_cache.system_reqs_package(PackageReference(ref, pid)) + os.unlink(reqs_file) + + client.run("install Test/0.1@user/channel") + self.assertIn("*+Running system requirements+*", client.user_io.out) + self.assertTrue(os.path.exists(reqs_file)) + def local_system_requirements_test(self): client = TestClient() files = {'conanfile.py': base_conanfile.replace("%GLOBAL%", "")}