⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

sys_pkg_query

Function sys_pkg_query 

Source
pub fn sys_pkg_query(_name: &str) -> SyscallResult<PackageInfo>
Expand description

Query information about a package by name.

Looks up the specified package in both the installed package database and the configured repositories. Returns a PackageInfo struct containing the package’s name, version, and installation status.

This is a read-only operation that does not modify the system. It can be used to check whether a package is installed, discover available versions, or retrieve metadata before performing an install or remove operation.

§Arguments

  • name - Name of the package to query. Searches the installed package database first, then falls back to configured repository indices.

§Returns

  • Ok(PackageInfo) - Package metadata including:
    • name: The canonical package name.
    • version: The installed or latest available version string (semver).
    • installed: true if the package is currently installed, false if it is only available in repositories.

§Errors

§Examples

use veridian_kernel::pkg::sdk::syscall_api::sys_pkg_query;

let info = sys_pkg_query("libveridian").expect("query failed");
if info.installed {
    // Package is installed, version info.version
} else {
    // Package is available but not installed
}