summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-17 11:40:01 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-17 12:42:08 +0300
commit4d3a53ff36526669fcde7b64dc947e8d76aba56b (patch)
tree659ef2923ef2123a008394fefc066cc69585aaa0 /bitbake/lib/bb/fetch2
parent0a52bdfb9a63a0cc5654406f98b5bbcd2de3aad8 (diff)
downloadpoky-4d3a53ff36526669fcde7b64dc947e8d76aba56b.tar.gz
bitbake: fetch2/utils: Clean up imports
Move various random imports to the start of the modules as cleanup and avoid an import issue with bb.process on python 2.6. (Bitbake rev: aed4adfbe3a591ca4f8e41fb763c9f961bf2e6d5) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2')
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index dd1cc932d4..9029a5a83c 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -28,6 +28,8 @@ BitBake build tools.
28from __future__ import absolute_import 28from __future__ import absolute_import
29from __future__ import print_function 29from __future__ import print_function
30import os, re 30import os, re
31import signal
32import glob
31import logging 33import logging
32import urllib 34import urllib
33import urlparse 35import urlparse
@@ -38,6 +40,8 @@ import operator
38import bb.persist_data, bb.utils 40import bb.persist_data, bb.utils
39import bb.checksum 41import bb.checksum
40from bb import data 42from bb import data
43import bb.process
44import subprocess
41 45
42__version__ = "2" 46__version__ = "2"
43_checksum_cache = bb.checksum.FileChecksumCache() 47_checksum_cache = bb.checksum.FileChecksumCache()
@@ -584,7 +588,6 @@ def update_stamp(u, ud, d):
584 open(ud.donestamp, 'w').close() 588 open(ud.donestamp, 'w').close()
585 589
586def subprocess_setup(): 590def subprocess_setup():
587 import signal
588 # Python installs a SIGPIPE handler by default. This is usually not what 591 # Python installs a SIGPIPE handler by default. This is usually not what
589 # non-Python subprocesses expect. 592 # non-Python subprocesses expect.
590 # SIGPIPE errors are known issues with gzip/bash 593 # SIGPIPE errors are known issues with gzip/bash
@@ -653,9 +656,6 @@ def runfetchcmd(cmd, d, quiet = False, cleanup = []):
653 Optionally remove the files/directories listed in cleanup upon failure 656 Optionally remove the files/directories listed in cleanup upon failure
654 """ 657 """
655 658
656 import bb.process
657 import subprocess
658
659 # Need to export PATH as binary could be in metadata paths 659 # Need to export PATH as binary could be in metadata paths
660 # rather than host provided 660 # rather than host provided
661 # Also include some other variables. 661 # Also include some other variables.
@@ -913,7 +913,6 @@ def get_file_checksums(filelist, pn):
913 try: 913 try:
914 checksum = _checksum_cache.get_checksum(f) 914 checksum = _checksum_cache.get_checksum(f)
915 except OSError as e: 915 except OSError as e:
916 import traceback
917 bb.warn("Unable to get checksum for %s SRC_URI entry %s: %s" % (pn, os.path.basename(f), e)) 916 bb.warn("Unable to get checksum for %s SRC_URI entry %s: %s" % (pn, os.path.basename(f), e))
918 return None 917 return None
919 return checksum 918 return checksum
@@ -923,7 +922,6 @@ def get_file_checksums(filelist, pn):
923 checksum = None 922 checksum = None
924 if '*' in pth: 923 if '*' in pth:
925 # Handle globs 924 # Handle globs
926 import glob
927 for f in glob.glob(pth): 925 for f in glob.glob(pth):
928 checksum = checksum_file(f) 926 checksum = checksum_file(f)
929 if checksum: 927 if checksum:
@@ -1133,7 +1131,6 @@ class FetchMethod(object):
1133 raise NoMethodError(url) 1131 raise NoMethodError(url)
1134 1132
1135 def unpack(self, urldata, rootdir, data): 1133 def unpack(self, urldata, rootdir, data):
1136 import subprocess
1137 iterate = False 1134 iterate = False
1138 file = urldata.localpath 1135 file = urldata.localpath
1139 1136