dpkg 1.22.7-3-g89f48
Loading...
Searching...
No Matches
Data Structures | Macros | Functions | Variables
Version handling
Collaboration diagram for Version handling:

Data Structures

struct  dpkg_version
 Data structure representing a Debian version. More...
 

Macros

#define DPKG_VERSION_OBJECT(e, v, r)    (struct dpkg_version){ .epoch = (e), .version = (v), .revision = (r) }
 Compound literal for a dpkg_version.
 
#define DPKG_VERSION_INIT    DPKG_VERSION_OBJECT(0, NULL, NULL)
 

Functions

void dpkg_version_blank (struct dpkg_version *version)
 Turn the passed version into an empty version.
 
bool dpkg_version_is_informative (const struct dpkg_version *version)
 Test if a version is not empty.
 
int dpkg_version_compare (const struct dpkg_version *a, const struct dpkg_version *b)
 Compares two Debian versions.
 
bool dpkg_version_relate (const struct dpkg_version *a, enum dpkg_relation rel, const struct dpkg_version *b)
 Check if two versions have a certain relation.
 

Variables

enum DPKG_ATTR_ENUM_FLAGS dpkg_relation
 Enum constants for the supported relation operations that can be done on Debian versions.
 

Detailed Description

Macro Definition Documentation

◆ DPKG_VERSION_INIT

#define DPKG_VERSION_INIT    DPKG_VERSION_OBJECT(0, NULL, NULL)

◆ DPKG_VERSION_OBJECT

#define DPKG_VERSION_OBJECT (   e,
  v,
 
)     (struct dpkg_version){ .epoch = (e), .version = (v), .revision = (r) }

Compound literal for a dpkg_version.

Function Documentation

◆ dpkg_version_blank()

void dpkg_version_blank ( struct dpkg_version version)

Turn the passed version into an empty version.

This can be used to ensure the version is properly initialized.

Parameters
versionThe version to clear.

References dpkg_version::epoch, dpkg_version::revision, and dpkg_version::version.

Referenced by cmpversions(), f_dependency(), pkg_blank(), pkgbin_blank(), and removal_bulk().

Here is the caller graph for this function:

◆ dpkg_version_compare()

int dpkg_version_compare ( const struct dpkg_version a,
const struct dpkg_version b 
)

Compares two Debian versions.

This function follows the convention of the comparator functions used by qsort().

See also
deb-version(5)
Parameters
aThe first version.
bThe second version.
Return values
0If a and b are equal.
<0If a is smaller than b.
>0If a is greater than b.

References dpkg_version::epoch, dpkg_version::revision, and dpkg_version::version.

Referenced by cmpversions(), deferred_configure(), dpkg_version_relate(), parsedb_parse(), process_archive(), and wanttoinstall().

Here is the caller graph for this function:

◆ dpkg_version_is_informative()

bool dpkg_version_is_informative ( const struct dpkg_version version)

Test if a version is not empty.

Parameters
versionThe version to test.
Return values
trueIf the version is informative (i.e. not an empty version).
falseIf the version is empty.

References dpkg_version::epoch, dpkg_version::revision, and dpkg_version::version.

Referenced by cmpversions(), deferred_configure(), depisok(), ensure_packagefiles_available(), parsedb_parse(), pkg_is_informative(), versiondescribe(), w_configversion(), and w_version().

Here is the caller graph for this function:

◆ dpkg_version_relate()

bool dpkg_version_relate ( const struct dpkg_version a,
enum dpkg_relation  rel,
const struct dpkg_version b 
)

Check if two versions have a certain relation.

Parameters
aThe first version.
relThe relation.
bThe second version.
Return values
trueIf rel is DPKG_RELATION_NONE or the expression “a rel b” is true.
falseOtherwise.
Warning
If rel is not a valid relation, this function will terminate the program.

References DPKG_RELATION_EQ, DPKG_RELATION_GE, DPKG_RELATION_GT, DPKG_RELATION_LE, DPKG_RELATION_LT, DPKG_RELATION_NONE, dpkg_version_compare(), and internerr.

Referenced by depisok(), pkg_virtual_deppossi_satisfied(), and versionsatisfied().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ dpkg_relation

enum DPKG_ATTR_ENUM_FLAGS dpkg_relation

Enum constants for the supported relation operations that can be done on Debian versions.