Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies and resolve recovery partition full error #315

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
829 changes: 416 additions & 413 deletions Cargo.lock

Large diffs are not rendered by default.

55 changes: 28 additions & 27 deletions daemon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,52 +6,52 @@ license = "GPL-3.0"
edition = "2018"

[dependencies]
anyhow = "1.0.57"
anyhow = "1.0.65"
as-result = "0.2.1"
async-shutdown = "0.1.2"
atomic = "0.5.1"
atty = "0.2.14"
bitflags = "1.3.2"
cascade = "1.0.0"
chrono = "0.4.19"
clap = "3.2.3"
const_format = "0.2.24"
dbus = "0.9.5"
dbus-crossroads = "0.5.0"
digest = "0.10.3"
cascade = "1.0.1"
chrono = "0.4.22"
clap = "4.0.9"
const_format = "0.2.26"
dbus = "0.9.6"
dbus-crossroads = "0.5.1"
digest = "0.10.5"
enclose = "1.1.8"
envfile = "0.2.1"
exec = "0.3.1"
fern = "0.6.1"
fomat-macros = "0.3.1"
futures = "0.3.21"
futures-util = "0.3.21"
futures = "0.3.24"
futures-util = "0.3.24"
hex = "0.4.3"
human-sort = "0.2.2"
libc = "0.2.126"
libc = "0.2.134"
log = "0.4.17"
logind-dbus = "0.1.1"
md-5 = "0.10.1"
nix = "0.24.1"
md-5 = "0.10.5"
nix = "0.25.0"
num-derive = "0.3.3"
num-traits = "0.2.15"
os_str_bytes = "6.1.0"
os_str_bytes = "6.3.0"
os-release = "0.1.0"
proc-mounts = "0.3.0"
procfs = "0.12.0"
pwd = "1.3.1"
procfs = "0.14.1"
pwd = "1.4.0"
rand = "0.8.5"
regex = "1.5.6"
serde = "1.0.137"
serde_derive = "1.0.137"
serde_json = "1.0.81"
sha2 = "0.10.2"
regex = "1.6.0"
serde = "1.0.145"
serde_derive = "1.0.145"
serde_json = "1.0.85"
sha2 = "0.10.6"
shrinkwraprs = "0.3.0"
sys-mount = "1.5.1"
systemd-boot-conf = "0.2.2"
tempfile = "3.3.0"
thiserror = "1.0.31"
tokio-stream = "0.1.9"
thiserror = "1.0.37"
tokio-stream = "0.1.10"
twoway = "0.2.2"
ubuntu-version = "0.2.5"
users = "0.11.0"
Expand All @@ -60,24 +60,25 @@ whitespace-conf = "1.0.0"
yansi = "0.5.1"
isahc = "1.7.2"
mimalloc = "0.1.29"
flume = "0.10.13"
flume = "0.10.14"

[dependencies.apt-cmd]
git = "https://github.com/pop-os/apt-cmd"

[dependencies.async-fetcher]
git = "https://github.com/pop-os/async-fetcher"
features = ["isahc"]

[dependencies.sysfs-class]
git = "https://github.com/pop-os/sysfs-class"

[dependencies.notify-rust]
version = "4.5.8"
version = "4.5.10"
default-features = false
features = ["dbus"]

[dependencies.tokio]
version = "1.19.2"
version = "1.21.2"
features = ["full"]

[patch.crates-io]
Expand All @@ -87,4 +88,4 @@ sysfs-class = { git = "https://github.com/pop-os/sysfs-class" }
testing = []

[dev-dependencies]
test-case = "2.1.0"
test-case = "2.2.2"
18 changes: 11 additions & 7 deletions daemon/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,13 @@ impl Client {
Some(("upgrade", matches)) => {
match matches.subcommand() {
Some(("from-release", matches)) => {
let version = matches.value_of("VERSION").unwrap_or("");
let arch = matches.value_of("ARCH").unwrap_or("");
let flags = if matches.is_present("next") {
let version = matches.get_one::<String>("VERSION");
let version = version.map(String::as_str).unwrap_or_default();

let arch = matches.get_one::<String>("ARCH");
let arch = arch.map(String::as_str).unwrap_or_default();

let flags = if matches.get_flag("next") {
RecoveryReleaseFlags::NEXT
} else {
RecoveryReleaseFlags::empty()
Expand All @@ -67,9 +71,9 @@ impl Client {
self.recovery_upgrade_release(version, arch, flags)?;
}
Some(("from-file", matches)) => {
let path = matches.value_of("PATH").expect("missing reqired PATH argument");
let path = matches.get_one::<String>("PATH").expect("missing reqired PATH argument");

let _ = self.recovery_upgrade_file(path)?;
let _ = self.recovery_upgrade_file(&*path)?;
}
_ => unreachable!(),
}
Expand Down Expand Up @@ -124,7 +128,7 @@ impl Client {
// Update the current system, without performing a release upgrade
Some(("update", matches)) => {
let updates =
self.fetch_updates(Vec::new(), matches.is_present("download-only"))?;
self.fetch_updates(Vec::new(), matches.get_flag("download-only"))?;

let client::Fetched { updates_available, completed, total } = updates;

Expand All @@ -139,7 +143,7 @@ impl Client {
Some(("upgrade", matches)) => {
let (method, matches) = (UpgradeMethod::Offline, matches);
let forcing =
matches.is_present("force-next") || pop_upgrade::development_releases_enabled();
matches.get_flag("force-next") || pop_upgrade::development_releases_enabled();
let (current, next, available, _is_lts) = self.release_check(forcing)?;

if atty::is(atty::Stream::Stdout) {
Expand Down
66 changes: 33 additions & 33 deletions daemon/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub mod error {
}
}

use clap::{App, AppSettings, Arg, ArgMatches, SubCommand};
use clap::{Arg, ArgMatches, Command, ArgAction};
use std::{path::Path, process::exit, time::Duration};

use self::error::InitError;
Expand All @@ -77,52 +77,50 @@ async fn main() {

let _ = setup_logging(::log::LevelFilter::Debug);

let clap = App::new("pop-upgrade")
let clap = Command::new("pop-upgrade")
.about("Pop!_OS Upgrade Utility")
.global_setting(AppSettings::ColoredHelp)
.global_setting(AppSettings::UnifiedHelpMessage)
.setting(AppSettings::SubcommandRequiredElseHelp)
.subcommand_required(true)
// Recovery partition tools.
.subcommand(
SubCommand::with_name("cancel")
Command::new("cancel")
.about("cancels any process which is currently in progress"),
)
.subcommand(
SubCommand::with_name("daemon")
Command::new("daemon")
.about("launch a daemon for integration with control centers like GNOME's"),
)
.subcommand(
SubCommand::with_name("recovery")
Command::new("recovery")
.about("tools for managing the recovery partition")
.setting(AppSettings::SubcommandRequiredElseHelp)
.subcommand_required(true)
// Reboot into the recovery partition.
.subcommand(
SubCommand::with_name("default-boot")
Command::new("default-boot")
.about("set the recovery partition as the default boot target")
.arg(
Arg::with_name("reboot")
Arg::new("reboot")
.help("immediately reboot the system into the recovery partition")
.long("reboot"),
),
)
// Upgrade the recovery partition.
.subcommand(
SubCommand::with_name("upgrade")
Command::new("upgrade")
.about("upgrade the recovery partition")
.setting(AppSettings::SubcommandRequiredElseHelp)
.subcommand_required(true)
.subcommand(
SubCommand::with_name("from-release")
Command::new("from-release")
.about("update the recovery partition using a the Pop release API")
.arg(
Arg::with_name("VERSION")
Arg::new("VERSION")
.help("release version to fetch. IE: `18.04`"),
)
.arg(
Arg::with_name("ARCH")
Arg::new("ARCH")
.help("release arch to fetch: IE: `nvidia` or `intel`"),
)
.arg(
Arg::with_name("next")
Arg::new("next")
.help(
"fetches the next release's ISO if VERSION is not set",
)
Expand All @@ -131,61 +129,63 @@ async fn main() {
),
)
.subcommand(
SubCommand::with_name("check")
Command::new("check")
.about("check the status of the recovery partition"),
),
)
// Distribution release tools
.subcommand(
SubCommand::with_name("release")
Command::new("release")
.about("check for new distribution releases, or upgrade to a new release")
.setting(AppSettings::SubcommandRequiredElseHelp)
.subcommand_required(true)
.subcommand(
SubCommand::with_name("check").about("check for a new distribution release"),
Command::new("check").about("check for a new distribution release"),
)
.subcommand(
SubCommand::with_name("dismiss")
Command::new("dismiss")
.about("dismiss the current release notification (LTS only)"),
)
.subcommand(
SubCommand::with_name("update")
Command::new("update")
.about("fetch the latest updates for the current release")
.arg(
Arg::with_name("download-only")
Arg::new("download-only")
.help(
"instruct the daemon to fetch updates, without installing them",
)
.short('d')
.long("download-only"),
.long("download-only")
.action(ArgAction::SetTrue),
),
)
.subcommand(
SubCommand::with_name("refresh")
Command::new("refresh")
.about("refresh the existing OS (requires recovery partition)")
.subcommand(SubCommand::with_name("disable"))
.subcommand(SubCommand::with_name("enable")),
.subcommand(Command::new("disable"))
.subcommand(Command::new("enable")),
)
.subcommand(
SubCommand::with_name("repair")
Command::new("repair")
.about("search for issues in the system, and repair them"),
)
.subcommand(
SubCommand::with_name("upgrade")
Command::new("upgrade")
.about("update the system, and fetch the packages for the next release")
.arg(
Arg::with_name("force-next")
Arg::new("force-next")
.help(
"Attempt to upgrade to the next release, even if it is not \
released",
)
.short('f')
.long("force-next")
.global(true),
.global(true)
.action(ArgAction::SetTrue),
),
),
)
.subcommand(
SubCommand::with_name("status").about("get the status of the pop upgrade daemon"),
Command::new("status").about("get the status of the pop upgrade daemon"),
);

if main_(&clap.get_matches()).await.is_err() {
Expand Down
18 changes: 17 additions & 1 deletion daemon/src/recovery/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use async_shutdown::Shutdown;
use std::{
convert::TryFrom,
path::{Path, PathBuf},
sync::Arc,
sync::Arc, fs::{remove_file, read_dir, remove_dir_all},
};
use sys_mount::{Mount, MountFlags, Unmount, UnmountFlags};
use tokio::{process::Command, sync::mpsc::UnboundedSender};
Expand Down Expand Up @@ -217,6 +217,22 @@ async fn fetch_iso<P: AsRef<Path>>(
let casper_vmlinuz = recovery_path.join([&casper, "/vmlinuz.efi"].concat());
let recovery_str = recovery_path.to_str().unwrap();

// Remove any files that may left over from a previous installation
if let Ok(dir) = read_dir("/recovery") {
for entry in dir.filter_map(Result::ok) {
if let Ok(metadata) = entry.metadata() {
let path = entry.path();
if path != Path::new("/recovery/recovery.conf") {
if metadata.is_dir() {
let _res = remove_dir_all(path);
} else if metadata.is_file() {
let _res = remove_file(path);
}
}
}
}
}

let mut cmd = cascade! {
Command::new("rsync");
..args(&[&disk, &dists, &pool]);
Expand Down
2 changes: 1 addition & 1 deletion daemon/src/release/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ fn terminate_background_applications() {
}
};

for proc in processes {
for proc in processes.into_iter().filter_map(Result::ok) {
if let Ok(exe_path) = proc.exe() {
if let Some(exe) = exe_path.file_name() {
if let Some(mut exe) = exe.to_str() {
Expand Down
22 changes: 11 additions & 11 deletions gtk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,32 @@ edition = "2018"
[dependencies]
apt-cmd = { git = "https://github.com/pop-os/apt-cmd/" }
better-panic = "0.3.0"
cascade = "1.0.0"
chrono = "0.4.19"
clap = "3.2.3"
cascade = "1.0.1"
chrono = "0.4.22"
clap = "4.0.9"
derive_more = "0.99.17"
derive-new = "0.5.9"
enclose = "1.1.8"
fern = "0.6.1"
flume = "0.10.13"
flume = "0.10.14"
fomat-macros = "0.3.1"
gio = "0.15.11"
glib = "0.15.11"
gio = "0.15.12"
glib = "0.15.12"
gtk = { version = "0.15.5", features = [ "v3_22" ] }
i18n-embed = { version = "0.13.4", features = ["fluent-system", "desktop-requester"] }
i18n-embed-fl = "0.6.4"
log = "0.4.17"
notify-rust = { version = "4.5.8", default-features = false, features = ["dbus"] }
notify-rust = { version = "4.5.10", default-features = false, features = ["dbus"] }
num-traits = "0.2.15"
once_cell = "1.12.0"
once_cell = "1.15.0"
os-release = "0.1.0"
pango = "0.15.10"
pop-upgrade = { path = "../daemon/" }
rust-embed = { version = "6.4.0", features = ["debug-embed"] }
rust-embed = { version = "6.4.1", features = ["debug-embed"] }
shrinkwraprs = "0.3.0"
thiserror = "1.0.31"
thiserror = "1.0.37"
ubuntu-version = "0.2.5"
upower_dbus = "=0.1.0"
upower_dbus = "0.1.0"
users = "0.11.0"
yansi = "0.5.1"
gtk-sys = "0.15.3"
Expand Down
Loading