PDA

View Full Version : Portversion and version of software ?


SPlissken
March 20th, 2009, 07:33
Hi all

Yesterday i did a portversion -v to see all version package , and one strange think was that version package and version of software seem not to be the same

Example :
For mplayer
portversion say :
mplayer-0.99.11_7 < needs updating (port has 0.99.11_12)

and mplayer show :
[splissken@SPFreeBSD ~]$ mplayer
MPlayer 1.0rc2-4.2.1 (C) 2000-2007 MPlayer Team

Port tree is up to date

ale
March 20th, 2009, 07:45
Well, 0.99~=1.0rc2 ;)
I think that it is so to not confuse the comparison of installed/ports versions as 1.0rc2 will be greater than 1.0.

Carpetsmoker
March 20th, 2009, 10:08
Well, 0.99~=1.0rc2
I think that it is so to not confuse the comparison of installed/ports versions as 1.0rc2 will be greater than 1.0.

There are other ways of doing this, like using 1.0.0, 1.0.1, ect, or using PORTEPOCH.

SirDice
March 20th, 2009, 12:22
The answer is in /usr/ports/multimedia/mplayer/Makefile.shared:


MPLAYER_PORT_VERSION= 0.99.11

DISTNAME= MPlayer-1.0rc2

The why is beyond me though :e

ale
March 20th, 2009, 13:25
What I was thinking is that if a vendor jump from 0.9 to something like 1.0rc2 and than to 1.0, if there are tools that rely on sort or string comparison to determine if the installed version in newer then the one in ports, they can get confused.
Look at the output of this example to see what could happen
for VER in 0.9 1.0rc2 1.0; do echo $VER; done | sort

Carpetsmoker
March 20th, 2009, 14:27
Yes, that's why PORTEPOCH is around, from /usr/ports/Mk/bsd.port.mk

# PORTEPOCH - Optional. In certain odd cases, the PORTREVISION logic
# can be fooled by ports that appear to go backwards
# numerically (e.g. if port-0.3 is newer than port-1998).
# In this case, incrementing PORTEPOCH forces the revision.
# Default: 0 (no effect).


Many ports use this, for some quick examples you can do ls -d /var/db/pkg/*,? and get a list of ports you have installed that set PORTEPOCH.
Or if you want lots of examples: cat /usr/ports/INDEX | cut -d '|' -f 2,1 | egrep '.*,[0-9]*'