Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 May 2006 18:44:24 +0000
From:      Coleman Kane <cokane@FreeBSD.org>
To:        FreeBSD Ports <freebsd-ports@freebsd.org>
Subject:   RFC: Standardize and improve the PKGNAMESUFFIX handling in all ports
Message-ID:  <20060512184424.GA57858@ramen.coleyandcheryl>

next in thread | raw e-mail | index | archive | help
Hello all,

During some discussion, the existence of two problems in ports
arose today surrounding handling of PKGNAMESUFFIX in the ports collection.

First of all, the ability for it to handle multiple suffixes is broken
in many ports, and not intuitive to accomplish, and the declaration of
such option is not standard.
Currently, if you have a port that has a toggle to reflect in the package
name, you use "packagename+toggle-versioninfo". In many ports, this is 
accomplished via:
PKGNAMESUFFIX=	+toggle

If you want to add more than one toggle, you'd do:
PKGNAMESUFFIX:="${PACKAGENAMESUFFIX}+toggle1"
...
PKGNAMESUFFIX:="${PACKAGENAMESUFFIX}+toggle2"

To get 'packagename+toggle1+toggle2-versioninfo'.

Unfortunately, this is not done in many ports (such as ruby18), and the
nomenclature swaps plus and hyphen for the 'toggle separator'.

I propose that we do this:
      Add to line 1199 of ports/Mk/bsd.port.mk
_JOINEDPKGNAMESUFFIX?=
.for _PKGNAMESUFFIXCOMPONENT in ${PKGNAMESUFFIX:O:u}
  _JOINEDPKGNAMESUFFIX:="${_JOINEDPKGNAMESUFFIX}+${_PKGNAMESUFFIXCOMPONENT}"
.endfor

Change line 1207:
PKGNAME=    ${PKGNAMEPREFIX}${PORTNAME}${_JOINEDPKGNAMESUFFIX}-${PORTVERSION:C/[-_,]/./g}${_SUF1}${_SUF2}

Change line 2620:
PKGBASE?=           ${PKGNAMEPREFIX}${PORTNAME}${_JOINEDPKGNAMESUFFIX}

And then, rather than literally specifying the PKGNAMESUFFIX, you would do this:
PKGNAMESUFFIX+=	toggle1
...
PKGNAMESUFFIX+=	toggle2

Which is far more intuitive and more readable.

And the addition at line 1199, specified above, would automagically add the
+ delimiters, order the toggles alphabetically, and weed out the duplicates.

This could be one more step toward a more manageable package infrastructure.

As I said, this is an RFC so give me comments!

--
Coleman Kane



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