poky: subtree update:7035b4b21e..a616ffebdc

Adrian Bunk (3):
      python3: Upgrade 3.7.4 -> 3.7.5
      lz4: Whitelist CVE-2014-4715
      iputils: Whitelist CVE-2000-1213 CVE-2000-1214

Alex Kube (1):
      go: Refactor patches for 1.13.3

Andreas Müller (2):
      vte: upgrade 0.56.3 -> 0.58.2
      webkitgtk: upgrade 2.26.1 -> 2.26.2

Andreas Oberritter (3):
      glibc: move ldconfig to its own package
      package.bbclass: Always include ldconfig fragment
      systemd: Add runtime dependency on new ldconfig package

André Draszik (1):
      libevent: update packaging (one package per shared library)

Anuj Mittal (1):
      libsdl2: fix race when building in parallel

Armin Kuster (13):
      oeqa/core: Add a check for MACHINE
      oeqa/core: Add qemu checks
      oeqa/manual/bsp-qemu: remove rpm tests already done in runtime
      oeqa/manual/bsp-qemu: remove KVM enabled which is already done in selftest runqemu
      oeqa/manual/bsp-qemu: drop xserver test done at runtime
      oeqa/manual/bsp-qemu: remove only_one_connmand_in_background test done at runtime
      oeqa/manual/bsp-qemu: remove postinit test done w/selftest runtime
      oeqa/manual/bsp-qemu: remove manual bash test
      oeqa/manual/bsp-qemu: remove manual useradd test
      oeqa/selftest/oescripts: move list-packageconfig-flags tests from manual to self
      oeqa/manua/oe-core: remove manual PACKAGECONFIG_FLAGS tests
      oeqa/selftest/runtime_test: add crosstab selftest
      oeqa/manual/oe-core: remove crosstab test from manual

Changhyeok Bae (1):
      iproute2: update 5.2.0 -> 5.3.0

Chee Yang Lee (1):
      wic: beautify 'wic help'

Chris Laplante via bitbake-devel (7):
      bitbake: contrib/vim: More Python indenting; move indent file to correct directory
      bitbake: contrib/vim: Special handling of bb.fatal
      bitbake: contrib/vim: don't redeclare indenter
      bitbake: contrib/vim: renaming & comments
      bitbake: contrib/vim: indenting for assignments; tweak Python indenting
      bitbake: contrib/vim: handle shell indenting
      bitbake: contrib/vim: Add copyright and license notice

Denys Dmytriyenko (1):
      buildhistory: fix "version went backwards" QA error message

Gavin Li (1):
      bitbake: prserv: fix ResourceWarning due to unclosed socket

Haris Okanovic (8):
      isoimage-isohybrid.py: Parameterize ESP label
      isoimage-isohybrid.py: Parameterize ESP partition size
      initscripts/sysfs.sh: Mount /sys/firmware/efi/efivars when possible
      gnupg: Split gpg and gpg-agent into a minimal gnupg-gpg package
      opkg: RDEPEND "gnupg-gpg" instead of "gnupg"
      gnupg/libksba/npth/pinentry: Add nativesdk to BBCLASSEXTEND
      meta/lib/oe/package_manager.py: Enable sha256 checksums in opkg indexer
      dhcp: Workaround busybox limitation in Linux dhclient-script

Ivan Efimov (1):
      bitbake: bitbake-worker child process create group before registering SIGTERM handler

Jacob Kroon (2):
      rm_work: Promote do_image_qa stamps to setscene versions
      rm_work: Simplify logic for setscene promotion

Jagadeesh Krishnanjanappa (1):
      tune-cortexa32: Fix libgcc-initial build issue for cortex-a32

Joshua Watt (4):
      oeqa: reproducible: Add option to capture bad packages
      icecc-create-env: Use OE patchelf in SDK
      mc: Fix build reproducibility
      wayland: Fix wayland-scanner build for MinGW

Khem Raj (4):
      libtirpc: Do not include bits/endian.h directly
      strace: Fix ptest build
      libnsl2: Update to latest master
      strace: Fix build found with 64bit time_t/musl

Liwei Song (1):
      buildtools-tarball: export OPENSSL_CONF for openssl

Mark Hatle (1):
      populate_sdk_ext.bbclass: Make integrated buildtools optional

Maxime Roussin-Bélanger (1):
      meta: add missing description for some recipes in graphics

Mikko Rapeli (1):
      harfbuzz: split libharfbuzz-subset.so to its own binary package

Oleksandr Kravchuk (1):
      git: update to 2.24.0

Paul Barker (1):
      scripts/native-intercept: Add chgrp intercept

Peter Kjellerstedt (3):
      sysstat: Correct our systemd unit file
      sysstat: Correct when to use the package provided systemd unit files
      bitbake: cooker: Remove a left-over comment about expanded_data

Richard Purdie (9):
      bitbake: fetch2: Ensure cached url data is matched to a datastore
      staging: Handle files moving between dependencies
      sstate: Add ability to hide summary output for sstate
      selftest/signing: Fix test_locked_signatures to use a temporary layer
      dhcp/ruby/ffpmeg: Use CFLAGS, not TARGET_CFLAGS
      bitbake: runqueue: Improve sstate rehashing output
      pseudo: Add statx support to fix fedora30 issues
      pseudo: Drop static linking to sqlite3
      sqlite3: Drop pic as we no longer need the sqlite3 static lib

Ross Burton (16):
      file: fix CVE-2019-18218
      file: remove redundant upstream check workaround
      file: run test suite when building natively
      patch: the CVE-2019-13638 fix also handles CVE-2018-20969
      libpng: whitelist CVE-2019-17371
      procps: whitelist CVE-2018-1121
      libsndfile1: whitelist CVE-2018-13419
      libpam: set CVE_PRODUCT
      libsoup: set CVE_PRODUCT
      libsoup-2.4: upgrade to 2.66.4
      insane: improve textrel warning message
      libsoup: update patch upstream status
      acpica: upgrade to 20191018
      ovmf: unify DEPENDS
      cve-check: we don't actually need to unpack to check
      cve-update-db-native: don't refresh more than once an hour

Samuli Piippo (1):
      linux-firmware: update packaging for brcm files

Scott Rifenbark (3):
      ref-manual: Completed the 3.0 migration section.
      mega-manual: Updated mega-manual Bitbake manual search path
      ref-manual: Removed blank lines from 3.0 migratrion section.

Stefan Agner (1):
      dbus: drop unused group netdev

Torbjörn Svensson (1):
      psplash: Do mount psplash tmpfs if not mounted

Trevor Gamblin (1):
      python3-misc: add python3-audio to RDEPENDS

Volker Vogelhuber (1):
      bitbake: fetch2/hg: Fix various runtime issues

Yeoh Ee Peng (4):
      scripts/resulttool/report: Enable report to use regression_map
      scripts/resulttool/report: Enable output raw test results
      scripts/resulttool/report: Add total statistic to test result.
      resulttool/store.py: Enable add extra test environment data

Yongxin Liu (2):
      systemd: Fix invalid argument of pstore log entry
      ltp: Add "udevadm trigger" before swap verification in mkswap01.sh

Zang Ruochen (8):
      ruby:upgrade 2.6.4 -> 2.6.5
      ethtool:upgrade 5.2 -> 5.3
      libdrm:upgrade 2.4.99 -> 2.4.100
      libcheck:upgrade 0.12.0 -> 0.13.0
      curl:upgrade 7.66.0 -> 7.67.0
      libinput:upgrade 1.14.1 -> 1.14.3
      python3-six:upgrade 1.12.0 -> 1.13.0
      libedit: upgrade 20190324 -> 20191025

Zhixiong Chi (1):
      libtirpc: create the symbol link for rpc header files

grygorii tertychnyi (1):
      archiver: avoid empty incfile in ar_recipe

Change-Id: Ice596e426e4533d7568a82bcbb21efdfc19e21e7
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/poky/meta/classes/archiver.bbclass b/poky/meta/classes/archiver.bbclass
index 093e2d9..7c46cff 100644
--- a/poky/meta/classes/archiver.bbclass
+++ b/poky/meta/classes/archiver.bbclass
@@ -441,9 +441,10 @@
             incfile = include_re.match(line).group(1)
         if incfile:
             incfile = d.expand(incfile)
+        if incfile:
             incfile = bb.utils.which(bbpath, incfile)
-            if incfile:
-                shutil.copy(incfile, outdir)
+        if incfile:
+            shutil.copy(incfile, outdir)
 
     create_tarball(d, outdir, 'recipe', d.getVar('ARCHIVER_OUTDIR'))
     bb.utils.remove(outdir, recurse=True)
diff --git a/poky/meta/classes/buildhistory.bbclass b/poky/meta/classes/buildhistory.bbclass
index f986f7c..affdf27 100644
--- a/poky/meta/classes/buildhistory.bbclass
+++ b/poky/meta/classes/buildhistory.bbclass
@@ -280,7 +280,7 @@
             last_pkgr = lastversion.pkgr
             r = bb.utils.vercmp((pkge, pkgv, pkgr), (last_pkge, last_pkgv, last_pkgr))
             if r < 0:
-                msg = "Package version for package %s went backwards which would break package feeds from (%s:%s-%s to %s:%s-%s)" % (pkg, last_pkge, last_pkgv, last_pkgr, pkge, pkgv, pkgr)
+                msg = "Package version for package %s went backwards which would break package feeds (from %s:%s-%s to %s:%s-%s)" % (pkg, last_pkge, last_pkgv, last_pkgr, pkge, pkgv, pkgr)
                 package_qa_handle_error("version-going-backwards", msg, d)
 
         pkginfo = PackageInfo(pkg)
diff --git a/poky/meta/classes/cve-check.bbclass b/poky/meta/classes/cve-check.bbclass
index 1c8b222..3326944 100644
--- a/poky/meta/classes/cve-check.bbclass
+++ b/poky/meta/classes/cve-check.bbclass
@@ -62,7 +62,7 @@
 
 }
 
-addtask cve_check after do_unpack before do_build
+addtask cve_check before do_build
 do_cve_check[depends] = "cve-update-db-native:do_populate_cve_db"
 do_cve_check[nostamp] = "1"
 
@@ -70,7 +70,6 @@
     """
     Delete the file used to gather all the CVE information.
     """
-
     bb.utils.remove(e.data.getVar("CVE_CHECK_TMP_FILE"))
 }
 
diff --git a/poky/meta/classes/insane.bbclass b/poky/meta/classes/insane.bbclass
index 9605ac2..f856cf6 100644
--- a/poky/meta/classes/insane.bbclass
+++ b/poky/meta/classes/insane.bbclass
@@ -340,9 +340,11 @@
     for line in phdrs.split("\n"):
         if textrel_re.match(line):
             sane = False
+            break
 
     if not sane:
-        package_qa_add_message(messages, "textrel", "ELF binary '%s' has relocations in .text" % path)
+        path = package_qa_clean_path(path, d, name)
+        package_qa_add_message(messages, "textrel", "%s: ELF binary %s has relocations in .text" % (name, path))
 
 QAPATHTEST[ldflags] = "package_qa_hash_style"
 def package_qa_hash_style(path, name, d, elf, messages):
diff --git a/poky/meta/classes/package.bbclass b/poky/meta/classes/package.bbclass
index f955df1..e0d6ff6 100644
--- a/poky/meta/classes/package.bbclass
+++ b/poky/meta/classes/package.bbclass
@@ -1731,8 +1731,6 @@
     else:
         snap_symlinks = False
 
-    use_ldconfig = bb.utils.contains('DISTRO_FEATURES', 'ldconfig', True, False, d)
-
     needed = {}
 
     shlib_provider = oe.package.read_shlib_providers(d)
@@ -1791,7 +1789,7 @@
                     if s[0] not in shlib_provider:
                         shlib_provider[s[0]] = {}
                     shlib_provider[s[0]][s[1]] = (pkg, pkgver)
-        if needs_ldconfig and use_ldconfig:
+        if needs_ldconfig:
             bb.debug(1, 'adding ldconfig call to postinst for %s' % pkg)
             postinst = d.getVar('pkg_postinst_%s' % pkg)
             if not postinst:
diff --git a/poky/meta/classes/populate_sdk_ext.bbclass b/poky/meta/classes/populate_sdk_ext.bbclass
index 9fda1c9..05cfc1c 100644
--- a/poky/meta/classes/populate_sdk_ext.bbclass
+++ b/poky/meta/classes/populate_sdk_ext.bbclass
@@ -21,6 +21,7 @@
 SDK_INCLUDE_PKGDATA ?= "0"
 SDK_INCLUDE_TOOLCHAIN ?= "${@'1' if d.getVar('SDK_EXT_TYPE') == 'full' else '0'}"
 SDK_INCLUDE_NATIVESDK ?= "0"
+SDK_INCLUDE_BUILDTOOLS ?= '1'
 
 SDK_RECRDEP_TASKS ?= ""
 
@@ -94,6 +95,7 @@
     real_target_multimach = d.getVar('REAL_MULTIMACH_TARGET_SYS')
 
     pkgs = {}
+    os.makedirs(os.path.dirname(d.getVar('SDK_EXT_TARGET_MANIFEST')), exist_ok=True)
     with open(d.getVar('SDK_EXT_TARGET_MANIFEST'), 'w') as f:
         for fn in extra_info['filesizes']:
             info = fn.split(':')
@@ -535,8 +537,12 @@
     sanity_required_utilities = (d.getVar('SANITY_REQUIRED_UTILITIES') or '').split()
     sanity_required_utilities.append(d.expand('${BUILD_PREFIX}gcc'))
     sanity_required_utilities.append(d.expand('${BUILD_PREFIX}g++'))
-    buildtools_installer = os.path.join(d.getVar('SDK_DEPLOY'), buildtools_fn)
-    filelist, _ = bb.process.run('%s -l' % buildtools_installer)
+    if buildtools_fn:
+        buildtools_installer = os.path.join(d.getVar('SDK_DEPLOY'), buildtools_fn)
+        filelist, _ = bb.process.run('%s -l' % buildtools_installer)
+    else:
+        buildtools_installer = None
+        filelist = ""
     localdata = bb.data.createCopy(d)
     localdata.setVar('SDKPATH', '.')
     sdkpathnative = localdata.getVar('SDKPATHNATIVE')
@@ -579,7 +585,9 @@
 	touch ${SDK_OUTPUT}/${SDKPATH}/.devtoolbase
 
 	# find latest buildtools-tarball and install it
-	install ${SDK_DEPLOY}/${SDK_BUILDTOOLS_INSTALLER} ${SDK_OUTPUT}/${SDKPATH}
+	if [ -n "${SDK_BUILDTOOLS_INSTALLER}" ]; then
+		install ${SDK_DEPLOY}/${SDK_BUILDTOOLS_INSTALLER} ${SDK_OUTPUT}/${SDKPATH}
+	fi
 
 	install -m 0644 ${COREBASE}/meta/files/ext-sdk-prepare.py ${SDK_OUTPUT}/${SDKPATH}
 }
@@ -629,16 +637,18 @@
 	printf "\nExtracting buildtools...\n"
 	cd $target_sdk_dir
 	env_setup_script="$target_sdk_dir/environment-setup-${REAL_MULTIMACH_TARGET_SYS}"
-	printf "buildtools\ny" | ./${SDK_BUILDTOOLS_INSTALLER} > buildtools.log || { printf 'ERROR: buildtools installation failed:\n' ; cat buildtools.log ; echo "printf 'ERROR: this SDK was not fully installed and needs reinstalling\n'" >> $env_setup_script ; exit 1 ; }
+        if [ -n "${SDK_BUILDTOOLS_INSTALLER}" ]; then
+		printf "buildtools\ny" | ./${SDK_BUILDTOOLS_INSTALLER} > buildtools.log || { printf 'ERROR: buildtools installation failed:\n' ; cat buildtools.log ; echo "printf 'ERROR: this SDK was not fully installed and needs reinstalling\n'" >> $env_setup_script ; exit 1 ; }
 
-	# Delete the buildtools tar file since it won't be used again
-	rm -f ./${SDK_BUILDTOOLS_INSTALLER}
-	# We don't need the log either since it succeeded
-	rm -f buildtools.log
+		# Delete the buildtools tar file since it won't be used again
+		rm -f ./${SDK_BUILDTOOLS_INSTALLER}
+		# We don't need the log either since it succeeded
+		rm -f buildtools.log
 
-	# Make sure when the user sets up the environment, they also get
-	# the buildtools-tarball tools in their path.
-	echo ". $target_sdk_dir/buildtools/environment-setup*" >> $env_setup_script
+		# Make sure when the user sets up the environment, they also get
+		# the buildtools-tarball tools in their path.
+		echo ". $target_sdk_dir/buildtools/environment-setup*" >> $env_setup_script
+	fi
 
 	# Allow bitbake environment setup to be ran as part of this sdk.
 	echo "export OE_SKIP_SDK_CHECK=1" >> $env_setup_script
@@ -654,7 +664,7 @@
 	# Warn if trying to use external bitbake and the ext SDK together
 	echo "(which bitbake > /dev/null 2>&1 && echo 'WARNING: attempting to use the extensible SDK in an environment set up to run bitbake - this may lead to unexpected results. Please source this script in a new shell session instead.') || true" >> $env_setup_script
 
-	if [ "$prepare_buildsystem" != "no" ]; then
+	if [ "$prepare_buildsystem" != "no" -a -n "${SDK_BUILDTOOLS_INSTALLER}" ]; then
 		printf "Preparing build system...\n"
 		# dash which is /bin/sh on Ubuntu will not preserve the
 		# current working directory when first ran, nor will it set $1 when
@@ -680,7 +690,10 @@
         bb.fatal('The extensible SDK can currently only be built for the same architecture as the machine being built on - SDK_ARCH is set to %s (likely via setting SDKMACHINE) which is different from the architecture of the build machine (%s). Unable to continue.' % (d.getVar('SDK_ARCH'), d.getVar('BUILD_ARCH')))
 
     d.setVar('SDK_INSTALL_TARGETS', get_sdk_install_targets(d))
-    buildtools_fn = get_current_buildtools(d)
+    if d.getVar('SDK_INCLUDE_BUILDTOOLS') == '1':
+        buildtools_fn = get_current_buildtools(d)
+    else:
+        buildtools_fn = None
     d.setVar('SDK_REQUIRED_UTILITIES', get_sdk_required_utilities(buildtools_fn, d))
     d.setVar('SDK_BUILDTOOLS_INSTALLER', buildtools_fn)
     d.setVar('SDKDEPLOYDIR', '${SDKEXTDEPLOYDIR}')
@@ -731,7 +744,7 @@
 do_populate_sdk_ext[dirs] = "${@d.getVarFlag('do_populate_sdk', 'dirs', False)}"
 
 do_populate_sdk_ext[depends] = "${@d.getVarFlag('do_populate_sdk', 'depends', False)} \
-                                buildtools-tarball:do_populate_sdk \
+                                ${@'buildtools-tarball:do_populate_sdk' if d.getVar('SDK_INCLUDE_BUILDTOOLS') == '1' else ''} \
                                 ${@'meta-world-pkgdata:do_collect_packagedata' if d.getVar('SDK_INCLUDE_PKGDATA') == '1' else ''} \
                                 ${@'meta-extsdk-toolchain:do_locked_sigs' if d.getVar('SDK_INCLUDE_TOOLCHAIN') == '1' else ''}"
 
diff --git a/poky/meta/classes/rm_work.bbclass b/poky/meta/classes/rm_work.bbclass
index a6bd3f7..01c2ab1 100644
--- a/poky/meta/classes/rm_work.bbclass
+++ b/poky/meta/classes/rm_work.bbclass
@@ -47,30 +47,26 @@
     cd `dirname ${STAMP}`
     for i in `basename ${STAMP}`*
     do
-        # By default we'll delete the stamp, unless $i is changed by the inner loop
-        # (i=dummy does this)
-
         case $i in
         *sigdata*|*sigbasedata*)
             # Save/skip anything that looks like a signature data file.
-            i=dummy
             ;;
-        *do_image_complete_setscene*)
-            # Ensure we don't 'stack' setscene extensions to this stamp with the section below
-            i=dummy
+        *do_image_complete_setscene*|*do_image_qa_setscene*)
+            # Ensure we don't 'stack' setscene extensions to these stamps with the sections below
             ;;
         *do_image_complete*)
             # Promote do_image_complete stamps to setscene versions (ahead of *do_image* below)
             mv $i `echo $i | sed -e "s#do_image_complete#do_image_complete_setscene#"`
-            i=dummy
+            ;;
+        *do_image_qa*)
+            # Promote do_image_qa stamps to setscene versions (ahead of *do_image* below)
+            mv $i `echo $i | sed -e "s#do_image_qa#do_image_qa_setscene#"`
             ;;
         *do_package_write*|*do_rootfs*|*do_image*|*do_bootimg*|*do_write_qemuboot_conf*|*do_build*)
-            i=dummy
             ;;
         *do_addto_recipe_sysroot*)
             # Preserve recipe-sysroot-native if do_addto_recipe_sysroot has been used
             excludes="$excludes recipe-sysroot-native"
-            i=dummy
             ;;
         *do_package|*do_package.*|*do_package_setscene.*)
             # We remove do_package entirely, including any
@@ -78,30 +74,24 @@
             # such as 'packages' and 'packages-split' and these can be large. No end
             # of chain tasks depend directly on do_package anymore.
             rm -f $i;
-            i=dummy
             ;;
         *_setscene*)
             # Skip stamps which are already setscene versions
-            i=dummy
             ;;
+        *)
+            # For everything else: if suitable, promote the stamp to a setscene
+            # version, otherwise remove it
+            for j in ${SSTATETASKS} do_shared_workdir
+            do
+                case $i in
+                *$j|*$j.*)
+                    mv $i `echo $i | sed -e "s#${j}#${j}_setscene#"`
+                    break
+                    ;;
+                esac
+            done
+            rm -f $i
         esac
-
-        for j in ${SSTATETASKS} do_shared_workdir
-        do
-            case $i in
-            dummy)
-                break
-                ;;
-            *$j|*$j.*)
-                # Promote the stamp to a setscene version
-                mv $i `echo $i | sed -e "s#${j}#${j}_setscene#"`
-                i=dummy
-                break
-                ;;
-            esac
-        done
-
-        rm -f $i
     done
 
     cd ${WORKDIR}
diff --git a/poky/meta/classes/sstate.bbclass b/poky/meta/classes/sstate.bbclass
index b47b9c2..64808f8 100644
--- a/poky/meta/classes/sstate.bbclass
+++ b/poky/meta/classes/sstate.bbclass
@@ -818,7 +818,7 @@
 
 BB_HASHCHECK_FUNCTION = "sstate_checkhashes"
 
-def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, **kwargs):
+def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True, **kwargs):
     found = set()
     missed = set()
     extension = ".tgz"
@@ -951,16 +951,17 @@
             evdata['found'].append((bb.runqueue.fn_from_tid(tid), bb.runqueue.taskname_from_tid(tid), gethash(tid), sstatefile ) )
         bb.event.fire(bb.event.MetadataEvent("MissedSstate", evdata), d)
 
-    # Print some summary statistics about the current task completion and how much sstate
-    # reuse there was. Avoid divide by zero errors.
-    total = len(sq_data['hash'])
-    complete = 0
-    if currentcount:
-        complete = (len(found) + currentcount) / (total + currentcount) * 100
-    match = 0
-    if total:
-        match = len(found) / total * 100
-    bb.plain("Sstate summary: Wanted %d Found %d Missed %d Current %d (%d%% match, %d%% complete)" % (total, len(found), len(missed), currentcount, match, complete))
+    if summary:
+        # Print some summary statistics about the current task completion and how much sstate
+        # reuse there was. Avoid divide by zero errors.
+        total = len(sq_data['hash'])
+        complete = 0
+        if currentcount:
+            complete = (len(found) + currentcount) / (total + currentcount) * 100
+        match = 0
+        if total:
+            match = len(found) / total * 100
+        bb.plain("Sstate summary: Wanted %d Found %d Missed %d Current %d (%d%% match, %d%% complete)" % (total, len(found), len(missed), currentcount, match, complete))
 
     if hasattr(bb.parse.siggen, "checkhashes"):
         bb.parse.siggen.checkhashes(sq_data, missed, found, d)
diff --git a/poky/meta/classes/staging.bbclass b/poky/meta/classes/staging.bbclass
index 55a9b52..cca0b7e 100644
--- a/poky/meta/classes/staging.bbclass
+++ b/poky/meta/classes/staging.bbclass
@@ -449,6 +449,28 @@
     msg_exists = []
     msg_adding = []
 
+    # Handle all removals first since files may move between recipes
+    for dep in configuredeps:
+        c = setscenedeps[dep][0]
+        if c not in installed:
+            continue
+        taskhash = setscenedeps[dep][5]
+        taskmanifest = depdir + "/" + c + "." + taskhash
+
+        if os.path.exists(depdir + "/" + c):
+            lnk = os.readlink(depdir + "/" + c)
+            if lnk == c + "." + taskhash and os.path.exists(depdir + "/" + c + ".complete"):
+                continue
+            else:
+                bb.note("%s exists in sysroot, but is stale (%s vs. %s), removing." % (c, lnk, c + "." + taskhash))
+                sstate_clean_manifest(depdir + "/" + lnk, d, workdir)
+                os.unlink(depdir + "/" + c)
+                if os.path.lexists(depdir + "/" + c + ".complete"):
+                    os.unlink(depdir + "/" + c + ".complete")
+        elif os.path.lexists(depdir + "/" + c):
+            os.unlink(depdir + "/" + c)
+
+    # Now handle installs
     for dep in configuredeps:
         c = setscenedeps[dep][0]
         if c not in installed:
@@ -461,14 +483,6 @@
             if lnk == c + "." + taskhash and os.path.exists(depdir + "/" + c + ".complete"):
                 msg_exists.append(c)
                 continue
-            else:
-                bb.note("%s exists in sysroot, but is stale (%s vs. %s), removing." % (c, lnk, c + "." + taskhash))
-                sstate_clean_manifest(depdir + "/" + lnk, d, workdir)
-                os.unlink(depdir + "/" + c)
-                if os.path.lexists(depdir + "/" + c + ".complete"):
-                    os.unlink(depdir + "/" + c + ".complete")
-        elif os.path.lexists(depdir + "/" + c):
-            os.unlink(depdir + "/" + c)
 
         msg_adding.append(c)