diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/devtool/sdk.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/lib/devtool/sdk.py b/scripts/lib/devtool/sdk.py index a22841d789..46fd12bdb2 100644 --- a/scripts/lib/devtool/sdk.py +++ b/scripts/lib/devtool/sdk.py | |||
@@ -23,6 +23,7 @@ import shutil | |||
23 | import errno | 23 | import errno |
24 | import sys | 24 | import sys |
25 | import tempfile | 25 | import tempfile |
26 | import re | ||
26 | from devtool import exec_build_env_command, setup_tinfoil, parse_recipe, DevtoolError | 27 | from devtool import exec_build_env_command, setup_tinfoil, parse_recipe, DevtoolError |
27 | 28 | ||
28 | logger = logging.getLogger('devtool') | 29 | logger = logging.getLogger('devtool') |
@@ -209,6 +210,28 @@ def sdk_update(args, config, basepath, workspace): | |||
209 | logger.error("Updating %s failed" % changedfile) | 210 | logger.error("Updating %s failed" % changedfile) |
210 | return ret | 211 | return ret |
211 | 212 | ||
213 | # Check if UNINATIVE_CHECKSUM changed | ||
214 | uninative = False | ||
215 | if 'conf/local.conf' in changedfiles: | ||
216 | def read_uninative_checksums(fn): | ||
217 | chksumitems = [] | ||
218 | with open(fn, 'r') as f: | ||
219 | for line in f: | ||
220 | if line.startswith('UNINATIVE_CHECKSUM'): | ||
221 | splitline = re.split(r'[\[\]"\']', line) | ||
222 | if len(splitline) > 3: | ||
223 | chksumitems.append((splitline[1], splitline[3])) | ||
224 | return chksumitems | ||
225 | |||
226 | oldsums = read_uninative_checksums(os.path.join(basepath, 'conf/local.conf')) | ||
227 | newsums = read_uninative_checksums(os.path.join(tmpsdk_dir, 'conf/local.conf')) | ||
228 | if oldsums != newsums: | ||
229 | uninative = True | ||
230 | for buildarch, chksum in newsums: | ||
231 | uninative_file = os.path.join('downloads', 'uninative', chksum, '%s-nativesdk-libc.tar.bz2' % buildarch) | ||
232 | mkdir(os.path.join(tmpsdk_dir, os.path.dirname(uninative_file))) | ||
233 | ret = subprocess.call("wget -q -O %s %s/%s" % (uninative_file, updateserver, uninative_file), shell=True, cwd=tmpsdk_dir) | ||
234 | |||
212 | # Ok, all is well at this point - move everything over | 235 | # Ok, all is well at this point - move everything over |
213 | tmplayers_dir = os.path.join(tmpsdk_dir, 'layers') | 236 | tmplayers_dir = os.path.join(tmpsdk_dir, 'layers') |
214 | if os.path.exists(tmplayers_dir): | 237 | if os.path.exists(tmplayers_dir): |
@@ -220,6 +243,9 @@ def sdk_update(args, config, basepath, workspace): | |||
220 | shutil.move(os.path.join(tmpsdk_dir, changedfile), destfile) | 243 | shutil.move(os.path.join(tmpsdk_dir, changedfile), destfile) |
221 | os.remove(os.path.join(conf_dir, 'sdk-conf-manifest')) | 244 | os.remove(os.path.join(conf_dir, 'sdk-conf-manifest')) |
222 | shutil.move(tmpmanifest, conf_dir) | 245 | shutil.move(tmpmanifest, conf_dir) |
246 | if uninative: | ||
247 | shutil.rmtree(os.path.join(basepath, 'downloads', 'uninative')) | ||
248 | shutil.move(os.path.join(tmpsdk_dir, 'downloads', 'uninative'), os.path.join(basepath, 'downloads')) | ||
223 | 249 | ||
224 | if not sstate_mirrors: | 250 | if not sstate_mirrors: |
225 | with open(os.path.join(conf_dir, 'site.conf'), 'a') as f: | 251 | with open(os.path.join(conf_dir, 'site.conf'), 'a') as f: |