Skip to main content

api.pkg

The api.pkg module provides functions for working with packages.

get

Arguments:

  • name (string): The name of the package to get.

Returns:

  • package (Package): The package info from pacman -Qi.
  • error (error): The error message if the package does not exist.
FieldTypeDescription
NamestringThe name of the package.
VersionstringThe version of the package.
DescriptionstringThe description of the package.
ArchitecturestringThe architecture of the package.
URLstringThe URL of the package.
Licenses[]stringThe licenses of the package.
Groups[]stringThe groups of the package.
Provides[]stringThe packages provided by the package.
DependsOn[]stringThe packages the package depends on.
OptionalDeps[]stringThe optional dependencies of the package.
RequiredBy[]stringThe packages that require the package.
OptionalFor[]stringThe packages the package is optional for.
ConflictsWith[]stringThe packages the package conflicts with.
Replaces[]stringThe packages the package replaces.
InstalledSize[]stringThe installed size of the package.
PackagerstringThe packager of the package.
BuildDatestringThe build date of the package.
InstallDatestringThe install date of the package.
InstallReasonstringThe install reason of the package.
InstallScriptboolWhether the package has an install script.
ValidatedBystringThe signature of the package.

Example usage:

function gnome_exists()
app_info, err = api.pkg.Get("gnome-shell")
if err ~= nil then
api.info.Error("Error occured during obtaining package info!")
return false
end
return true
end