Skip to main content

aur_vote

Function aur_vote 

Source
pub fn aur_vote(
    pkgbase: &str,
    action: VoteAction,
    ctx: &AurVoteContext,
) -> Result<AurVoteOutcome, AurVoteError>
Expand description

What: Vote or unvote an AUR package base via SSH.

Inputs:

  • pkgbase: the AUR package base name (e.g. "pacsea-bin").
  • action: VoteAction::Vote or VoteAction::Unvote.
  • ctx: configuration (dry-run, SSH timeout, SSH binary).

Output:

  • Ok(AurVoteOutcome) on success, with a user-facing .message().
  • Err(AurVoteError) on failure, with a user-facing Display impl.

Details:

  • In dry-run mode, returns a simulated outcome without spawning SSH.
  • Uses -o BatchMode=yes to prevent interactive prompts.
  • Uses -o ConnectTimeout=N to bound connection time.
  • Never logs SSH key paths or identity file contents.

ยงErrors

Returns AurVoteError for auth failure, package not found, network issues, SSH binary missing, AUR maintenance, IP ban, or unexpected upstream errors. Each variant has a user-facing Display message.