From edwin@mavetju.org  Sun Nov  2 18:34:40 2003
Return-Path: <edwin@mavetju.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 349CE16A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  2 Nov 2003 18:34:40 -0800 (PST)
Received: from mag.barnet.com.au (mag.barnet.com.au [218.185.88.3])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 4D51043F3F
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  2 Nov 2003 18:34:39 -0800 (PST)
	(envelope-from edwin@mavetju.org)
Received: from extmail.barnet.com.au (tim.direct.int.barnet.com.au [10.10.10.2])
	by mag.barnet.com.au (Postfix) with ESMTP id D119B2257
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  3 Nov 2003 13:34:37 +1100 (EST)
Received: from extmail-auth.barnet.com.au (localhost [127.0.0.1])
	by extmail.barnet.com.au (Postfix) with ESMTP id 6EB431F22
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  3 Nov 2003 13:34:37 +1100 (EST)
Received: from k7.mavetju (unknown [203.111.122.2])
	by extmail-auth.barnet.com.au (Postfix) with ESMTP id 0BBDA1F1F
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  3 Nov 2003 13:34:37 +1100 (EST)
Received: by k7.mavetju (Postfix, from userid 1001)
	id D46386A7101; Mon,  3 Nov 2003 13:34:36 +1100 (EST)
Message-Id: <20031103023436.D46386A7101@k7.mavetju>
Date: Mon,  3 Nov 2003 13:34:36 +1100 (EST)
From: Edwin Groothuis <edwin@mavetju.org>
Reply-To: Edwin Groothuis <edwin@mavetju.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: bsd.port.mk - MASTER_SITE_SUBDIR grouping disentangling is broken
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         58853
>Category:       ports
>Synopsis:       bsd.port.mk - MASTER_SITE_SUBDIR grouping disentangling is broken
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    portmgr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Nov 02 18:40:12 PST 2003
>Closed-Date:    Mon Mar 08 14:17:33 PST 2004
>Last-Modified:  Mon Mar 08 14:17:33 PST 2004
>Originator:     Edwin Groothuis
>Release:        FreeBSD 4.8-RELEASE i386
>Organization:
-
>Environment:
System: FreeBSD k7.mavetju 4.8-RELEASE FreeBSD 4.8-RELEASE #0: Sun Aug 17 16:04:25 EST 2003 edwin@k7.mavetju:/usr/src/sys/compile/k7 i386

>Description:

See the makefile of net/pppoa:
    MASTER_SITES=           http://download.ethomson.com/download/ \
			    ${MASTER_SITE_SOURCEFORGE}
    MASTER_SITE_SUBDIR=     speedtouch
    DISTFILES=              ${SPEEDTOUCH}.tar.bz2 ${ALCATELDRIVER}

The output of "make all-fetchlist" is (amongst others)
    http://us.dl.sourceforge.net/speedtouch/speedtouch-1.2-beta2.tar.bz2

To disentangle the two distfiles and the two master_sites, use this:
    MASTER_SITES=           http://download.ethomson.com/download/:mngt \
			    ${MASTER_SITE_SOURCEFORGE:S/$/:src/}
    MASTER_SITE_SUBDIR=     speedtouch:src
    DISTFILES=              ${SPEEDTOUCH}.tar.bz2:src ${ALCATELDRIVER}:mngt

The output of "make all-fetchlist" is (amongst others)
    http://us.dl.sourceforge.net/speedtouch-1.2-beta2.tar.bz2

Note the lack of /speedtouch/ in the URL.

According to bsd.port.mk, version 1.468, around line 1917:
    .for _S in ${MASTER_SITE_SUBDIR}
    _S_TEMP=    ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
    .   if !empty(_S_TEMP)

The value of _S_TEMP is properly filled after the call. But the
call to empty() treats it as an empty variable.

>How-To-Repeat:

See example in description.

>Fix:

Try a different kind of voodoo? (that's a joke)
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->portmgr 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sun Nov 2 21:49:08 PST 2003 
Responsible-Changed-Why:  
Over to maintainers. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=58853 
State-Changed-From-To: open->closed 
State-Changed-By: edwin 
State-Changed-When: Mon Mar 8 13:52:34 PST 2004 
State-Changed-Why:  
http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/makefile-distfiles.html#PORTS-MASTER-SITES-N-EXAMPLE-DETAILED-USE-MASTER-SITE-SUBDIR 

Seems like portlint isn't warning enough about the MASTER_SITE_SUBDIR 
variables. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=58853 
>Unformatted:
