def find_sync_package(pkgname, syncdbs):
    """Finds a package name of the form 'repo/pkgname' or 'pkgname' in a list of DBs"""
    if '/' in pkgname:
        repo, pkgname = pkgname.split('/', 1)
        db = syncdbs.get(repo)
        if db is None:
            return False, "repository '%s' does not exist" % repo
        pkg = db.get_pkg(pkgname)
        if pkg is None:
            return False, "package '%s' was not found in repository '%s'" % (
                pkgname, repo)
        return True, pkg
    else:
        for db in syncdbs.values():
            pkg = db.get_pkg(pkgname)
            if pkg is not None:
                return True, pkg
        return False, "package '%s' was not found" % pkgname
