No edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
Example: | Example: | ||
< | <pre> | ||
Version: 1.2 | Version: 1.2 | ||
Release: 3%{?dist} | Release: 3%{?dist} | ||
Epoch: 1 | Epoch: 1 | ||
</ | </pre> | ||
A package with those definitions would be considered greater than a package with a higher version or a higher release. Since Epoch is confusing to humans (and can never be removed from a package once used), it should only be used in Fedora as a last resort to resolve upgrade ordering of a package. | A package with those definitions would be considered greater than a package with a higher version or a higher release. Since Epoch is confusing to humans (and can never be removed from a package once used), it should only be used in Fedora as a last resort to resolve upgrade ordering of a package. | ||
Also, Epoch complicates normal packaging guidelines. If a package uses an Epoch, it must be referred to in any place where < | Also, Epoch complicates normal packaging guidelines. If a package uses an Epoch, it must be referred to in any place where <code>%{version}-%{release}</code> is used. For example, if a package being depended upon has an Epoch, this must be listed when adding a versioned dependency: | ||
< | <pre> | ||
Requires: foo = %{epoch}:%{version}-%{release} | Requires: foo = %{epoch}:%{version}-%{release} | ||
</ | </pre> |
Revision as of 16:58, 9 February 2011
Epoch
RPM supports a field called "Epoch:", which is a numeric field, that, if set, adds another qualifier for RPM to use in doing package comparisons. Specifically, if set, the Epoch of a package trumps all other comparisons (except for a lesser Epoch). If Epoch is not set in a package, RPM treats it the same as if it was set to 0.
Example:
Version: 1.2 Release: 3%{?dist} Epoch: 1
A package with those definitions would be considered greater than a package with a higher version or a higher release. Since Epoch is confusing to humans (and can never be removed from a package once used), it should only be used in Fedora as a last resort to resolve upgrade ordering of a package.
Also, Epoch complicates normal packaging guidelines. If a package uses an Epoch, it must be referred to in any place where %{version}-%{release}
is used. For example, if a package being depended upon has an Epoch, this must be listed when adding a versioned dependency:
Requires: foo = %{epoch}:%{version}-%{release}