From Fedora Project Wiki

No edit summary
(Spiff up the first table a bit)
 
(6 intermediate revisions by one other user not shown)
Line 7: Line 7:


Things to add which we don't currently have examples for:
Things to add which we don't currently have examples for:
* Upstream just uses random words as names: "spectacled", "cinnamon", "polar", "kodiak".
* Upstream just uses random words as names: "spectacled", "cinnamon", "polar", "kodiak".
* Upstream uses negative numbers.  "1.-1.7", "1.-1.8", "1.0.0".  (I sure hope nobody ever does this, but I don't actually know how we would handle it.)
* Upstream uses negative numbers.  "1.-1.7", "1.-1.8", "1.0.0".  (I sure hope nobody ever does this, but I don't actually know how we would handle it.)


== Simple versioning examples ==


{| style="width: 100%"
{| class="wikitable" style="width: 100%"
|+ '''Simple versioning'''
|+ '''Some basic examples'''
|-
!rowspan=2 style="vertical-align:bottom;"|Upstream
|colspan=3 style="font-size: 120%; text-align:center;"|'''Simple versioning'''
|- <!-- column headers -->
!style="width:5em;"|Version:
!style="width:7em;"|Release:
! Explanation
|-
! 1.0
| <code>1.0</code> || <code>1%{?dist}</code> || The first release.
|-
! 1.1
| <code>1.1</code> || <code>1%{?dist}</code> || An upstream update.
|-
! 1.1
| <code>1.1</code> || <code>2%{?dist}</code> || You made a change to the package but the upstream version didn't change.
|-
|-
! Upstream version !! Description !! Version: !! Release: !! Explanation
! 1.2
| <code>1.2</code> || <code>1%{?dist}</code> || The upstream version changed, so Release: goes back to 1.
|-
|-
| 1.0 || || 1.0 || 1 || The first release.
! 1.2.1
| <code>1.2.1</code> || <code>1%{?dist}</code> || Extra levels of versioning are OK.
|-
|-
| 1.1 || || 1.1 || 1 || An upstream update.
! 1.3
| <code>1.3</code> || <code>1%{?dist}</code> || They can come and go without problems.
|-
|-
| 1.1 || || 1.1 || 2 || You made a change to the package but the upstream version didn't change.
!rowspan=2|
|colspan=3 style="font-size: 120%; text-align:center;"|'''Simple version with letters'''
|-
|-
| 1.2 || || 1.2 || 1 || The upstream version changed, so Release: goes back to 1.
! Version: !! Release: !! Explanation
|-
|-
| 1.2.1 || || 1.2.1 || 1 || Extra levels of versioning are OK.
! 5.2  
| <code>5.2</code> || <code>1%{?dist}</code> ||
|-
|-
| 1.3 || || 1.3 || 1 || They can come and go without problems.
! 5.2a
| <code>5.2a</code> || <code>1%{?dist}</code> || Upstream introduced a letter to indicate a patch release.  You trust upstream to use letters in alphabetical order, so it's OK to use the version as is.
|-
! 5.2b
| <code>5.2b</code> || <code>1%{?dist}</code> ||
|-
! 5.2b.1
| <code>5.2b.1</code> || <code>1%{?dist}</code> || Even this is OK as long as the sequence increases.
|-
! 5.3  
| <code>5.3</code> || <code>1%{?dist}</code> ||
|}
|}


 
== Complex versioning examples ==


Example (post-release cvs):
Example (post-release cvs):
Line 42: Line 72:
</pre>
</pre>


==== Examples ====
{| cellpadding=1
{|
|+ '''Example (pkg pre-release)'''
|+ '''Example (pkg pre-release)'''
|-
|-

Latest revision as of 09:39, 28 April 2020

Each of these examples shows a versioning scenario. The sequence of versions used

Ideally there will be at least one example here for every tricky versioning scenario.

Things to add which we don't currently have examples for:

  • Upstream just uses random words as names: "spectacled", "cinnamon", "polar", "kodiak".
  • Upstream uses negative numbers. "1.-1.7", "1.-1.8", "1.0.0". (I sure hope nobody ever does this, but I don't actually know how we would handle it.)

Simple versioning examples

Some basic examples
Upstream Simple versioning
Version: Release: Explanation
1.0 1.0 1%{?dist} The first release.
1.1 1.1 1%{?dist} An upstream update.
1.1 1.1 2%{?dist} You made a change to the package but the upstream version didn't change.
1.2 1.2 1%{?dist} The upstream version changed, so Release: goes back to 1.
1.2.1 1.2.1 1%{?dist} Extra levels of versioning are OK.
1.3 1.3 1%{?dist} They can come and go without problems.
Simple version with letters
Version: Release: Explanation
5.2 5.2 1%{?dist}
5.2a 5.2a 1%{?dist} Upstream introduced a letter to indicate a patch release. You trust upstream to use letters in alphabetical order, so it's OK to use the version as is.
5.2b 5.2b 1%{?dist}
5.2b.1 5.2b.1 1%{?dist} Even this is OK as long as the sequence increases.
5.3 5.3 1%{?dist}

Complex versioning examples

Example (post-release cvs):

pkg-1.0-1%{?dist} (this is the formal release of pkg 1.0)
pkg-1.0-2%{?dist} (this is a bugfix build to the 1.0 release)
pkg-1.0-3.20050515cvs%{?dist} (move to a post-release cvs checkout)
pkg-1.0-4.20050515cvs%{?dist} (bugfix to the post-release cvs checkout)
pkg-1.0-5.20050517cvs%{?dist} (new cvs checkout, note the increment of %{X})
Example (pkg pre-release)
Source Archive Description
pkg-1.4a.tar.gz (this is a pre-release, version 1.4a of pkg)
pkg-1.4.tar.gz (this is what the 1.4 release will actually look like)
Release Tag Explanation
pkg-1.4-0.1.a%{?dist} (so, this is the acceptable Fedora %{name}-%{version}-%{release})
pkg-1.4-1%{?dist} (and this is what the 1.4 release Fedora %{name}-%{version}-%{release} should be)


Example (pkg pre-release)
Source Archive Description
pkg-0.9.2beta1.tar.gz (this is a beta release of pkg, version 0.9.2beta1)
Release Tag Explanation
pkg-0.9.2-0.1.beta1%{?dist} (this is the correct Fedora %{name}-%{version}-%{release})
pkg-0.9.2-0.2.beta1%{?dist} (this is an incremented Fedora %{name}-%{version}-%{release}. Note that the first 0 is not incremented.)


Example (pkg pre-release svn checkout)
Release Tag Explanation
pkg-0-0.1.20040110svn%{?dist} (this is a pre-release, svn checkout of pkg)
pkg-0-0.2.20040110svn%{?dist} (this is a bugfix to the previous package)
pkg-0-0.3.20040204svn%{?dist} (this is a new svn checkout, note the increment of %{X})
pkg-1.0-1%{?dist} (this is the formal release of pkg 1.0)


Upgrade Path Example
Release Tag Explanation
pkg-1.4-0.1.a%{?dist} (this is the Fedora package for 1.4a, as above)
pkg-1.4-0.2.a%{?dist} (this is the first patch on top of 1.4a)
pkg-1.4-0.3.a%{?dist} (this is another new patch on top of 1.4a)
pkg-1.4-0.4.b%{?dist} (this is the first build after upgrade to 1.4b)
pkg-1.4-0.5.b%{?dist} (this is a new patch on top of 1.4b)
pkg-1.4-1%{?dist} (this is after moving to 1.4 "final", and to a normal version)
pkg-1.4-2%{?dist} (this is a new patch on top of 1.4 "final")


Upgrade Path Example (pkg)
Release Tag Explanation
pkg-0.9.2-0.1.beta1%{?dist} (this is the Fedora package for 0.9.2beta1, as above)
pkg-0.9.2-0.2.beta1%{?dist} (this is a new patch on top of 0.9.2beta1)
pkg-0.9.2-0.3.beta2%{?dist} (this is after upgrading to 0.9.2beta2)
pkg-0.9.2-0.4.beta3%{?dist} (this is after upgrading to 0.9.2beta3)
pkg-0.9.2-0.5.beta3%{?dist} (this is a new patch on top of 0.9.2beta3)
pkg-0.9.2-0.6.rc1%{?dist} (this is after upgrading to 0.9.2rc1)
pkg-0.9.2-0.7.rc2%{?dist} (this is after upgrading to 0.9.2rc2)
pkg-0.9.2-1%{?dist} (this is after upgrading to 0.9.2 "final", version becomes normal)
pkg-0.9.2-2%{?dist} (this is a new patch on top of 0.9.2 "final")

Example (complicated post-release):

pkg-1.1.0-0.1.BETA%{?dist} (this is a prerelease, first beta)
pkg-1.1.0-0.2.BETA1%{?dist} (this is a prerelease, second beta)
pkg-1.1.0-0.3.BETA2%{?dist} (this is a prerelease, third beta)
pkg-1.1.0-0.4.CR1%{?dist} (this is a prerelease, candidate release 1)
pkg-1.1.0-0.5.CR2%{?dist} (this is a prerelease, candidate release 2)
pkg-1.1.0-1%{?dist} (final release)
pkg-1.1.0-2.GA1%{?dist} (post release, GA1)
pkg-1.1.0-3.CP1%{?dist} (post release, CP1, after GA1)
pkg-1.1.0-4.CP2%{?dist} (post release, CP2, after CP1)
pkg-1.1.0-5.SP1%{?dist} (post release, SP1, after CP2)
pkg-1.1.0-6.SP1_CP1%{?dist} (post release, SP1_CP1, after SP1)
Template
Upstream version Description Version: Release: Explanation