libalpm_packages(3)
๐ libalpm_packages ๐
okay so bestie, welcome to the libalpm_packages page โ straight out of the Library Functions Manual (libalpm_packages(3), iykyk). this is the whole package-handling corner of libalpm and honestly? it's giving main character energy. ๐
โจ NAME โจ
libalpm_packages โ Package Functions
- Functions to manipulate libalpm packages ๐ซถ
โจ SYNOPSIS โจ
๐ฆ Data Structures ๐ฆ
struct alpm_pkg_xdata_tโ the extended data type used to store non-standard package data fields.
๐ Typedefs ๐
typedef struct _alpm_pkg_t alpm_pkg_tโ a package.
๐ธ Enumerations ๐ธ
enum alpm_pkgreason_t { ALPM_PKG_REASON_EXPLICIT = 0, ALPM_PKG_REASON_DEPEND = 1, ALPM_PKG_REASON_UNKNOWN = 2 }โ package install reasons.enum alpm_pkgfrom_t { ALPM_PKG_FROM_FILE = 1, ALPM_PKG_FROM_LOCALDB, ALPM_PKG_FROM_SYNCDB }โ location a package object was loaded from.enum alpm_pkgvalidation_t { ALPM_PKG_VALIDATION_UNKNOWN = 0, ALPM_PKG_VALIDATION_NONE = (1 << 0), ALPM_PKG_VALIDATION_MD5SUM = (1 << 1), ALPM_PKG_VALIDATION_SHA256SUM = (1 << 2), ALPM_PKG_VALIDATION_SIGNATURE = (1 << 3) }โ method used to validate a package.
๐ฅ Functions ๐ฅ
int alpm_pkg_load (alpm_handle_t *handle, const char *filename, int full, int level, alpm_pkg_t **pkg)โ create a package from a file.int alpm_fetch_pkgurl (alpm_handle_t *handle, const alpm_list_t *urls, alpm_list_t **fetched)โ fetch a list of remote packages.alpm_pkg_t * alpm_pkg_find (alpm_list_t *haystack, const char *needle)โ find a package in a list by name.int alpm_pkg_free (alpm_pkg_t *pkg)โ free a package.int alpm_pkg_checkmd5sum (alpm_pkg_t *pkg)โ check the integrity (with md5) of a package from the sync cache.int alpm_pkg_vercmp (const char *a, const char *b)โ compare two version strings and determine which one is 'newer'.alpm_list_t * alpm_pkg_compute_requiredby (alpm_pkg_t *pkg)โ computes the list of packages requiring a given package.alpm_list_t * alpm_pkg_compute_optionalfor (alpm_pkg_t *pkg)โ computes the list of packages optionally requiring a given package.int alpm_pkg_should_ignore (alpm_handle_t *handle, alpm_pkg_t *pkg)โ test if a package should be ignored.
๐ Package Property Accessors ๐
any pointer these functions hand back points to internal structures that libalpm allocated itself.
bestie, do not free them, do not modify them, in any way. that's the rule. ๐
for loaded packages, they get freed when alpm_pkg_free is called. for database packages, they get freed when the database is unregistered.
alpm_handle_t * alpm_pkg_get_handle (alpm_pkg_t *pkg)โ gets the handle of a package.const char * alpm_pkg_get_filename (alpm_pkg_t *pkg)โ gets the name of the file from which the package was loaded.const char * alpm_pkg_get_base (alpm_pkg_t *pkg)โ returns the package base name.const char * alpm_pkg_get_name (alpm_pkg_t *pkg)โ returns the package name.const char * alpm_pkg_get_version (alpm_pkg_t *pkg)โ returns the package version as a string.alpm_pkgfrom_t alpm_pkg_get_origin (alpm_pkg_t *pkg)โ returns the origin of the package.const char * alpm_pkg_get_desc (alpm_pkg_t *pkg)โ returns the package description.const char * alpm_pkg_get_url (alpm_pkg_t *pkg)โ returns the package URL.alpm_time_t alpm_pkg_get_builddate (alpm_pkg_t *pkg)โ returns the build timestamp of the package.alpm_time_t alpm_pkg_get_installdate (alpm_pkg_t *pkg)โ returns the install timestamp of the package.const char * alpm_pkg_get_packager (alpm_pkg_t *pkg)โ returns the packager's name.const char * alpm_pkg_get_md5sum (alpm_pkg_t *pkg)โ returns the package's MD5 checksum as a string.const char * alpm_pkg_get_sha256sum (alpm_pkg_t *pkg)โ returns the package's SHA256 checksum as a string.const char * alpm_pkg_get_arch (alpm_pkg_t *pkg)โ returns the architecture for which the package was built.off_t alpm_pkg_get_size (alpm_pkg_t *pkg)โ returns the size of the package.off_t alpm_pkg_get_isize (alpm_pkg_t *pkg)โ returns the installed size of the package.alpm_pkgreason_t alpm_pkg_get_reason (alpm_pkg_t *pkg)โ returns the package installation reason.alpm_list_t * alpm_pkg_get_licenses (alpm_pkg_t *pkg)โ returns the list of package licenses.alpm_list_t * alpm_pkg_get_groups (alpm_pkg_t *pkg)โ returns the list of package groups.alpm_list_t * alpm_pkg_get_depends (alpm_pkg_t *pkg)โ returns the list of package dependencies asalpm_depend_t.alpm_list_t * alpm_pkg_get_optdepends (alpm_pkg_t *pkg)โ returns the list of package optional dependencies.alpm_list_t * alpm_pkg_get_checkdepends (alpm_pkg_t *pkg)โ returns a list of package check dependencies.alpm_list_t * alpm_pkg_get_makedepends (alpm_pkg_t *pkg)โ returns a list of package make dependencies.alpm_list_t * alpm_pkg_get_conflicts (alpm_pkg_t *pkg)โ returns the list of packages conflicting withpkg.alpm_list_t * alpm_pkg_get_provides (alpm_pkg_t *pkg)โ returns the list of packages provided bypkg.alpm_list_t * alpm_pkg_get_replaces (alpm_pkg_t *pkg)โ returns the list of packages to be replaced bypkg.alpm_filelist_t * alpm_pkg_get_files (alpm_pkg_t *pkg)โ returns the list of files installed bypkg.alpm_list_t * alpm_pkg_get_backup (alpm_pkg_t *pkg)โ returns the list of files backed up when installingpkg.alpm_db_t * alpm_pkg_get_db (alpm_pkg_t *pkg)โ returns the database containingpkg.const char * alpm_pkg_get_base64_sig (alpm_pkg_t *pkg)โ returns the base64 encoded package signature.int alpm_pkg_get_sig (alpm_pkg_t *pkg, unsigned char **sig, size_t *sig_len)โ extracts package signature either from embedded package signature or, if it is absent, then reads data from the detached signature file.int alpm_pkg_get_validation (alpm_pkg_t *pkg)โ returns the method used to validate a package during install.alpm_list_t * alpm_pkg_get_xdata (alpm_pkg_t *pkg)โ gets the extended data field of a package.int alpm_pkg_has_scriptlet (alpm_pkg_t *pkg)โ returns whether the package has an install scriptlet.off_t alpm_pkg_download_size (alpm_pkg_t *newpkg)โ returns the size of the files that will be downloaded to install a package.int alpm_pkg_set_reason (alpm_pkg_t *pkg, alpm_pkgreason_t reason)โ set install reason for a package in the local database.
๐ Changelog functions ๐
functions for reading the changelog ๐
void * alpm_pkg_changelog_open (alpm_pkg_t *pkg)โ open a package changelog for reading.size_t alpm_pkg_changelog_read (void *ptr, size_t size, const alpm_pkg_t *pkg, void *fp)โ read data from an open changelog 'file stream'.int alpm_pkg_changelog_close (const alpm_pkg_t *pkg, void *fp)โ close a package changelog for reading.
๐ณ Mtree functions ๐ณ
functions for reading the mtree ๐ฟ
struct archive * alpm_pkg_mtree_open (alpm_pkg_t *pkg)โ open a package mtree file for reading.int alpm_pkg_mtree_next (const alpm_pkg_t *pkg, struct archive *archive, struct archive_entry **entry)โ read next entry from a package mtree file.int alpm_pkg_mtree_close (const alpm_pkg_t *pkg, struct archive *archive)โ close a package mtree file.
๐ Detailed Description ๐
functions to manipulate libalpm packages ๐ซถ
๐ Data Structure Documentation ๐
struct alpm_pkg_xdata_t
the extended data type used to store non-standard package data fields. it's the lil bonus bucket. ๐
Data Fields:
char * namechar * value
๐ง Typedef Documentation ๐ง
typedef struct _alpm_pkg_t alpm_pkg_t
a package. a package can be loaded from disk via alpm_pkg_load, or it can be retrieved from a database. packages that came from databases are automatically freed when the database is unregistered โ no takebacks needed. packages loaded from a file? those you must free manually, bestie, nobody's gonna do it for you. ๐ญ
and once you've got one, you can query it for metadata, or add it to a transaction to be added to or removed from the system. iconic. โจ
๐ธ Enumeration Type Documentation ๐ธ
enum alpm_pkgfrom_t
location a package object was loaded from. ๐
Enumerator
ALPM_PKG_FROM_FILEโ loaded from a file viaalpm_pkg_load.ALPM_PKG_FROM_LOCALDBโ from the local database.ALPM_PKG_FROM_SYNCDBโ from a sync database.
enum alpm_pkgreason_t
package install reasons. why is this thing here, fr fr ๐ค
Enumerator
ALPM_PKG_REASON_EXPLICITโ explicitly requested by the user.ALPM_PKG_REASON_DEPENDโ installed as a dependency for another package.ALPM_PKG_REASON_UNKNOWNโ failed parsing of local database.
enum alpm_pkgvalidation_t
method used to validate a package. the vibe check, basically. โ
Enumerator
ALPM_PKG_VALIDATION_UNKNOWNโ the package's validation type is unknown.ALPM_PKG_VALIDATION_NONEโ the package does not have any validation.ALPM_PKG_VALIDATION_MD5SUMโ the package is validated with md5.ALPM_PKG_VALIDATION_SHA256SUMโ the package is validated with sha256.ALPM_PKG_VALIDATION_SIGNATUREโ the package is validated with a PGP signature.
๐ฅ Function Documentation ๐ฅ
int alpm_fetch_pkgurl (alpm_handle_t * handle, const alpm_list_t * urls, alpm_list_t ** fetched)
fetch a list of remote packages. go get 'em. ๐โโ๏ธ
Parameters
- handle โ the context handle
- urls โ list of package URLs to download
- fetched โ list of filepaths to the fetched packages, each item corresponds to one in the urls list. this is an output parameter, so the caller should provide a pointer to an empty list (
*fetched === NULL) and the callee fills the list with data. don't you dare pre-fill it. ๐
Returns
0 on success or -1 on failure
int alpm_pkg_changelog_close (const alpm_pkg_t * pkg, void * fp)
close a package changelog for reading. bye bestie ๐
Parameters
- pkg โ the package to close the changelog of (either file or db)
- fp โ the 'file stream' to the package changelog to close
Returns
0 on success, -1 on error
void * alpm_pkg_changelog_open (alpm_pkg_t * pkg)
open a package changelog for reading. it's similar to fopen in functionality, except that the returned 'file stream' could really be from an archive as well as from the database. plot twist. ๐ฎ
Parameters
- pkg โ the package to read the changelog of (either file or db)
Returns
a 'file stream' to the package changelog
size_t alpm_pkg_changelog_read (void * ptr, size_t size, const alpm_pkg_t * pkg, void * fp)
read data from an open changelog 'file stream'. similar to fread in functionality โ this function takes a buffer and an amount of data to read. if an error occurs, pm_errno will be set. ๐
Parameters
- ptr โ a buffer to fill with raw changelog data
- size โ the size of the buffer
- pkg โ the package that the changelog is being read from
- fp โ a 'file stream' to the package changelog
Returns
the number of characters read, or 0 if there is no more data or an error occurred.
int alpm_pkg_checkmd5sum (alpm_pkg_t * pkg)
check the integrity (with md5) of a package from the sync cache. ๐
Parameters
- pkg โ package pointer
- Returns โ
0when it slays (success),-1when it doesn't (error, andpm_errnogets set accordingly). ๐
๐ alpm_list_t * alpm_pkg_compute_optionalfor (alpm_pkg_t * pkg)
alpm_list_t * alpm_pkg_compute_optionalfor (alpm_pkg_t * pkg)
Computes the list of packages that optionally require a given package. Bestie, the thing this hands back is a newly allocated list of package names (char*), and you โ yes you, the caller โ have to free it. No one else is coming to clean that up for you. ๐งนโจ
Parameters
pkgโ a package
Returns
- the list of packages optionally requiring
pkg๐ซถ
๐ธ alpm_list_t * alpm_pkg_compute_requiredby (alpm_pkg_t * pkg)
alpm_list_t * alpm_pkg_compute_requiredby (alpm_pkg_t * pkg)
Computes the list of packages that actually require a given package โ the hard requirement girlies, not the optional ones. Same deal as above: the return value is a newly allocated list of package names (char*) and it should be freed by the caller. Periodt. ๐
Parameters
pkgโ a package
Returns
- the list of packages requiring
pkg๐ฅ
๐ฆ off_t alpm_pkg_download_size (alpm_pkg_t * newpkg)
off_t alpm_pkg_download_size (alpm_pkg_t * newpkg)
Tells you how many bytes of files are gonna get downloaded to install a package. Like, the actual download weight. ๐ฆโฌ๏ธ
Parameters
newpkgโ the new package to upgrade to
Returns
- the size of the download ๐
๐ alpm_pkg_t * alpm_pkg_find (alpm_list_t * haystack, const char * needle)
alpm_pkg_t * alpm_pkg_find (alpm_list_t * haystack, const char * needle)
Find a package in a list, by name. Classic needle-in-a-haystack situation but the haystack is a list of packages and honestly it's giving search energy. ๐
Parameters
haystackโ a list ofalpm_pkg_tneedleโ the package name
Returns
- a pointer to the package if found, or
NULL๐ญ
๐ int alpm_pkg_free (alpm_pkg_t * pkg)
int alpm_pkg_free (alpm_pkg_t * pkg)
Frees a package. Heads up though: only packages loaded with alpm_pkg_load can be freed by you. Packages that came from databases? Those get freed by libalpm itself when they're unregistered. So don't go freeing things that aren't yours to free, bestie, that's not the vibe. ๐
Parameters
pkgโ package pointer to free
Returns
0on success,-1on error (pm_errnois set accordingly)
โจ const char * alpm_pkg_get_arch (alpm_pkg_t * pkg)
const char * alpm_pkg_get_arch (alpm_pkg_t * pkg)
Returns the architecture the package was built for. ๐๏ธ
Parameters
pkgโ a pointer to package
Returns
- a reference to an internal string
๐ alpm_list_t * alpm_pkg_get_backup (alpm_pkg_t * pkg)
alpm_list_t * alpm_pkg_get_backup (alpm_pkg_t * pkg)
Returns the list of files that get backed up when installing pkg. Keep those safe, they're precious. ๐พ
Parameters
pkgโ a pointer to package
Returns
- a reference to a list of
alpm_backup_tobjects
๐ธ const char * alpm_pkg_get_base (alpm_pkg_t * pkg)
const char * alpm_pkg_get_base (alpm_pkg_t * pkg)
Returns the package base name. The main character it was built from. ๐
Parameters
pkgโ a pointer to package
Returns
- a reference to an internal string
๐ฆ const char * alpm_pkg_get_base64_sig (alpm_pkg_t * pkg)
const char * alpm_pkg_get_base64_sig (alpm_pkg_t * pkg)
Returns the base64 encoded package signature. Encoded and ready. ๐
Parameters
pkgโ a pointer to package
Returns
- a reference to an internal string
๐ alpm_time_t alpm_pkg_get_builddate (alpm_pkg_t * pkg)
alpm_time_t alpm_pkg_get_builddate (alpm_pkg_t * pkg)
Returns the build timestamp of the package โ when it was born, basically. ๐
Parameters
pkgโ a pointer to package
Returns
- the timestamp of the build time โฐ
๐ alpm_list_t * alpm_pkg_get_checkdepends (alpm_pkg_t * pkg)
alpm_list_t * alpm_pkg_get_checkdepends (alpm_pkg_t * pkg)
Returns a list of package check dependencies. The ones you need for testing, iykyk. ๐งช
Parameters
pkgโ a pointer to package
Returns
- a reference to an internal list of
alpm_depend_tstructures
โจ alpm_list_t * alpm_pkg_get_conflicts (alpm_pkg_t * pkg)
alpm_list_t * alpm_pkg_get_conflicts (alpm_pkg_t * pkg)
Returns the list of packages that conflict with pkg. It's giving drama, but the technical kind. ๐
Parameters
pkgโ a pointer to package
Returns
- a reference to an internal list of
alpm_depend_tstructures
๐ alpm_db_t * alpm_pkg_get_db (alpm_pkg_t * pkg)
alpm_db_t * alpm_pkg_get_db (alpm_pkg_t * pkg)
Returns the database containing pkg. Specifically it hands you a pointer to the alpm_db_t structure the package is originating from โ or NULL if the package was loaded from a file. So if you get NULL, don't panic, it just means the package isn't a database girlie. ๐๏ธ
Parameters
pkgโ a pointer to package
Returns
- a pointer to the DB containing
pkg, orNULL.
๐ธ alpm_list_t * alpm_pkg_get_depends (alpm_pkg_t * pkg)
alpm_list_t * alpm_pkg_get_depends (alpm_pkg_t * pkg)
Returns the list of package dependencies as alpm_depend_t. The whole squad it needs. ๐
Parameters
pkgโ a pointer to package
Returns
- a reference to an internal list of
alpm_depend_tstructures
๐ฆ const char * alpm_pkg_get_desc (alpm_pkg_t * pkg)
const char * alpm_pkg_get_desc (alpm_pkg_t * pkg)
Returns the package description. The little bio. ๐
Parameters
pkgโ a pointer to package
Returns
- a reference to an internal string
๐ const char * alpm_pkg_get_filename (alpm_pkg_t * pkg)
const char * alpm_pkg_get_filename (alpm_pkg_t * pkg)
Gets the name of the file from which the package was loaded. Where it came from. ๐
Parameters
pkgโ a pointer to package
Returns
- a reference to an internal string
๐ alpm_filelist_t * alpm_pkg_get_files (alpm_pkg_t * pkg)
alpm_filelist_t * alpm_pkg_get_files (alpm_pkg_t * pkg)
Returns the list of files installed by pkg. Important detail: the filenames are relative to the install root, and they do not include leading slashes. So no / at the front, okay bestie? ๐ซ
Parameters
pkgโ a pointer to package
Returns
- a pointer to a filelist object containing a count and an array of package file objects
โจ alpm_list_t * alpm_pkg_get_groups (alpm_pkg_t * pkg)
alpm_list_t * alpm_pkg_get_groups (alpm_pkg_t * pkg)
Returns the list of package groups. The cliques it runs with. ๐ฏ
Parameters
pkgโ a pointer to package
Returns
- a pointer to an internal list of strings.
๐ alpm_handle_t * alpm_pkg_get_handle (alpm_pkg_t * pkg)
alpm_handle_t * alpm_pkg_get_handle (alpm_pkg_t * pkg)
Gets the handle of a package. Every package has a home handle and this is how you find it. ๐
Parameters
pkgโ a pointer to package
Returns
- the alpm handle that the package belongs to
๐ธ alpm_time_t alpm_pkg_get_installdate (alpm_pkg_t * pkg)
alpm_time_t alpm_pkg_get_installdate (alpm_pkg_t * pkg)
Returns the install timestamp of the package โ when it actually moved in. ๐ฆ๐ก
Parameters
pkgโ a pointer to package
Returns
- the timestamp of the install time โฐ
๐ฆ off_t alpm_pkg_get_isize (alpm_pkg_t * pkg)
off_t alpm_pkg_get_isize (alpm_pkg_t * pkg)
Returns the installed size of the package. How much space it's taking up once it's settled in. ๐
Parameters
pkgโ a pointer to package
Returns
- the total size of files installed by the package.
๐ alpm_list_t * alpm_pkg_get_licenses (alpm_pkg_t * pkg)
alpm_list_t * alpm_pkg_get_licenses (alpm_pkg_t * pkg)
Returns the list of package licenses. Legal girlie behavior. โ๏ธ
Parameters
pkgโ a pointer to package
Returns
- a pointer to an internal list of strings.
๐ alpm_list_t * alpm_pkg_get_makedepends (alpm_pkg_t * pkg)
alpm_list_t * alpm_pkg_get_makedepends (alpm_pkg_t * pkg)
Returns a list of package make dependencies. The build-time besties. ๐จ
Parameters
pkgโ a pointer to package
Returns
- a reference to an internal list of
alpm_depend_tstructures
โจ const char * alpm_pkg_get_md5sum (alpm_pkg_t * pkg)
const char * alpm_pkg_get_md5sum (alpm_pkg_t * pkg)
Returns the package's MD5 checksum as a string. Fun fact: the returned string is a sequence of 32 lowercase hexadecimal digits. Count them if you want, they're all there. ๐ข
Parameters
pkgโ a pointer to package
Returns
- a reference to an internal string
๐ const char * alpm_pkg_get_name (alpm_pkg_t * pkg)
const char * alpm_pkg_get_name (alpm_pkg_t * pkg)
Returns the package name. The whole identity. ๐ชช
Parameters
pkgโ a pointer to package
Returns
- a reference to an internal string
๐ธ alpm_list_t * alpm_pkg_get_optdepends (alpm_pkg_t * pkg)
alpm_list_t * alpm_pkg_get_optdepends (alpm_pkg_t * pkg)
Returns the list of package optional dependencies. The "would be nice but not required" girlies. ๐ซถ
Parameters
pkgโ a pointer to package
Returns
- a reference to an internal list of
alpm_depend_tstructures
๐ฆ alpm_pkgfrom_t alpm_pkg_get_origin (alpm_pkg_t * pkg)
alpm_pkgfrom_t alpm_pkg_get_origin (alpm_pkg_t * pkg)
Returns the origin of the package. Where it's from, its lore. ๐
Returns
- an
alpm_pkgfrom_tconstant,-1on error
๐ const char * alpm_pkg_get_packager (alpm_pkg_t * pkg)
const char * alpm_pkg_get_packager (alpm_pkg_t * pkg)
Returns the packager's name. Credit where credit is due. ๐
Parameters
pkgโ a pointer to package
Returns
- a reference to an internal string
๐ alpm_list_t * alpm_pkg_get_provides (alpm_pkg_t * pkg)
alpm_list_t * alpm_pkg_get_provides (alpm_pkg_t * pkg)
Returns the list of packages provided by pkg. It's giving "I can be that for you". ๐โโ๏ธ
Parameters
pkgโ a pointer to package
Returns
- a reference to an internal list of
alpm_depend_tstructures
โจ alpm_pkgreason_t alpm_pkg_get_reason (alpm_pkg_t * pkg)
alpm_pkgreason_t alpm_pkg_get_reason (alpm_pkg_t * pkg)
Returns the package installation reason. Why is it here? We asked, and it answered. ๐ง
Parameters
pkgโ a pointer to package
Returns
- an enum member giving the install reason.
๐ alpm_list_t * alpm_pkg_get_replaces (alpm_pkg_t * pkg)
alpm_list_t * alpm_pkg_get_replaces (alpm_pkg_t * pkg)
Returns the list of packages to be replaced by pkg. Out with the old, in with the new. ๐
Parameters
pkgโ a pointer to package
Returns
- a reference to an internal list of
alpm_depend_tstructures
๐ธ const char * alpm_pkg_get_sha256sum (alpm_pkg_t * pkg)
const char * alpm_pkg_get_sha256sum (alpm_pkg_t * pkg)
Returns the package's SHA256 checksum as a string. And because more digits = more drama, this one is a sequence of 64 lowercase hexadecimal digits. Double the MD5, double the fun. ๐
Parameters
pkgโ a pointer to package
Returns
- a reference to an internal string
๐ฆ int alpm_pkg_get_sig (alpm_pkg_t * pkg, unsigned char ** sig, size_t * sig_len)
int alpm_pkg_get_sig (alpm_pkg_t * pkg, unsigned char ** sig, size_t * sig_len)
Extracts the package signature โ either from the embedded package signature, or if that's absent, it reads the data from the detached signature file instead. Either way, you're getting that signature. ๐
Parameters
pkgโ a pointer to package.sigโ output parameter for signature data. The callee function allocates a buffer needed for the signature data. Caller is responsible for freeing this buffer. Yes, that means you. ๐sig_lenโ output parameter for the signature data length.
Returns
0on success, a negative number on error.
๐ off_t alpm_pkg_get_size (alpm_pkg_t * pkg)
off_t alpm_pkg_get_size (alpm_pkg_t * pkg)
Returns the size of the package. But heads up: this is only available for sync database packages and package files โ not those loaded from the local database. So if you're getting nothing, that's why, bestie. ๐ซ
Parameters
pkgโ a pointer to package
Returns
- the size of the package in bytes.
๐ const char * alpm_pkg_get_url (alpm_pkg_t * pkg)
const char * alpm_pkg_get_url (alpm_pkg_t * pkg)
Returns the package URL. The link in the bio. ๐
Parameters
pkgโ a pointer to package
Returns
- a reference to an internal string
โจ int alpm_pkg_get_validation (alpm_pkg_t * pkg)
int alpm_pkg_get_validation (alpm_pkg_t * pkg)
Returns the method used to validate a package during install. The vibe check it passes through. โ
Parameters
pkgโ a pointer to package
Returns
- an enum member giving the validation method
๐ const char * alpm_pkg_get_version (alpm_pkg_t * pkg)
const char * alpm_pkg_get_version (alpm_pkg_t * pkg)
Returns the package version as a string. Key detail: this includes all available epoch, version, and pkgrel components. And if you need to compare version strings, use alpm_pkg_vercmp() for that, don't try to do it yourself. ๐ข
Parameters
pkgโ a pointer to package
Returns
- a reference to an internal string
๐ธ alpm_list_t * alpm_pkg_get_xdata (alpm_pkg_t * pkg)
alpm_list_t * alpm_pkg_get_xdata (alpm_pkg_t * pkg)
Gets the extended data field of a package. The bonus content. ๐
Parameters
pkgโ a pointer to package
Returns
- a reference to a list of
alpm_pkg_xdata_tobjects
๐ฆ int alpm_pkg_has_scriptlet (alpm_pkg_t * pkg)
int alpm_pkg_has_scriptlet (alpm_pkg_t * pkg)
Returns whether the package has an install scriptlet. Yes or no, does it have a little script moment. ๐
Returns
0if FALSE, TRUE otherwise
๐ int alpm_pkg_load (alpm_handle_t * handle, const char * filename, int full, int level, alpm_pkg_t ** pkg)
int alpm_pkg_load (alpm_handle_t * handle, const char * filename, int full, int level, alpm_pkg_t ** pkg)
Create a package from a file. โจ Here's the tea: if full is false, the archive is read only until all necessary metadata is found. If it's true, the entire archive is read โ which serves as a verification of integrity and the filelist can be created. And the allocated structure? Free it using alpm_pkg_free(). Don't leave it hanging. ๐ซถ
Parameters
handleโ the context handlefilenameโ location of the package tarballfullโ whether to stop the load after metadata is read, or continue through the full archivelevelโ what level of package signature checking to perform on the package; note that this must be a.sigfile type verificationpkgโ address of the package pointer
Returns
0on success,-1on error (pm_errnois set accordingly)
๐ int alpm_pkg_mtree_close (const alpm_pkg_t * pkg, struct archive * archive)
int alpm_pkg_mtree_close (const alpm_pkg_t * pkg, struct archive * archive)
Close a package mtree file. Wrapping it up, saying goodbye. ๐
Parameters
pkgโ the local package to close the mtree ofarchiveโ the archive to close
โจ int alpm_pkg_mtree_next (const alpm_pkg_t * pkg, struct archive * archive, struct archive_entry ** entry)
int alpm_pkg_mtree_next (const alpm_pkg_t * pkg, struct archive * archive, struct archive_entry ** entry)
Read the next entry from a package mtree file. Next, please. โก๏ธ
๐ Parameters ๐
pkgโ the package that the mtree file is being read from ๐archiveโ the archive structure reading from the mtree fileentryโ anarchive_entryto store the entry header information
๐ Returns ๐
0 on success, 1 if end of archive is reached, -1 otherwise. Slay.
๐ธ struct archive * alpm_pkg_mtree_open (alpm_pkg_t * pkg) ๐ธ
Open a package mtree file for reading. bestie we are literally opening the thing. ๐
Parameters
pkgโ the local package to read the mtree of
Returns
an archive structure for the package mtree file. it's giving "here's your handle, go wild" โจ
๐ฆ int alpm_pkg_set_reason (alpm_pkg_t * pkg, alpm_pkgreason_t reason) ๐ฆ
Set install reason for a package in the local database.
๐จ okay so this is the important bit: the provided package object must be from the local database or this method will fail. no cap.
The write to the local database is performed immediately. like, no queue, no vibe check, it just goes. ๐
Parameters
pkgโ the package to updatereasonโ the new install reason
Returns
0 on success, -1 on error (pm_errno is set accordingly). if you get -1, go read pm_errno, she's trying to tell you something ๐ญ
๐ int alpm_pkg_should_ignore (alpm_handle_t * handle, alpm_pkg_t * pkg) ๐
Test if a package should be ignored. ๐
She checks if the package is ignored via IgnorePkg, or if the package is in a group ignored via IgnoreGroup. two whole ways to get ignored, main character energy fr.
Parameters
handleโ the context handlepkgโ the package to test
Returns
1 if the package should be ignored, 0 otherwise. simple as that. periodt. ๐
โญ int alpm_pkg_vercmp (const char * a, const char * b) โญ
Compare two version strings and determine which one is 'newer'. ๐ฅ
Returns a value comparable to the way strcmp works. So: returns 1 if a is newer than b, 0 if a and b are the same version, or -1 if b is newer than a. classic three-way girlie behavior, we love her.
Different epoch values for version strings will override any further comparison. If no epoch is provided, 0 is assumed. ๐
๐ Keep in mind that thepkgrelis only compared if it is available on both versions handed to this function. For example, comparing1.5-1and1.5will yield0; comparing1.5-1and1.5-2will yield-1as expected. This is mainly for supporting versioned dependencies that do not include thepkgrel. iykyk ๐
๐ง Author ๐ง
Generated automatically by Doxygen for libalpm from the source code.
and that's the whole page bestie!! ๐ซถ this one came from the libalpm source and she's dated with the libalpm version stamp, and the footer literally just says libalpm + libalpm_packages(3) like a lil name tag at the bottom of the page. so iconic of her honestly. go forth and vercmp responsibly ๐
โจ๐ธ
๐ฆ where this page comes from
- arch rolling: pacman 7.1.0.r9.g54d9411-2
- epel 10: libalpm-devel 7.0.0-5.el10_2 ยท GPL-2.0-or-later
- fedora 43: libalpm-devel 7.0.0-5.fc43 ยท GPL-2.0-or-later
- fedora 43: libalpm-devel 7.0.0-5.fc43 ยท GPL-2.0-or-later
- fedora 44: libalpm-devel 7.0.0-6.fc44 ยท GPL-2.0-or-later
- fedora 44: libalpm-devel 7.0.0-6.fc44 ยท GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms