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:trueif the package is currently installed,falseif it is only available in repositories.
§Errors
SyscallError::NotFound- The package name was not found in the installed database or any configured repository.SyscallError::InvalidArgument- The package name is empty or contains invalid characters.SyscallError::PermissionDenied- The caller lacks the capability to query package information.SyscallError::IoError- An I/O error occurred reading the package database or repository index.
§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
}