From 12665be344db129a24942f39ac78cb517e0ef062 Mon Sep 17 00:00:00 2001 From: Guillaume Benoit Date: Tue, 4 Aug 2026 20:24:03 +0200 Subject: [PATCH] [PATCH] fix: correct the list item types in transaction error data --- alpm/src/conflict.rs | 4 ++-- alpm/src/trans.rs | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/alpm/src/conflict.rs b/alpm/src/conflict.rs index 9ef3f84..5b497bf 100644 --- a/alpm/src/conflict.rs +++ b/alpm/src/conflict.rs @@ -188,9 +188,9 @@ impl FileConflict { unsafe { from_cstr((*self.as_ptr()).file) } } - // TODO: target is "" when empty. should be null instead. + // TODO: ctarget is "" when empty. should be null instead. pub fn conflicting_target(&self) -> Option<&str> { - let s = unsafe { from_cstr((*self.as_ptr()).target) }; + let s = unsafe { from_cstr((*self.as_ptr()).ctarget) }; if s.is_empty() { None } else { Some(s) } } diff --git a/alpm/src/trans.rs b/alpm/src/trans.rs index 218839f..4d8e6b6 100644 --- a/alpm/src/trans.rs +++ b/alpm/src/trans.rs @@ -1,6 +1,6 @@ use crate::{ - Alpm, AlpmList, AlpmListMut, Conflict, DepMissing, DependMissing, Error, OwnedConflict, - OwnedFileConflict, Package, Result, + Alpm, AlpmList, AlpmListMut, Conflict, DepMissing, DependMissing, Error, FileConflict, + OwnedConflict, OwnedFileConflict, Package, Result, }; use alpm_sys::_alpm_transflag_t::*; @@ -37,8 +37,8 @@ bitflags! { } #[derive(Debug)] -pub enum PrepareData<'a, 'h> { - PkgInvalidArch(AlpmList<'a, &'h Package>), +pub enum PrepareData<'a> { + PkgInvalidArch(AlpmList<'a, &'a str>), UnsatisfiedDeps(AlpmList<'a, &'a DepMissing>), ConflictingDeps(AlpmList<'a, &'a Conflict>), } @@ -94,7 +94,7 @@ impl<'h> PrepareError<'h> { self.error } - pub fn data<'a>(&'a self) -> Option> { + pub fn data<'a>(&'a self) -> Option> { match self.error { Error::PkgInvalidArch => unsafe { let list = AlpmList::from_ptr(self.data); @@ -115,7 +115,7 @@ impl<'h> PrepareError<'h> { #[derive(Debug)] pub enum CommitData<'a> { - FileConflict(AlpmList<'a, &'a Conflict>), + FileConflict(AlpmList<'a, &'a FileConflict>), PkgInvalid(AlpmList<'a, &'a str>), }