ports/98909: [PATCH] bsd.port.mk: Extend DISTVERSION->PORTVERSION auto-conversion to cover month names

Shaun Amott shaun at inerd.com
Tue Jun 13 18:20:19 UTC 2006


>Number:         98909
>Category:       ports
>Synopsis:       [PATCH] bsd.port.mk: Extend DISTVERSION->PORTVERSION auto-conversion to cover month names
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jun 13 18:20:18 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Shaun Amott
>Release:        FreeBSD 6.1-STABLE i386
>Organization:
>Environment:

>Description:

bsd.port.mk does a nice job of creating PORTVERSION from DISTVERSION,
but the conversion code could be improved to deal with month names
within DISTVERSION.

For example:
    DISTVERSION= 2005-Jan-11  -> PORTVERSION= 2005.j.11

    This isn't much use, because Febuary's release will appear older.

With the proposed patch:
    DISTVERSION= 2005-Jan-11  -> PORTVERSION= 2005.01.11

A quick sweep of the ports tree didn't reveal any ports that would be
affected by this change.

>How-To-Repeat:

>Fix:

--- bsd.port.mk.diff.2 begins here ---
Index: bsd.port.mk
===================================================================
RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.533
diff -u -r1.533 bsd.port.mk
--- bsd.port.mk	23 May 2006 21:53:18 -0000	1.533
+++ bsd.port.mk	13 Jun 2006 18:16:07 -0000
@@ -1197,7 +1197,14 @@
 .endif
 DISTVERSION?=	${PORTVERSION:S/:/::/g}
 .elif defined(DISTVERSION)
-PORTVERSION=	${DISTVERSION:L:C/([a-z])[a-z]+/\1/g:C/([0-9])([a-z])/\1.\2/g:C/:(.)/\1/g:C/[^a-z0-9+]+/./g}
+_MONTHNUM=      0
+_DISTVERSION:=  ${DISTVERSION}
+.for MONTH in jan(uary)? feb(ruary)? mar(ch)? apr(il)? may june? july? \
+              aug(ust)? sep(tember)? oct(ober)? nov(ember)? dec(ember)?
+_MONTHNUM!=     ${PRINTF} %02d `${EXPR} ${_MONTHNUM} + 1`
+_DISTVERSION:=	${_DISTVERSION:L:C/${MONTH}/${_MONTHNUM}/g}
+.endfor
+PORTVERSION=	${_DISTVERSION:L:C/([a-z])[a-z]+/\1/g:C/([0-9])([a-z])/\1.\2/g:C/:(.)/\1/g:C/[^a-z0-9+]+/./g}
 .endif
 
 PORTREVISION?=	0
--- bsd.port.mk.diff.2 ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list