cannot distinguish version from revision in package Version string where hyphen is not present
Hello,
I am trying to parse Ubuntu package Version strings into version and revision, and also distinguish the upstream version where it may be different from the parsed version.
As I understand from the Debian policy manual a package Version string should include the revision, if any, appended after a hyphen to the version, while the version itself should represent the upstream version, so that apache2 2.4.10-8ubuntu2 indicates:
upstream: version 2.4.10
revision: 8ubuntu2 where 8 indicates Debian revision 8 and 2 indicates Ubuntu revision 2
Many packages appear not to conform to this. For example:
apt 0.8.16~
apt 1.0.1ubuntu2 (from ubuntu 14.04)
apt-clone 0.3.1~ubuntu11
apt-listchanges 2.85.13ubuntu2
None of these have a hyphen to separate any revision. Take the last example. Does it indicate version '2.85.1' revision '3ubuntu2', or version '2.85.13' revision 'ubuntu2', or just version '2.85.13ubuntu2' in which case it is not the upstream version at all.
If these Version strings are considered conforming to spec, then these packages have no revision, and the versions are as stated, in which case the upstream version is still not apparent (determinable).
Other package Version strings do have a hyphen separating a revision from the version, but the version is still obviously not the upstream version. For example:
account-plugins 0.11+14.
xchat-gnome 1:0.30.
x11proto-randr 1.4.0+git201201
In summary, my questions:
1. If a Version string such as that for apt 0.8.16~
2. How does one distinguish the upstream version where any parsed version from the Version string is clearly different, e.g. versions "2.85.13ubuntu2" or "0.30.0~
Any light you can shed on this would be much appreciated.
Best regards,
Stephen Quintero
<email address hidden>
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Ubuntu apt Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask stephen quintero for more information if necessary.