コード例 #1
0
ファイル: restore.py プロジェクト: michealtianlan/tklbam
    def _apply_overlay(src, dst, olist):
        tmp = TempFile("fsdelta-olist-")
        for fpath in olist:
            print >> tmp, fpath.lstrip('/')
        tmp.close()

        apply_overlay(src, dst, tmp.path)
コード例 #2
0
    def _get_dirindex(path_dirindex_conf, path_rootfs):
        paths = dirindex.read_paths(file(path_dirindex_conf))
        paths = [re.sub(r'^(-?)', '\\1' + path_rootfs, path) for path in paths]

        tmp = TempFile()
        dirindex.create(tmp.path, paths)

        filtered = [
            re.sub(r'^' + path_rootfs, '', line)
            for line in file(tmp.path).readlines()
        ]
        return "".join(filtered)