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)
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
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
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