1*4882a593SmuzhiyunFrom da88c57fe03e4474ba20325edacf519e80c1d7a8 Mon Sep 17 00:00:00 2001 2*4882a593SmuzhiyunFrom: Hongxu Jia <hongxu.jia@windriver.com> 3*4882a593SmuzhiyunDate: Tue, 17 Jul 2018 10:13:38 +0800 4*4882a593SmuzhiyunSubject: [PATCH] conditionally do not fetch code by easy_install 5*4882a593Smuzhiyun 6*4882a593SmuzhiyunIf var-NO_FETCH_BUILD is set, do not allow to fetch code from 7*4882a593Smuzhiyuninternet by easy_install. 8*4882a593Smuzhiyun 9*4882a593SmuzhiyunUpstream-Status: Inappropriate [oe specific] 10*4882a593Smuzhiyun 11*4882a593SmuzhiyunSigned-off-by: Hongxu Jia <hongxu.jia@windriver.com> 12*4882a593Smuzhiyun 13*4882a593Smuzhiyun--- 14*4882a593Smuzhiyun setuptools/command/easy_install.py | 5 +++++ 15*4882a593Smuzhiyun 1 file changed, 5 insertions(+) 16*4882a593Smuzhiyun 17*4882a593Smuzhiyundiff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py 18*4882a593Smuzhiyunindex fc848d0..c04a5de 100644 19*4882a593Smuzhiyun--- a/setuptools/command/easy_install.py 20*4882a593Smuzhiyun+++ b/setuptools/command/easy_install.py 21*4882a593Smuzhiyun@@ -642,6 +642,11 @@ class easy_install(Command): 22*4882a593Smuzhiyun os.path.exists(tmpdir) and rmtree(tmpdir) 23*4882a593Smuzhiyun 24*4882a593Smuzhiyun def easy_install(self, spec, deps=False): 25*4882a593Smuzhiyun+ if os.environ.get('NO_FETCH_BUILD', None): 26*4882a593Smuzhiyun+ log.error("ERROR: Do not try to fetch `%s' for building. " 27*4882a593Smuzhiyun+ "Please add its native recipe to DEPENDS." % spec) 28*4882a593Smuzhiyun+ return None 29*4882a593Smuzhiyun+ 30*4882a593Smuzhiyun with self._tmpdir() as tmpdir: 31*4882a593Smuzhiyun if not isinstance(spec, Requirement): 32*4882a593Smuzhiyun if URL_SCHEME(spec): 33