From avn@vagabond.auriga.ru  Mon May 26 12:52:48 2003
Return-Path: <avn@vagabond.auriga.ru>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id E13EF37B401
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 26 May 2003 12:52:47 -0700 (PDT)
Received: from vagabond.auriga.ru (vagabond.auriga.ru [80.240.102.246])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 0949243FA3
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 26 May 2003 12:52:47 -0700 (PDT)
	(envelope-from avn@vagabond.auriga.ru)
Received: from vagabond.auriga.ru (localhost [127.0.0.1])
	by vagabond.auriga.ru (8.12.9/8.12.9) with ESMTP id h4QJqfd7007044
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 26 May 2003 23:52:46 +0400 (MSD)
	(envelope-from avn@vagabond.auriga.ru)
Received: (from avn@localhost)
	by vagabond.auriga.ru (8.12.9/8.12.9/Submit) id h4QJqUVN007043;
	Mon, 26 May 2003 23:52:30 +0400 (MSD)
Message-Id: <200305261952.h4QJqUVN007043@vagabond.auriga.ru>
Date: Mon, 26 May 2003 23:52:30 +0400 (MSD)
From: Alexey Neyman <alex.neyman@auriga.ru>
Reply-To: Alexey Neyman <alex.neyman@auriga.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: bsd.port.mk issues warning if a site is explicitly declared :DEFAULT
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         52706
>Category:       ports
>Synopsis:       [patch] bsd.port.mk issues warning if a site is explicitly declared :DEFAULT
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bdrewery
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 26 13:00:26 PDT 2003
>Closed-Date:    Mon Oct 07 05:37:17 CDT 2013
>Last-Modified:  Mon Oct  7 10:40:00 UTC 2013
>Originator:     Alexey Neyman
>Release:        FreeBSD 5.1-BETA i386
>Organization:
Auriga, Inc.
>Environment:
System: FreeBSD vagabond.auriga.ru 5.1-BETA FreeBSD 5.1-BETA #0: Mon May 26 09:27:25 MSD 2003 avn@vagabond.auriga.ru:/usr/obj/usr/src/sys/VAGABOND i386

>Description:
	An example from the porter's handbook produces warnings from make.
	The problem occurs if at least one of MASTER_SITES has DEFAULT group
	explicitly listed. See an example below. The warnings are:

"bsd.port.mk", line 2019: warning: duplicate script for target "master-sites-DEFAULT" ignored

>How-To-Repeat:
	Below is a shar archive for Makefile/distinfo for a sample port that
	triggers this warning.


# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	Makefile
#	distinfo
#
echo x - Makefile
sed 's/^X//' >Makefile << 'END-of-Makefile'
XPORTNAME=Sample
XPORTVERSION=1.0
XCATEGORIES=archivers
X
XMAINTAINER=sample@sample.com
XCOMMENT=Sample
X
XMASTER_SITES=	http://site1/:DEFAULT
XDISTFILES=	file1
X
X.include "bsd.port.mk"
END-of-Makefile
echo x - distinfo
sed 's/^X//' >distinfo << 'END-of-distinfo'
XMD5 (file1) = d41d8cd98f00b204e9800998ecf8427e
END-of-distinfo
exit

>Fix:

The following patch fixes this problem
(by moving master-sites-DEFAULT and patch-sites-DEFAULT higher,
so that targets for port-supplied groups won't get duplicated):


--- bsd.port.mk.orig	Mon May 26 23:23:29 2003
+++ bsd.port.mk	Mon May 26 23:31:11 2003
@@ -1954,6 +1954,12 @@
 SORTED_MASTER_SITES_ALL_CMD=	cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} master-sites-ALL
 SORTED_PATCH_SITES_ALL_CMD=	cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} patch-sites-ALL
 
+# has similar effect to old targets, i.e., access only {MASTER,PATCH}_SITES, not working with the new _n variables
+master-sites-DEFAULT:
+	@echo ${_MASTER_SITE_OVERRIDE} `echo '${_MASTER_SITES_DEFAULT}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
+patch-sites-DEFAULT:
+	@echo ${_MASTER_SITE_OVERRIDE} `echo '${_PATCH_SITES_DEFAULT}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
+
 #
 # Sort the master site list according to the patterns in MASTER_SORT
 # according to grouping rules (:something)
@@ -2014,11 +2020,6 @@
 	@echo ${_MASTER_SITE_OVERRIDE} `echo '${_MASTER_SITES_ALL}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
 patch-sites-ALL:
 	@echo ${_MASTER_SITE_OVERRIDE} `echo '${_PATCH_SITES_ALL}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
-# has similar effect to old targets, i.e., access only {MASTER,PATCH}_SITES, not working with the new _n variables
-master-sites-DEFAULT:
-	@echo ${_MASTER_SITE_OVERRIDE} `echo '${_MASTER_SITES_DEFAULT}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
-patch-sites-DEFAULT:
-	@echo ${_MASTER_SITE_OVERRIDE} `echo '${_PATCH_SITES_DEFAULT}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
 
 # synonyms, mnemonics
 master-sites-all: master-sites-ALL


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->portmgr 
Responsible-Changed-By: arved 
Responsible-Changed-When: Fri May 30 05:02:17 PDT 2003 
Responsible-Changed-Why:  
bsd.port.mk patch, Over to Maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=52706 

From: Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Cc: Alexey Neyman <alex.neyman@auriga.ru>
Subject: Re: ports/52706: bsd.port.mk issues warning if a site is explicitly declared :DEFAULT
Date: Fri, 30 May 2003 13:57:57 -0300

 Hi,
 
 	I can't reproduce the warning you mentioned.
 I used both Makefile and distinfo you provided.
 
 $ make fetch DISTDIR=`pwd`
 >> file1 doesn't seem to exist in /tmp/b/.
 >> Attempting to fetch from http://site1/.
 fetch: http://site1/file1: Host not found
 >> Attempting to fetch from ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/.
 ^Cfetch: transfer interrupted
 
 	Can you provide a log of your tests?
 Also, make sure you're using the latest Ports Tree. CVSup update
 then try reproducing the problem again.
 
 	Regards,
 
 -- 
 Mario S F Ferreira - DF - Brazil - "I guess this is a signature."
 FreeBSD Committer | CS Developer
 flames to beloved devnull@someotherworldbeloworabove.org
 feature, n: a documented bug | bug, n: an undocumented feature

From: Alexey Neyman <alex.neyman@auriga.ru>
To: freebsd-gnats-submit@FreeBSD.org
Cc: lioux@freebsd.org
Subject: Re: ports/52706: bsd.port.mk issues warning if a site is explicitly declared :DEFAULT
Date: Sun, 1 Jun 2003 19:42:06 +0400

 Just CVSupped (bsd.port.mk rev 1.451), the problem persists:
 
 bash-2.05b# pwd
 /tmp/b
 bash-2.05b# ls -la
 total 8
 drwxr-xr-x   2 root  wheel  512  1  19:35 .
 drwxrwxrwt  17 root  wheel  512  1  19:38 ..
 -rw-r--r--   1 root  wheel  176  1  19:35 Makefile
 -rw-r--r--   1 root  wheel   47  1  19:35 distinfo
 bash-2.05b# cat Makefile
 PORTNAME=Sample
 PORTVERSION=1.0
 CATEGORIES=archivers
 
 MAINTAINER=sample@sample.com
 COMMENT=Sample
 
 MASTER_SITES=   http://site1/:DEFAULT
 DISTFILES=      file1
 
 .include "bsd.port.mk"
 bash-2.05b# cat distinfo
 MD5 (file1) = d41d8cd98f00b204e9800998ecf8427e
 bash-2.05b# make fetch DISTDIR=`pwd`
 "/usr/ports/Mk/bsd.port.mk", line 2019: warning: duplicate script for target "master-sites-DEFAULT" ignored
 >> file1 doesn't seem to exist in /tmp/b/.
 "/usr/ports/Mk/bsd.port.mk", line 2019: warning: duplicate script for target "master-sites-DEFAULT" ignored
 >> Attempting to fetch from http://site1/.
 fetch: http://site1/file1: Host not found
 >> Attempting to fetch from ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/.
 fetch: ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/file1: File unavailable (e.g., file not found, no access)
 >> Couldn't fetch it - please try to retrieve this
 >> port manually into /tmp/b/ and try again.
 *** Error code 1
 
 Stop in /tmp/b.
 bash-2.05b# make fetch-list DISTDIR=`pwd`
 "/usr/ports/Mk/bsd.port.mk", line 2019: warning: duplicate script for target "master-sites-DEFAULT" ignored
 "/usr/ports/Mk/bsd.port.mk", line 2019: warning: duplicate script for target "master-sites-DEFAULT" ignored
 /usr/bin/env /usr/bin/fetch -ARr http://site1/file1  || /usr/bin/env /usr/bin/fetch -ARr ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/file1  || echo file1 not fetched
 
 Is there any additional information I could provide?
 
 Regards,
 Alexey.
 
 -- 
 ,----------------------------------------,
 | A quoi ca sert d'etre sur la terre     | Alexey V. Neyman
 | Si c'est pour faire nos vies a genoux! | mailto:alex.neyman@auriga.ru
 `------------------( Les Rois du Monde )-'
 
State-Changed-From-To: open->feedback 
State-Changed-By: linimon 
State-Changed-When: Fri May 25 02:47:58 UTC 2007 
State-Changed-Why:  
After discussion, portmgr has come to the conclusion that a better fix 
would be to rename the internal DEFAULT target to avoid the ambiguity. 
Is someone interested in working on a patch for this? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=52706 
State-Changed-From-To: feedback->suspended 
State-Changed-By: linimon 
State-Changed-When: Sat Mar 1 20:11:33 UTC 2008 
State-Changed-Why:  
No one seems to be working on a patch ATM. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=52706 
State-Changed-From-To: suspended->open 
State-Changed-By: bdrewery 
State-Changed-When: Sun Apr 14 13:45:30 CDT 2013 
State-Changed-Why:  
Take. As I see it there is no ambiguity, DEFAULT and ALL are advertised 
as special in the PH 
(http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/makefile-distfiles.html#AEN1789). 
Moving the code up allows the special targets to not be redefined as the 
same thing again if used 


Responsible-Changed-From-To: portmgr->bdrewery 
Responsible-Changed-By: bdrewery 
Responsible-Changed-When: Sun Apr 14 13:45:30 CDT 2013 
Responsible-Changed-Why:  
Take. As I see it there is no ambiguity, DEFAULT and ALL are advertised 
as special in the PH 
(http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/makefile-distfiles.html#AEN1789). 
Moving the code up allows the special targets to not be redefined as the 
same thing again if used 

http://www.freebsd.org/cgi/query-pr.cgi?pr=52706 
State-Changed-From-To: open->closed 
State-Changed-By: bdrewery 
State-Changed-When: Mon Oct 7 05:37:15 CDT 2013 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=52706 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/52706: commit references a PR
Date: Mon,  7 Oct 2013 10:37:16 +0000 (UTC)

 Author: bdrewery
 Date: Mon Oct  7 10:37:08 2013
 New Revision: 329679
 URL: http://svnweb.freebsd.org/changeset/ports/329679
 
 Log:
   - Fix not being able to use :DEFAULT group in MASTER_SITES and PATCH_SITES.
     This is useful to be able to define extra mirrors in PATCH_SITES for
     a group, while still depending on the master list of PATCH_SITES
   
     For example:
   
       .if ${PORT_OPTIONS:MX509}
       PATCH_SITES=	http://mirror1/x509-${X509_VERSION}/:x509
       PATCHFILES=		${PORTNAME}-6.3p1+x509-${X509_VERSION}.diff.gz:-p1:x509
       .endif
       PATCH_SITES+=	http://mirror2/${PORTNAME}/:DEFAULT,x509
   
     This will use mirror1 only for the X509 option and mirror2 for X509. All
     other patches will use mirror2 but not mirror1.
   
   With hat:	portmgr
   PR:		ports/52706
   Submitted by:	Alexey Neyman <alex.neyman@auriga.ru>
 
 Modified:
   head/Mk/bsd.port.mk
 
 Modified: head/Mk/bsd.port.mk
 ==============================================================================
 --- head/Mk/bsd.port.mk	Mon Oct  7 10:36:07 2013	(r329678)
 +++ head/Mk/bsd.port.mk	Mon Oct  7 10:37:08 2013	(r329679)
 @@ -2701,6 +2701,12 @@ SORTED_PATCH_SITES_DEFAULT_CMD=		cd ${.C
  SORTED_MASTER_SITES_ALL_CMD=	cd ${.CURDIR} && ${MAKE} master-sites-ALL
  SORTED_PATCH_SITES_ALL_CMD=	cd ${.CURDIR} && ${MAKE} patch-sites-ALL
  
 +# has similar effect to old targets, i.e., access only {MASTER,PATCH}_SITES, not working with the new _n variables
 +master-sites-DEFAULT:
 +	@${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_MASTER_SITES_DEFAULT}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
 +patch-sites-DEFAULT:
 +	@${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_PATCH_SITES_DEFAULT}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
 +
  #
  # Sort the master site list according to the patterns in MASTER_SORT
  # according to grouping rules (:something)
 @@ -2761,11 +2767,6 @@ master-sites-ALL:
  	@${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_MASTER_SITES_ALL}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
  patch-sites-ALL:
  	@${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_PATCH_SITES_ALL}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
 -# has similar effect to old targets, i.e., access only {MASTER,PATCH}_SITES, not working with the new _n variables
 -master-sites-DEFAULT:
 -	@${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_MASTER_SITES_DEFAULT}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
 -patch-sites-DEFAULT:
 -	@${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_PATCH_SITES_DEFAULT}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
  
  # synonyms, mnemonics
  master-sites-all: master-sites-ALL
 _______________________________________________
 svn-ports-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-ports-all
 To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
 
>Unformatted:
