Exemplo n.º 1
0
 def _backup_file(self, file, patch):
     """ Creates a backup of file """
     dest_dir = self.quilt_pc + patch.get_name()
     file_dir = file.get_directory()
     if file_dir:
         #TODO get relative path
         dest_dir = dest_dir + file_dir
     backup = Backup()
     backup.backup_file(file, dest_dir, copy_empty=True)
Exemplo n.º 2
0
    def _apply_patch_temporary(self, tmpdir, file, patch):
        backup = Backup()
        backup_file = backup.backup_file(file, tmpdir)
        patch_file = self.quilt_patches + File(patch.get_name())

        if patch_file.exists() and not patch_file.is_empty():
            patch.run(self.cwd, self.quilt_patches.get_absdir(), work_dir=tmpdir,
                      no_backup_if_mismatch=True, remove_empty_files=True,
                      force=True, quiet=True)
        return backup_file
Exemplo n.º 3
0
    def _apply_patch_temporary(self, tmpdir, file, patch):
        backup = Backup()
        backup_file = backup.backup_file(file, tmpdir)
        patch_file = self.quilt_patches + File(patch.get_name())

        if patch_file.exists() and not patch_file.is_empty():
            try:
                patch.run(self.cwd, self.quilt_patches.get_absdir(),
                          work_dir=tmpdir, no_backup_if_mismatch=True,
                          remove_empty_files=True, force=True,
                          quiet=True, suppress_output=True,
                )
            except SubprocessError:
                pass  # Expected to fail if there are other files in patch
        return backup_file
Exemplo n.º 4
0
    def _apply_patch_temporary(self, tmpdir, file, patch):
        backup = Backup()
        backup_file = backup.backup_file(file, tmpdir)
        patch_file = self.quilt_patches + File(patch.get_name())

        if patch_file.exists() and not patch_file.is_empty():
            try:
                patch.run(
                    self.cwd,
                    self.quilt_patches.get_absdir(),
                    work_dir=tmpdir,
                    no_backup_if_mismatch=True,
                    remove_empty_files=True,
                    force=True,
                    quiet=True,
                    suppress_output=True,
                )
            except SubprocessError:
                pass  # Expected to fail if there are other files in patch
        return backup_file