def output_path(self, path_name):
        """ Modify a path so it fits expectations.
        
            Avoid returning relative paths that start with '../' and possibly
            return relative paths when output and cache directories match.
        """        
        # make sure it is a valid posix format
        path = to_posix(path_name)
        
        assert (path == path_name), "path_name passed to output_path must be in posix format"
        
        if posixpath.isabs(path):
            if self.output == self.cache:
                # worth seeing if an absolute path can be avoided
                path = posixpath.relpath(path, self.output)

            else:
                return posixpath.realpath(path)
    
        if path.startswith('../'):
            joined = posixpath.join(self.output, path)
            return posixpath.realpath(joined)
    
        return path