Bug 52706 - [patch] bsd.port.mk issues warning if a site is explicitly declared :DEFAULT
Summary: [patch] bsd.port.mk issues warning if a site is explicitly declared :DEFAULT
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Bryan Drewery
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-26 21:00 UTC by alex.neyman
Modified: 2013-10-07 11:40 UTC (History)
0 users

See Also:


Attachments
file.diff (1.58 KB, patch)
2003-05-26 21:00 UTC, alex.neyman
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description alex.neyman 2003-05-26 21:00:26 UTC
	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

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):

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
Comment 1 Tilman Keskinoz freebsd_committer freebsd_triage 2003-05-30 13:02:17 UTC
Responsible Changed
From-To: freebsd-ports-bugs->portmgr

bsd.port.mk patch, Over to Maintainer
Comment 2 Mario Sergio Fujikawa Ferreira freebsd_committer freebsd_triage 2003-05-30 17:57:57 UTC
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
Comment 3 alex.neyman 2003-06-01 16:42:06 UTC
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 )-'
Comment 4 Mark Linimon freebsd_committer freebsd_triage 2007-05-25 03:47:58 UTC
State Changed
From-To: open->feedback

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?
Comment 5 Mark Linimon freebsd_committer freebsd_triage 2008-03-01 20:11:33 UTC
State Changed
From-To: feedback->suspended

No one seems to be working on a patch ATM.
Comment 6 Bryan Drewery freebsd_committer freebsd_triage 2013-04-14 19:45:30 UTC
State Changed
From-To: suspended->open

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 


Comment 7 Bryan Drewery freebsd_committer freebsd_triage 2013-04-14 19:45:30 UTC
Responsible Changed
From-To: portmgr->bdrewery

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
Comment 8 Bryan Drewery freebsd_committer freebsd_triage 2013-10-07 11:37:15 UTC
State Changed
From-To: open->closed

Committed. Thanks!
Comment 9 dfilter service freebsd_committer freebsd_triage 2013-10-07 11:37:16 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"