def __init__(self, repo, dconf, tmp_root, pkg5_test_proto=""): self.repo = repo self.cfg = dconf self.tmp_root = tmp_root # we hardcode these for the depot. self.content_root = "%s/usr/share/lib/pkg" % pkg5_test_proto self.web_root = "%s/usr/share/lib/pkg/web/" % pkg5_test_proto # ensure we have the right values in our cfg, needed when # creating DepotHTTP objects. self.cfg.set_property("pkg", "content_root", self.content_root) self.cfg.set_property("pkg", "pkg_root", self.repo.root) face.init(self)
def __init__(self, repo, dconf, writable_root, pkg5_test_proto=""): self.repo = repo self.cfg = dconf if writable_root: self.tmp_root = writable_root else: self.tmp_root = tempfile.mkdtemp(prefix="pkg-depot.") # try to clean up the temporary area on exit atexit.register(shutil.rmtree, self.tmp_root, ignore_errors=True) # we hardcode these for the depot. self.content_root = "{0}/usr/share/lib/pkg".format(pkg5_test_proto) self.web_root = "{0}/usr/share/lib/pkg/web/".format(pkg5_test_proto) # ensure we have the right values in our cfg, needed when # creating DepotHTTP objects. self.cfg.set_property("pkg", "content_root", self.content_root) self.cfg.set_property("pkg", "pkg_root", self.repo.root) self.cfg.set_property("pkg", "writable_root", self.tmp_root) face.init(self)