Skip to content

Commit cd92976

Browse files
committed
fix(oma-pm): fix upgrade use APT::Solver=3.0
1 parent b868067 commit cd92976

File tree

5 files changed

+15
-4
lines changed

5 files changed

+15
-4
lines changed

Cargo.lock

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

oma-pm/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ license = "GPL-3.0-or-later"
88
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
99

1010
[dependencies]
11-
oma-apt = "0.12"
11+
oma-apt = { git = "https://github.com/aosc-dev/oma-apt.git", rev = "b2171c27224628f670c3a7484ac678492a6df6c8" }
1212
thiserror = "2"
1313
chrono = { version = "0.4", features = ["unstable-locales"] }
1414
glob-match = "0.2"

oma-refresh/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ oma-topics = { version = "^0.25.0", path = "../oma-topics", optional = true, def
1919
tracing ="0.1"
2020
oma-repo-verify = { version = "^0.9.0", path = "../oma-repo-verify", default-features = false }
2121
ahash = "0.8.11"
22-
oma-apt = { version = "0.12", optional = true }
22+
oma-apt = { git = "https://github.com/aosc-dev/oma-apt.git", rev = "b2171c27224628f670c3a7484ac678492a6df6c8", optional = true}
2323
aho-corasick = "1.1.3"
2424
# https://github.com/bytecodealliance/rustix/pull/1077
2525
# rustix = { version = "0.38", features = ["fs"] }

src/subcommand/upgrade.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ impl CliExecuter for Upgrade {
241241
.maybe_auth_config(Some(&auth_config))
242242
.fix_dpkg_status(!no_fix_dpkg_status)
243243
.download_only(download_only)
244+
.is_upgrade(true)
244245
.build()
245246
.run()?;
246247

src/subcommand/utils.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,8 @@ pub(crate) struct CommitChanges<'a> {
321321
topics_disabled: Vec<String>,
322322
#[builder(default)]
323323
download_only: bool,
324+
#[builder(default)]
325+
is_upgrade: bool,
324326
}
325327

326328
impl CommitChanges<'_> {
@@ -344,6 +346,7 @@ impl CommitChanges<'_> {
344346
topics_enabled,
345347
topics_disabled,
346348
download_only,
349+
is_upgrade,
347350
} = self;
348351

349352
fix_broken(
@@ -353,6 +356,7 @@ impl CommitChanges<'_> {
353356
fix_dpkg_status,
354357
remove_config,
355358
autoremove,
359+
is_upgrade,
356360
)?;
357361

358362
let op = apt.summary(
@@ -575,10 +579,17 @@ pub fn fix_broken(
575579
fix_dpkg_status: bool,
576580
remove_config: bool,
577581
autoremove: bool,
582+
is_upgrade: bool,
578583
) -> Result<(), OutputError> {
579584
let pb = create_progress_spinner(no_progress, fl!("resolving-dependencies"));
580585

581586
let res = Ok(()).and_then(|_| -> Result<(), OmaAptError> {
587+
let solver = apt.config.find("APT::Solver", "internal");
588+
589+
if solver == "3.0" && is_upgrade {
590+
return Ok(());
591+
}
592+
582593
if autoremove {
583594
apt.autoremove(remove_config)?;
584595
}

0 commit comments

Comments
 (0)