Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Sep 2003 19:26:29 +0200
From:      Oliver Eikemeier <eikemeier@fillmore-labs.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        portmgr@FreeBSD.org
Subject:   ports/56960: [PATCH] bsd.port.mk: Don't accept PORTVERSIONS that pkg_version can't handle
Message-ID:  <3F689945.4060804@fillmore-labs.com>
Resent-Message-ID: <200309171730.h8HHUIr9080146@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         56960
>Category:       ports
>Synopsis:       [PATCH] bsd.port.mk: Don't accept PORTVERSIONS that pkg_version can't handle
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Sep 17 10:30:17 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     Oliver Eikemeier
>Release:        FreeBSD 5.1-CURRENT i386
>Organization:
Fillmore Labs - http://www.fillmore-labs.com
>Environment:
System: FreeBSD nuuk.fillmore-labs.com 5.1-CURRENT

>Description:

pkg_version (and portupgrade) have to scan PKGNAME for version number.
They look for the last '-', so if PORTVERSION contains a hyphen they
miss the most significant part of the version number.

For a list of ports with a hyphen in their version see PR 56958.

>How-To-Repeat:
>Fix:

The following patch marks ports with non-conforming version numbers as BROKEN and
builds the with the special characters replaced by dots.

--- bsd.port.mk.patch begins here ---
--- bsd.port.mk.orig	Wed Sep  3 21:50:24 2003
+++ bsd.port.mk	Wed Sep 17 19:05:21 2003
@@ -935,6 +935,10 @@
 	@${FALSE}
 .endif
 
+.if ${PORTVERSION:M*[-_,]*}x != x
+BROKEN=		"PORTVERSION ${PORTVERSION} may not contain '-' '_' or ','"
+.endif
+
 PORTREVISION?=	0
 .if ${PORTREVISION} != 0
 _SUF1=	_${PORTREVISION}
@@ -945,7 +949,7 @@
 _SUF2=	,${PORTEPOCH}
 .endif
 
-PKGNAME=	${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-${PORTVERSION}${_SUF1}${_SUF2}
+PKGNAME=	${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-${PORTVERSION:C/[-_,]/./g}${_SUF1}${_SUF2}
 DISTNAME?=	${PORTNAME}-${PORTVERSION}
 
 # These need to be absolute since we don't know how deep in the ports
--- bsd.port.mk.patch begins here ---

Of course, the Makefile could catch more cases with:
.if ${PORTVERSION:C/[^0-9a-z.]/_/:M*_*}x != x
BROKEN=		"PORTVERSION ${PORTVERSION} may only consist of lowercase letters, numbers and dots"
.endif

and

PKGNAME=	${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-${PORTVERSION:L:C/[^0-9a-z.]/./g}${_SUF1}${_SUF2}

or at least do

PKGNAME=	${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-${PORTVERSION:C/[-_,+]/./g}${_SUF1}${_SUF2}

to catch cases like 1.0+2003.11.17 < 1.0.1+2003.11.17.

The decision is up to portmgr@

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3F689945.4060804>