def METHOD_NAME(self, packages, name, *, update=True):
    if name not in packages:
        raise NameError("package not found: " + name)
    if not update and name in self.packages:
        return
    self.packages[name] = packages[name]
    for dep in packages[name].deps:
        self.METHOD_NAME(packages, dep, update=False)