--- a/src/modules/misc.py Mon Oct 18 11:39:02 2010 -0700
+++ b/src/modules/misc.py Tue Oct 19 12:55:46 2010 -0700
@@ -834,3 +834,11 @@
PKG_DIR_MODE = (stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH |
stat.S_IXOTH)
PKG_RO_FILE_MODE = stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH
+
+def relpath(path, start="."):
+ """Version of relpath to workaround python bug:
+ http://bugs.python.org/issue5117
+ """
+ if path and start and start == "/" and path[0] == "/":
+ return path.lstrip("/")
+ return os.path.relpath(path, start=start)