Allow absolute paths (relative to the package root).

This commit is contained in:
Jeffrey Townsend
2017-02-15 18:36:53 +00:00
parent 0b37400b0c
commit 5b46c04e24

View File

@@ -815,9 +815,14 @@ class OnlPackageRepo(object):
force: Passed to extract() as the force option."""
edir = self.extract(pkg, force=force)
for root, dirs, files in os.walk(edir):
if os.path.basename(root) == dirname and root != edir:
return root
if os.path.isabs(dirname):
apath = os.path.join(edir, dirname[1:]);
if os.path.isdir(apath):
return apath
else:
for root, dirs, files in os.walk(edir):
if os.path.basename(root) == dirname and root != edir:
return root
if ex:
raise OnlPackageMissingDirError(pkg, dirname)