From 4e8f9b419f318836dbaaabeb4226234e2dbf326d Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Mon, 13 Oct 2014 21:04:02 -0600 Subject: [PATCH] Allow packages to fulfill their own dependency --- project.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/project.py b/project.py index 585112c..b3ed3a5 100644 --- a/project.py +++ b/project.py @@ -13,6 +13,9 @@ def __init__(self, root=None): def __del__(self): pass + def full_name(self): + return self.get_config("repo") + "/" + self.get_config("name") + def open(self, path, mode="r"): return open(os.path.join(self.root, path), mode=mode) # TODO: This leaks file descriptors @@ -87,6 +90,8 @@ def install(self, packages, site_only, init=False): for package in packages: deps.append(package) self.set_config("dependencies", " ".join(deps)) + # Remove the package we're working on, since it'll fulfill the dependency implicitly + packages = [p for p in packages if p != self.full_name()] # Install packages pkgroot = os.path.join(self.root, ".knightos", "pkgroot") for i, f in enumerate(files):