I'm trying to establish a transaction step by step and I keep getting a WrongArgs error when using the trans_add_pkg passing a &Package. Here's an example:
use alpm::{Alpm, Error, SigLevel, TransFlag};
fn main() -> Result<(), Error> {
let alpm = Alpm::new("/", "/var/lib/pacman")?;
alpm.register_syncdb("core", SigLevel::USE_DEFAULT)?;
alpm.register_syncdb("extra", SigLevel::USE_DEFAULT)?;
alpm.trans_init(TransFlag::NO_LOCK)?;
let pkg = alpm.localdb().pkg("tevent")?;
alpm.trans_add_pkg(pkg)?;
let pkgs = alpm.trans_add();
for pkg in pkgs {
println!("{}", pkg.name());
}
Ok(())
}
If, instead of adding a singular package, I call the sync_sysupgrade, it works fine and all upgradable packages are successfully added.
Am I doing something wrong? A WrongArgs in this case really gives me no clue of what it could be.
Thanks.
I'm trying to establish a transaction step by step and I keep getting a
WrongArgserror when using thetrans_add_pkgpassing a&Package. Here's an example:If, instead of adding a singular package, I call the
sync_sysupgrade, it works fine and all upgradable packages are successfully added.Am I doing something wrong? A
WrongArgsin this case really gives me no clue of what it could be.Thanks.