src/modules/misc.py
changeset 2112 5e0694e53b38
parent 2097 068cc63b4d6e
child 2126 7f6719cd083b
child 2359 3949372f7b93
child 2522 8cb391c2269d
equal deleted inserted replaced
2111:c359884a9e81 2112:5e0694e53b38
   832 
   832 
   833 PKG_FILE_MODE = stat.S_IWUSR | stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH
   833 PKG_FILE_MODE = stat.S_IWUSR | stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH
   834 PKG_DIR_MODE = (stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH |
   834 PKG_DIR_MODE = (stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH |
   835     stat.S_IXOTH)
   835     stat.S_IXOTH)
   836 PKG_RO_FILE_MODE = stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH
   836 PKG_RO_FILE_MODE = stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH
       
   837 
       
   838 def relpath(path, start="."):
       
   839         """Version of relpath to workaround python bug:
       
   840             http://bugs.python.org/issue5117
       
   841         """
       
   842         if path and start and start == "/" and path[0] == "/":
       
   843                 return path.lstrip("/")
       
   844         return os.path.relpath(path, start=start)