Dec 222005

When I started writing FreshPorts (The Place For Ports) back in the late 1990’s, I was under the impression that a port had just one version. The current version. There is only one ports tree. There isn’t one ports tree for FreeBSD 4 and another for FreeBSD 5, and yet another for FreeBSD 6. There’s just one. Yet, I was wrong.

The case in point: x11/nvidia-driver. At that URL, you’ll see that FreshPorts thinks the latest version is 1.0.6113_4. But if you look at the commit for 15 Dec 2005, you see:

Update to version 1.0-8174, the latest from nVidia.

What? So why is FreshPorts getting it wrong?

First, it’s not getting it wrong. FreshPorts runs on FreeBSD 4.11. Here’s what it sees:

[dan@polo:/usr/ports/x11/nvidia-driver] $ make -V PORTVERSION
[dan@polo:/usr/ports/x11/nvidia-driver] $

OK, so what version of the Makefile do I have?

# New ports collection makefile for:    nvidia-driver
# Date created:                         4 December 2002
# Whom:                                 Stijn Hoop 
# $FreeBSD: ports/x11/nvidia-driver/Makefile,v 1.41 2005/12/15 12:53:50 danfe Exp $

PORTNAME=       nvidia-driver
[dan@polo:/usr/ports/x11/nvidia-driver] $

Checking with CVSWeb, I know that that is the correct version. So why don’t I see what the commit message says I should see?

Let’s try another machine, one that is running FreeBSD 5.4.

[dan@undef:/usr/ports/x11/nvidia-driver] $ uname -a
FreeBSD 5.4-STABLE FreeBSD 5.4-STABLE #0:
Sat Sep  3 13:03:52 EDT 2005  i386
[dan@undef:/usr/ports/x11/nvidia-driver] $ make -V PORTVERSION
[dan@undef:/usr/ports/x11/nvidia-driver] $

Ahh, there’s the "right" version. Let’s look closer at the Makefile, and you’ll see why this happens:

.if ${OSVERSION} < 503000
NVVERSION=      6113
PLIST_SUB+=     DIFFS="" DRVSO="@comment "
NVVERSION=      7174
EXTRA_PATCHES+= ${FILESDIR}/6113-patch-lib::Makefile
NVVERSION=      8174
.if ${OSVERSION} >= 600033
LIB_DEPENDS+=   m.3:${PORTSDIR}/misc/compat5x
PLIST_SUB+=     DIFFS="@comment " DRVSO=""

OK, the same port reports different versions on different releases. That’s lovely!

There are very few ports that do this. Thankfully. Granted, FreshPorts is not OSVERSION and ARCH aware, but work is underway to make BROKEN and FORBIDDEN messages specific to the version of FreeBSD you are running and to the platform you are using. Now it seems I must also track PORTVERSION, PORTREVISION, and PORTEPOCH for each OSVERSION and each ARCH.

Oh joy!

Sure, it’s very clever to do things this way. But from a databse design point of view, it’s a huge pain in the ass to cater for an extremely small number of ports.

That’s something for me to look forward to.

Website Pin Facebook Twitter Myspace Friendfeed Technorati Digg Google StumbleUpon Premium Responsive

  2 Responses to “A port can have more than one version”

  1. Another point: Some (slave-)ports have different versions depending on which master ports they are built with. Consider, for example, x11-toolkits/py-tkinter. According to FreshPorts, its current version is 2.2.2_1, yet if you have Python 2.3 installed, it’s 2.3.5_1. And with Python 2.4, you get 2.4.2_1.

  2. audio/aureal-kmod is also one port abusing of PORTVERSION/PORTREVISION.