Skip to content

Commit

Permalink
Allow packages to fulfill their own dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
ddevault committed Oct 14, 2014
1 parent c934e9b commit 4e8f9b4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 4e8f9b4

Please sign in to comment.