diff options
authorMykyta Holubakha <hilobakho@gmail.com>2017-06-09 03:28:34 +0300
committerMykyta Holubakha <hilobakho@gmail.com>2017-06-09 03:28:34 +0300
commit7bbe65901f12b2b63e4c690e0ba6ad66ee833e7f (patch)
tree88689b2dd482992ba04818201afcf61cc6aec272 /pomu/package.py
parentActually return Result.Ok when a package is found (diff)
Numerous fixes all over the tree
Added dispatcher and repository package (un)installation tests
Diffstat (limited to 'pomu/package.py')
1 files changed, 4 insertions, 4 deletions
diff --git a/pomu/package.py b/pomu/package.py
index 24fdf00..470d76b 100644
--- a/pomu/package.py
+++ b/pomu/package.py
@@ -4,7 +4,7 @@ A package can be installed into a repository.
A package is supposed to be created by a package source from a set of files.
-from os import path
+from os import path, walk
from pomu.util.fs import strip_prefix
@@ -36,13 +36,13 @@ class Package():
def strip_root(self, d_path):
# the path should be either relative, or a child of root
if d_path.startswith('/'):
- if path.commonprefix(d_path, root) != root:
+ if path.commonprefix(d_path, self.root) != self.root:
raise ValueError('Path should be a subdirectory of root')
- return strip_prefix(strip_prefix(d_path, root), '/')
+ return strip_prefix(strip_prefix(d_path, self.root), '/')
return d_path
def read_path(self, d_path):
- for wd, dirs, files in os.walk(d_path):
+ for wd, dirs, files in walk(d_path):
wd = self.strip_root(wd)
self.files.extend([(wd, f) for f in files])