Skip to main content

build_update_command

Function build_update_command 

Source
pub fn build_update_command(
    helper: Option<AurHelper>,
    noconfirm: bool,
) -> CommandSpec
Expand description

What: Build a full-system update command.

Inputs:

  • helper: When Some, use the AUR helper (paru -Syu) which updates both official and AUR packages. When None, use plain pacman -Syu.
  • noconfirm: Pass --noconfirm for non-interactive updates.

Output:

  • CommandSpec like paru -Syu --noconfirm or pacman -Syu --noconfirm.

Details:

  • The pacman variant requires privilege wrapping (with_privilege); helper variants must not be wrapped (helpers call sudo themselves).

ยงExample

use arch_toolkit::install::build_update_command;
use arch_toolkit::types::install::AurHelper;

let pacman = build_update_command(None, true);
assert_eq!(pacman.to_shell_string(), "pacman -Syu --noconfirm");

let helper = build_update_command(Some(AurHelper::Yay), false);
assert_eq!(helper.to_shell_string(), "yay -Syu");