示例#1
0
 def unpack(self, toolchain, out_of_tree=True):
     if out_of_tree:
         parent_path = toolchain.src_path
     else:
         parent_path = toolchain.build_path
     path = untar(self.download(toolchain), parent_path, self.base)
     if self.patches is not None:
         push_all(toolchain, path, self.patches)
     return path
示例#2
0
 def unpack(self, toolchain, out_of_tree=True):
     if out_of_tree:
         parent_path = toolchain.src_path
     else:
         parent_path = toolchain.build_path
     path = untar(self.download(toolchain), parent_path, self.base)
     if self.patches is not None:
         push_all(toolchain, path, self.patches)
     return path
示例#3
0
文件: project.py 项目: hjr/XCSoar-1
    def unpack(self, toolchain, out_of_tree=True):
        if out_of_tree:
            parent_path = toolchain.src_path
        else:
            parent_path = toolchain.build_path

        # protect concurrent builds by holding an exclusive lock
        os.makedirs(parent_path, exist_ok=True)
        self.__unpack_lockfile = open(
            os.path.join(parent_path, 'lock.' + self.base), 'w')
        fcntl.flock(self.__unpack_lockfile.fileno(), fcntl.LOCK_EX)

        path = untar(self.download(toolchain),
                     parent_path,
                     self.base,
                     lazy=out_of_tree and self.patches is None)
        if self.patches is not None:
            push_all(toolchain, path, self.patches)
        return path
示例#4
0
文件: project.py 项目: cataldor/MPD
    def unpack(self, toolchain, out_of_tree=True):
        if out_of_tree:
            parent_path = toolchain.src_path
        else:
            parent_path = toolchain.build_path
        path = untar(self.download(toolchain), parent_path, self.base)

        if self.patches is not None:
            push_all(toolchain, path, self.patches)

        if self.edits is not None:
            for filename, function in self.edits.items():
                with open(os.path.join(path, filename), 'r+t') as f:
                    old_data = f.read()
                    new_data = function(old_data)
                    f.seek(0)
                    f.truncate(0)
                    f.write(new_data)

        return path
示例#5
0
    def unpack(self, toolchain, out_of_tree=True):
        if out_of_tree:
            parent_path = toolchain.src_path
        else:
            parent_path = toolchain.build_path
        path = untar(self.download(toolchain), parent_path, self.base)

        if self.patches is not None:
            push_all(toolchain, path, self.patches)

        if self.edits is not None:
            for filename, function in self.edits.items():
                with open(os.path.join(path, filename), 'r+t') as f:
                    old_data = f.read()
                    new_data = function(old_data)
                    f.seek(0)
                    f.truncate(0)
                    f.write(new_data)

        return path