def update_dependency(self, tile, depinfo, destdir=None):
        if destdir is None:
            destdir = os.path.join(tile.folder, 'build', 'deps', depinfo['unique_id'])
        has_version = False
        had_version = False
        if os.path.exists(destdir):
            has_version = True
            had_version = True
        for priority, rule in self.rules:
            if not self._check_rule(rule, depinfo):
                continue
            resolver = self._find_resolver(rule)
            if has_version:
                deptile = IOTile(destdir)
                depstatus = self._check_dep(depinfo, deptile, resolver)
                if depstatus is False:
                    shutil.rmtree(destdir)
                    has_version = False
                else:
                    continue
            result = resolver.resolve(depinfo, destdir)
            if not result['found'] and result.get('stop', False):
                return 'not found'
            if not result['found']:
                continue
            settings = {
                'resolver': resolver.__class__.__name__,
                'factory_args': rule[2]
            }
            if 'settings' in result:
                settings['settings'] = result['settings']
            self._save_depsettings(destdir, settings)
            if had_version:
                return "updated"
            return "installed"
        if has_version:
            return "already installed"
        return "not found"