Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Is dpkg --compare-versions canonical?

6 views
Skip to first unread message

Russ Allbery

unread,
Aug 23, 2005, 1:10:16 PM8/23/05
to
dpkg --compare-versions provides exactly the ordering that I want, namely
that 1.4rc1 < 1.4.0 so by omitting the final patch number in the RC
revision I can use the correct upstream version without using epochs or
strange-looking version numbers. However, since this is a bit of an edge
case, I wanted to double-check and be sure that dpkg --compare-versions is
the canonical ordering for version numbers. I'm pretty sure it is, but
better safe than sorry to check.

Is there a document anywhere outside of the dpkg source that explains the
algorithm for how version numbers are ordered by the archive software?

--
Russ Allbery (r...@stanford.edu) <http://www.eyrie.org/~eagle/>


--
To UNSUBSCRIBE, email to debian-dev...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

martin f krafft

unread,
Aug 23, 2005, 1:20:15 PM8/23/05
to
also sprach Russ Allbery <r...@stanford.edu> [2005.08.23.1908 +0200]:

> case, I wanted to double-check and be sure that dpkg --compare-versions is
> the canonical ordering for version numbers. I'm pretty sure it is, but
> better safe than sorry to check.

Yes.

> Is there a document anywhere outside of the dpkg source that explains the
> algorithm for how version numbers are ordered by the archive software?

http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version

--
Please do not send copies of list mail to me; I read the list!

.''`. martin f. krafft <mad...@debian.org>
: :' : proud Debian developer and author: http://debiansystem.info
`. `'`
`- Debian - when you have better things to do than fixing a system

Invalid/expired PGP (sub)keys? Use subkeys.pgp.net as keyserver!

micro$oft: "you've got questions? we've got dancing paperclips."

signature.asc

Russ Allbery

unread,
Aug 23, 2005, 1:30:10 PM8/23/05
to
Thanks for the confirmation!

martin f krafft <mad...@debian.org> writes:
> also sprach Russ Allbery <r...@stanford.edu> [2005.08.23.1908 +0200]:

>> Is there a document anywhere outside of the dpkg source that explains


>> the algorithm for how version numbers are ordered by the archive
>> software?

> http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version

*sigh*. I'm sorry about that; I've read that several times but thought
something more complex was going on under the hood, since it didn't seem
to explain this case. I completely missed the following sentence:

| The lexical comparison is a comparison of ASCII values modified so that
| all the letters sort earlier than all the non-letters.

which does indeed entirely explain why "rc" sorts before ".".

Thank you for the kick in the right direction!

Goswin von Brederlow

unread,
Aug 23, 2005, 5:00:13 PM8/23/05
to
Russ Allbery <r...@stanford.edu> writes:

> Thanks for the confirmation!
>
> martin f krafft <mad...@debian.org> writes:
>> also sprach Russ Allbery <r...@stanford.edu> [2005.08.23.1908 +0200]:
>
>>> Is there a document anywhere outside of the dpkg source that explains
>>> the algorithm for how version numbers are ordered by the archive
>>> software?
>
>> http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version
>
> *sigh*. I'm sorry about that; I've read that several times but thought
> something more complex was going on under the hood, since it didn't seem
> to explain this case. I completely missed the following sentence:
>
> | The lexical comparison is a comparison of ASCII values modified so that
> | all the letters sort earlier than all the non-letters.
>
> which does indeed entirely explain why "rc" sorts before ".".
>
> Thank you for the kick in the right direction!

It is out of date since it does not explain ~ yet. Maybe, if you have
the time and since you just looked at the matter closely anyway, you
could draw up a few lines and send a patch?

MfG
Goswin

Russ Allbery

unread,
Aug 23, 2005, 5:00:19 PM8/23/05
to
Goswin von Brederlow <bred...@informatik.uni-tuebingen.de> writes:

> It is out of date since it does not explain ~ yet. Maybe, if you have
> the time and since you just looked at the matter closely anyway, you
> could draw up a few lines and send a patch?

I'm certainly willing to do so, but I thought that policy wasn't ready to
change yet. Wasn't it waiting on implementation of that feature in dak,
which is currently using ~ internally for something else?

Andreas Barth

unread,
Aug 23, 2005, 5:10:14 PM8/23/05
to
* Russ Allbery (r...@stanford.edu) [050823 22:58]:

> Goswin von Brederlow <bred...@informatik.uni-tuebingen.de> writes:
> > It is out of date since it does not explain ~ yet. Maybe, if you have
> > the time and since you just looked at the matter closely anyway, you
> > could draw up a few lines and send a patch?

> I'm certainly willing to do so, but I thought that policy wasn't ready to
> change yet. Wasn't it waiting on implementation of that feature in dak,
> which is currently using ~ internally for something else?

There is no reason to not update policy right now, as long as we add a
footnote that ~ cannot be used in uploads until dak is fixed.


Cheers,
Andi

martin f krafft

unread,
Aug 23, 2005, 5:10:21 PM8/23/05
to
also sprach Russ Allbery <r...@stanford.edu> [2005.08.23.2257 +0200]:

> I'm certainly willing to do so, but I thought that policy wasn't ready to
> change yet. Wasn't it waiting on implementation of that feature in dak,
> which is currently using ~ internally for something else?

Yes, APT and dpkg support ~, dak does not yet. Thus, it can't be
policy yet.

You could still file a bug with a patch and make the bug blocked by
the corresponding bug on dak. :)

--
Please do not send copies of list mail to me; I read the list!

.''`. martin f. krafft <mad...@debian.org>
: :' : proud Debian developer and author: http://debiansystem.info
`. `'`
`- Debian - when you have better things to do than fixing a system

Invalid/expired PGP (sub)keys? Use subkeys.pgp.net as keyserver!

"m.c.s.e": minesweeper consultant & solitaire expert

signature.asc

Otavio Salvador

unread,
Aug 23, 2005, 7:30:10 PM8/23/05
to
Andreas Barth <a...@not.so.argh.org> writes:

> * Russ Allbery (r...@stanford.edu) [050823 22:58]:
>> Goswin von Brederlow <bred...@informatik.uni-tuebingen.de> writes:
>> > It is out of date since it does not explain ~ yet. Maybe, if you have
>> > the time and since you just looked at the matter closely anyway, you
>> > could draw up a few lines and send a patch?
>
>> I'm certainly willing to do so, but I thought that policy wasn't ready to
>> change yet. Wasn't it waiting on implementation of that feature in dak,
>> which is currently using ~ internally for something else?
>
> There is no reason to not update policy right now, as long as we add a
> footnote that ~ cannot be used in uploads until dak is fixed.

And a patch for it was already included on dak package, IIRC. It only
need to be include on the code used on Debian servers.

--
O T A V I O S A L V A D O R
---------------------------------------------
E-mail: ota...@debian.org UIN: 5906116
GNU/Linux User: 239058 GPG ID: 49A5F855
Home Page: http://www.freedom.ind.br/otavio
---------------------------------------------
"Microsoft gives you Windows ... Linux gives
you the whole house."

Manoj Srivastava

unread,
Aug 30, 2005, 1:30:14 PM8/30/05
to
On Tue, 23 Aug 2005 23:03:05 +0200, Andreas Barth <a...@not.so.argh.org> said:

> * Russ Allbery (r...@stanford.edu) [050823 22:58]:
>> Goswin von Brederlow <bred...@informatik.uni-tuebingen.de> writes:
>> > It is out of date since it does not explain ~ yet. Maybe, if you
>> > have the time and since you just looked at the matter closely
>> > anyway, you could draw up a few lines and send a patch?

>> I'm certainly willing to do so, but I thought that policy wasn't
>> ready to change yet. Wasn't it waiting on implementation of that
>> feature in dak, which is currently using ~ internally for something
>> else?

> There is no reason to not update policy right now, as long as we add
> a footnote that ~ cannot be used in uploads until dak is fixed.

There is no tearing hurry to modify policy either. I would
rather not add provisions into policy that are not yet useable, and
add a temporal footnote preventing that use.This is just another case
of innovations getting ahead of policy, and then policy changes to
reflect reality.

manoj
--
UNIX is hot. It's more than hot. It's steaming. It's quicksilver
lightning with a laserbeam kicker. -- Michael Jay Tucker
Manoj Srivastava <sriv...@debian.org> <http://www.debian.org/%7Esrivasta/>
1024D/BF24424C print 4966 F272 D093 B493 410B 924B 21BA DABB BF24 424C

0 new messages