deb-version.5 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. .\" Includes text from the Debian Policy probably by Ian Jackson and others
  2. .\" The copyright given below is that of the whole policy, but probably
  3. .\" incomplete.
  4. .\" Conversion to roff by Frank Lichtenheld
  5. .TH deb\-version 5 "2008-08-18" "Debian Project" "Debian"
  6. .SH NAME
  7. deb\-version \- Debian package version number format
  8. .
  9. .SH SYNOPSIS
  10. .RI "[ " epoch ":] " upstream_version " [\-" debian_revision " ]"
  11. .SH DESCRIPTION
  12. Version numbers as used for Debian binary and source packages
  13. consist of three components. These are:
  14. .TP
  15. .I epoch
  16. This is a single (generally small) unsigned integer. It
  17. may be omitted, in which case zero is assumed. If it is
  18. omitted then the \fIupstream_version\fP may not
  19. contain any colons.
  20. .IP
  21. It is provided to allow mistakes in the version numbers
  22. of older versions of a package, and also a package's
  23. previous version numbering schemes, to be left behind.
  24. .TP
  25. .I upstream_version
  26. This is the main part of the version number. It is
  27. usually the version number of the original ("upstream")
  28. package from which the \fI.deb\fP file has been made,
  29. if this is applicable. Usually this will be in the same
  30. format as that specified by the upstream author(s);
  31. however, it may need to be reformatted to fit into the
  32. package management system's format and comparison
  33. scheme.
  34. .IP
  35. The comparison behavior of the package management system
  36. with respect to the \fIupstream_version\fP is
  37. described below. The \fIupstream_version\fP
  38. portion of the version number is mandatory.
  39. .IP
  40. The \fIupstream_version\fP may contain only
  41. alphanumerics ("A-Za-z0-9") and the characters
  42. .BR . " " + " " \- " " : " " ~
  43. (full stop, plus, hyphen, colon, tilde) and should
  44. start with a digit. If there is no
  45. \fIdebian_revision\fP then hyphens are not allowed;
  46. if there is no \fIepoch\fP then colons are not
  47. allowed.
  48. .TP
  49. .I debian_revision
  50. This part of the version number specifies the version of
  51. the Debian package based on the upstream version. It
  52. may contain only alphanumerics and the characters
  53. .BR + " " . " " ~
  54. (plus, full stop, tilde) and is
  55. compared in the same way as the
  56. \fIupstream_version\fP is.
  57. .IP
  58. It is optional; if it isn't present then the
  59. \fIupstream_version\fP may not contain a hyphen.
  60. This format represents the case where a piece of
  61. software was written specifically to be turned into a
  62. Debian package, and so there is only one "debianisation"
  63. of it and therefore no revision indication is required.
  64. .IP
  65. It is conventional to restart the
  66. \fIdebian_revision\fP at '1' each time time the
  67. \fIupstream_version\fP is increased.
  68. .IP
  69. Dpkg will break the version
  70. number apart at the last hyphen in the string (if there
  71. is one) to determine the \fIupstream_version\fP and
  72. \fIdebian_revision\fP. The absence of a
  73. \fIdebian_revision\fP compares earlier than the
  74. presence of one (but note that the \fIdebian_revision\fP
  75. is the least significant part of the version number).
  76. .SS Sorting Algorithm
  77. The \fIupstream_version\fP and \fIdebian_revision\fP
  78. parts are compared by the package management system using the
  79. same algorithm:
  80. .PP
  81. The strings are compared from left to right.
  82. .PP
  83. First the initial part of each string consisting entirely of
  84. non-digit characters is determined. These two parts (one of
  85. which may be empty) are compared lexically. If a difference
  86. is found it is returned. The lexical comparison is a
  87. comparison of ASCII values modified so that all the letters
  88. sort earlier than all the non-letters and so that a tilde
  89. sorts before anything, even the end of a part. For example,
  90. the following parts are in sorted order: '~~', '~~a', '~',
  91. the empty part, 'a'.
  92. .PP
  93. Then the initial part of the remainder of each string which
  94. consists entirely of digit characters is determined. The
  95. numerical values of these two parts are compared, and any
  96. difference found is returned as the result of the comparison.
  97. For these purposes an empty string (which can only occur at
  98. the end of one or both version strings being compared) counts
  99. as zero.
  100. .PP
  101. These two steps (comparing and removing initial non-digit
  102. strings and initial digit strings) are repeated until a
  103. difference is found or both strings are exhausted.
  104. .PP
  105. Note that the purpose of epochs is to allow us to leave behind
  106. mistakes in version numbering, and to cope with situations
  107. where the version numbering scheme changes. It is
  108. \fBnot\fP intended to cope with version numbers containing
  109. strings of letters which the package management system cannot
  110. interpret (such as 'ALPHA' or 'pre\-'), or with
  111. silly orderings.
  112. .SH CAVEATS
  113. The tilde character and its special sorting properties were introduced
  114. in dpkg, version 1.10 and some parts of dpkg-dev only gained
  115. support for it later in the 1.10.x series.
  116. .SH SEE ALSO
  117. .BR deb-control (5),
  118. .BR deb (5),
  119. .BR dpkg (1)
  120. .SH AUTHORS
  121. Copyright \(co 1996,1997,1998 Ian Jackson and Christian Schwarz
  122. .br
  123. Copyright \(co 2007 Frank Lichtenheld
  124. .sp
  125. This is free software; see the GNU General Public Licence version 2 or later
  126. for copying conditions. There is NO WARRANTY.