All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] Fix for eSDK update interaction with uninative checksum changes
@ 2016-04-19 11:09 Paul Eggleton
  2016-04-19 11:09 ` [PATCH 1/1] devtool: sdk-update: fix handling of UNINATIVE_CHECKSUM changes Paul Eggleton
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Eggleton @ 2016-04-19 11:09 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit e003ef038819c10f351bb8268b377626c95bb077:

  toasterconf.json: Update for krogoth release (2016-04-18 16:48:58 +0100)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib paule/extsdk-uninative-update
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/extsdk-uninative-update

Paul Eggleton (1):
  devtool: sdk-update: fix handling of UNINATIVE_CHECKSUM changes

 scripts/lib/devtool/sdk.py | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

-- 
2.5.5



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/1] devtool: sdk-update: fix handling of UNINATIVE_CHECKSUM changes
  2016-04-19 11:09 [PATCH 0/1] Fix for eSDK update interaction with uninative checksum changes Paul Eggleton
@ 2016-04-19 11:09 ` Paul Eggleton
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Eggleton @ 2016-04-19 11:09 UTC (permalink / raw)
  To: openembedded-core

If UNINATIVE_CHECKSUM changes over an SDK update, bitbake within the
extensible SDK will be broken because it will see that the matching
uninative tarball doesn't exist and if there is a default value of
UNINATIVE_URL it will attempt to download the file and will then fail
because the checksums don't match up; alternatively if no UNINATIVE_URL
is set then it'll also fail with an error about misconfiguration. To fix
this, add some logic to devtool sdk-update to download the matching
uninative tarball(s) for the checksum(s) in the newly fetched SDK
configuration.

Fixes [YOCTO #9301].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 scripts/lib/devtool/sdk.py | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/scripts/lib/devtool/sdk.py b/scripts/lib/devtool/sdk.py
index a22841d..46fd12b 100644
--- a/scripts/lib/devtool/sdk.py
+++ b/scripts/lib/devtool/sdk.py
@@ -23,6 +23,7 @@ import shutil
 import errno
 import sys
 import tempfile
+import re
 from devtool import exec_build_env_command, setup_tinfoil, parse_recipe, DevtoolError
 
 logger = logging.getLogger('devtool')
@@ -209,6 +210,28 @@ def sdk_update(args, config, basepath, workspace):
                     logger.error("Updating %s failed" % changedfile)
                     return ret
 
+            # Check if UNINATIVE_CHECKSUM changed
+            uninative = False
+            if 'conf/local.conf' in changedfiles:
+                def read_uninative_checksums(fn):
+                    chksumitems = []
+                    with open(fn, 'r') as f:
+                        for line in f:
+                            if line.startswith('UNINATIVE_CHECKSUM'):
+                                splitline = re.split(r'[\[\]"\']', line)
+                                if len(splitline) > 3:
+                                    chksumitems.append((splitline[1], splitline[3]))
+                    return chksumitems
+
+                oldsums = read_uninative_checksums(os.path.join(basepath, 'conf/local.conf'))
+                newsums = read_uninative_checksums(os.path.join(tmpsdk_dir, 'conf/local.conf'))
+                if oldsums != newsums:
+                    uninative = True
+                    for buildarch, chksum in newsums:
+                        uninative_file = os.path.join('downloads', 'uninative', chksum, '%s-nativesdk-libc.tar.bz2' % buildarch)
+                        mkdir(os.path.join(tmpsdk_dir, os.path.dirname(uninative_file)))
+                        ret = subprocess.call("wget -q -O %s %s/%s" % (uninative_file, updateserver, uninative_file), shell=True, cwd=tmpsdk_dir)
+
             # Ok, all is well at this point - move everything over
             tmplayers_dir = os.path.join(tmpsdk_dir, 'layers')
             if os.path.exists(tmplayers_dir):
@@ -220,6 +243,9 @@ def sdk_update(args, config, basepath, workspace):
                 shutil.move(os.path.join(tmpsdk_dir, changedfile), destfile)
             os.remove(os.path.join(conf_dir, 'sdk-conf-manifest'))
             shutil.move(tmpmanifest, conf_dir)
+            if uninative:
+                shutil.rmtree(os.path.join(basepath, 'downloads', 'uninative'))
+                shutil.move(os.path.join(tmpsdk_dir, 'downloads', 'uninative'), os.path.join(basepath, 'downloads'))
 
             if not sstate_mirrors:
                 with open(os.path.join(conf_dir, 'site.conf'), 'a') as f:
-- 
2.5.5



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-19 11:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-19 11:09 [PATCH 0/1] Fix for eSDK update interaction with uninative checksum changes Paul Eggleton
2016-04-19 11:09 ` [PATCH 1/1] devtool: sdk-update: fix handling of UNINATIVE_CHECKSUM changes Paul Eggleton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.