ports/154994: [patch] enhancements MASTER_SITE_PERL_CPAN bsd.sites.mk
Andrej Zverev
az at FreeBSD.org
Thu Feb 24 08:30:12 UTC 2011
>Number: 154994
>Category: ports
>Synopsis: [patch] enhancements MASTER_SITE_PERL_CPAN bsd.sites.mk
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Thu Feb 24 08:30:09 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator: Andrej Zverev
>Release:
>Organization:
>Environment:
>Description:
Due to the fact that CPAN has changed layout of distros [1] (by-modules symlink is no more active) the
entire process of forming our beautiful links in ports lost relevance and now we have the
entropy increase.
MASTER_SITES = CPAN /../../
or
MASTER_SITES = CPAN
MASTER_SITE_SUBDIR =../../
After a brief discussion in the freebsd-perl@ mailing list has been worked out a solution[2]
which facilitates a new way to interact with CPAN. Since now the key resistance with value
name of the author, knowing only enough to find its own distribution.
The second important thing that was required - it is to maintain backward compatibility.
To use this method you need to register in MASTER_SITE_SUBDIR keyword (CPAN :<>). For example:
MASTER_SITES = CPAN
MASTER_SITE_SUBDIR = CPAN: FLORA
Without such magic keyword we will use old way to obtaion distro.
And this solution only work then using MASTER_SITE=CPAN.
Additional Information:
[1]
http://docs.freebsd.org/cgi/getmsg.cgi?fetch=87563+0+archive/2011/freebsd-perl/20110213.freebsd-perl
[2]
http://docs.freebsd.org/cgi/getmsg.cgi?fetch=219646+0+archive/2011/freebsd-perl/20110220.freebsd-perl
>How-To-Repeat:
>Fix:
You can also find patch to apply here: http://people.freebsd.org/~az/misc/patch-Mk-bsd-sites-mk.diff.txt
It also include fix for:
devel/p5-Class-Constant
devel/p5-Config-Model
www/p5-Jemplate
www/p5-WWW-Search-Google
which need to sure exp-run build OK.
--- patch-Mk-bsd-sites-mk.diff.txt begins here ---
Index: ports/Mk/bsd.sites.mk
===================================================================
RCS file: /home/pcvs/ports/Mk/bsd.sites.mk,v
retrieving revision 1.525
diff -u -r1.525 bsd.sites.mk
--- ports/Mk/bsd.sites.mk 18 Feb 2011 10:44:04 -0000 1.525
+++ ports/Mk/bsd.sites.mk 24 Feb 2011 08:16:07 -0000
@@ -913,21 +913,48 @@
.endif
.if !defined(IGNORE_MASTER_SITE_PERL_CPAN)
-MASTER_SITE_PERL_CPAN+= \
- ftp://ftp.cpan.org/pub/CPAN/modules/by-module/%SUBDIR%/ \
- http://www.cpan.dk/modules/by-module/%SUBDIR%/ \
- ${MASTER_SITE_RINGSERVER:S,%SUBDIR%,lang/perl/CPAN/modules/by-module/&,} \
- ftp://ftp.kddlabs.co.jp/lang/perl/CPAN/modules/by-module/%SUBDIR%/ \
- http://ftp.jaist.ac.jp/pub/CPAN/modules/by-module/%SUBDIR%/ \
- ftp://ftp.dti.ad.jp/pub/lang/CPAN/modules/by-module/%SUBDIR%/ \
- ftp://ftp.sunet.se/pub/lang/perl/CPAN/modules/by-module/%SUBDIR%/ \
- ftp://mirror.hiwaay.net/CPAN/modules/by-module/%SUBDIR%/ \
- ftp://ftp.mirrorservice.org/sites/ftp.funet.fi/pub/languages/perl/CPAN/modules/by-module/%SUBDIR%/ \
- http://at.cpan.org/modules/by-module/%SUBDIR%/ \
- ftp://ftp.auckland.ac.nz/pub/perl/CPAN/modules/by-module/%SUBDIR%/ \
- http://backpan.cpan.org/modules/by-module/%SUBDIR%/ \
- ftp://ftp.funet.fi/pub/languages/perl/CPAN/modules/by-module/%SUBDIR%/ \
- http://cpan.nctu.edu.tw/modules/by-module/%SUBDIR%/
+
+# Regulate the mode of obtain. By default using modules/by-module symlink and if
+# new method using authors/id/ in action.
+_PERL_CPAN_SORT?= modules/by-module
+
+# Please add URI to MASTER_SITE_PERL_CPAN_BY instead of this one.
+MASTER_SITE_PERL_CPAN?=
+
+# Actual list of MASTER SITES for CPAN
+MASTER_SITE_PERL_CPAN_BY+= \
+ ftp://ftp.cpan.org/pub/CPAN/%CPANSORT%/%SUBDIR%/ \
+ http://www.cpan.dk/%CPANSORT%/%SUBDIR%/ \
+ ftp://ftp.kddlabs.co.jp/lang/perl/CPAN/%CPANSORT%/%SUBDIR%/ \
+ http://ftp.jaist.ac.jp/pub/CPAN/%CPANSORT%/%SUBDIR%/ \
+ ftp://ftp.dti.ad.jp/pub/lang/CPAN/%CPANSORT%/%SUBDIR%/ \
+ ftp://ftp.sunet.se/pub/lang/perl/CPAN/%CPANSORT%/%SUBDIR%/ \
+ http://ring.nict.go.jp/archives/CPAN/%CPANSORT%/%SUBDIR%/ \
+ ftp://mirror.hiwaay.net/CPAN/%CPANSORT%/%SUBDIR%/ \
+ ftp://ftp.mirrorservice.org/sites/ftp.funet.fi/pub/languages/perl/CPAN/%CPANSORT%/%SUBDIR%/ \
+ http://at.cpan.org/%CPANSORT%/%SUBDIR%/ \
+ http://ring.riken.jp/archives/CPAN/%CPANSORT%/%SUBDIR%/ \
+ ftp://ftp.auckland.ac.nz/pub/perl/CPAN/%CPANSORT%/%SUBDIR%/ \
+ http://backpan.cpan.org/%CPANSORT%/%SUBDIR%/ \
+ ftp://ftp.funet.fi/pub/languages/perl/CPAN/%CPANSORT%/%SUBDIR%/ \
+ http://cpan.nctu.edu.tw/%CPANSORT%/%SUBDIR%/
+
+# Contain CPAN keyword otherwise empty
+_PERL_CPAN_FLAG = ${MASTER_SITE_SUBDIR:C/(CPAN):.*$/\1/}
+
+# Convert author ID into L2 cache hierarchy.
+# For example FLORA -> F/FL/FLORA, GRUBER -> G/GR/GRUBER
+_PERL_CPAN_ID = ${MASTER_SITE_SUBDIR:C/^CPAN:(.)(.)(.*)$/\1\/\1\2\/\1\2\3/}
+
+# If found CPAN keyword inside MASTER_SITE_SUBDIR must use new logic.
+# Also with new logic where no need in %SUBDIR%
+.if !empty(_PERL_CPAN_ID) && ${_PERL_CPAN_FLAG:L} == "cpan"
+ _PERL_CPAN_SORT= authors/id/${_PERL_CPAN_ID}
+ MASTER_SITE_PERL_CPAN=${MASTER_SITE_PERL_CPAN_BY:S/%CPANSORT%/${_PERL_CPAN_SORT}/:S/%SUBDIR%//}
+.else
+ MASTER_SITE_PERL_CPAN=${MASTER_SITE_PERL_CPAN_BY:S/%CPANSORT%/${_PERL_CPAN_SORT}/}
+.endif
+
.endif
#
Index: ports/devel/p5-Class-Constant/Makefile
===================================================================
RCS file: /home/pcvs/ports/devel/p5-Class-Constant/Makefile,v
retrieving revision 1.5
diff -u -r1.5 Makefile
--- ports/devel/p5-Class-Constant/Makefile 28 Aug 2010 05:55:53 -0000 1.5
+++ ports/devel/p5-Class-Constant/Makefile 24 Feb 2011 08:16:07 -0000
@@ -9,6 +9,7 @@
PORTVERSION= 0.06
CATEGORIES= devel perl5
MASTER_SITES= CPAN
+MASTER_SITE_SUBDIR= CPAN:ROBN
PKGNAMEPREFIX= p5-
MAINTAINER= perl at FreeBSD.org
Index: ports/devel/p5-Config-Model/Makefile
===================================================================
RCS file: /home/pcvs/ports/devel/p5-Config-Model/Makefile,v
retrieving revision 1.61
diff -u -r1.61 Makefile
--- ports/devel/p5-Config-Model/Makefile 22 Feb 2011 01:45:55 -0000 1.61
+++ ports/devel/p5-Config-Model/Makefile 24 Feb 2011 08:16:07 -0000
@@ -10,7 +10,7 @@
PORTVERSION= 1.234
CATEGORIES= devel perl5
MASTER_SITES= CPAN
-MASTER_SITE_SUBDIR= ../../authors/id/D/DD/DDUMONT
+MASTER_SITE_SUBDIR= CPAN:DDUMONT
PKGNAMEPREFIX= p5-
MAINTAINER= perl at FreeBSD.org
Index: ports/www/p5-Jemplate/Makefile
===================================================================
RCS file: /home/pcvs/ports/www/p5-Jemplate/Makefile,v
retrieving revision 1.5
diff -u -r1.5 Makefile
--- ports/www/p5-Jemplate/Makefile 28 Apr 2010 09:46:22 -0000 1.5
+++ ports/www/p5-Jemplate/Makefile 24 Feb 2011 08:16:07 -0000
@@ -9,7 +9,7 @@
PORTVERSION= 0.261
CATEGORIES= www perl5
MASTER_SITES= CPAN
-MASTER_SITE_SUBDIR= ../by-authors/id/R/RK/RKRIMEN
+MASTER_SITE_SUBDIR= CPAN:RKRIMEN
PKGNAMEPREFIX= p5-
MAINTAINER= lth at FreeBSD.org
Index: ports/www/p5-WWW-Search-Google/Makefile
===================================================================
RCS file: /home/pcvs/ports/www/p5-WWW-Search-Google/Makefile,v
retrieving revision 1.13
diff -u -r1.13 Makefile
--- ports/www/p5-WWW-Search-Google/Makefile 18 Apr 2008 02:24:08 -0000 1.13
+++ ports/www/p5-WWW-Search-Google/Makefile 24 Feb 2011 08:16:07 -0000
@@ -10,6 +10,7 @@
PORTEPOCH= 1
CATEGORIES= www perl5
MASTER_SITES= CPAN
+MASTER_SITE_SUBDIR= CPAN:LBROCARD
PKGNAMEPREFIX= p5-
MAINTAINER= perl at FreeBSD.org
--- patch-Mk-bsd-sites-mk.diff.txt ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list