aboutsummaryrefslogtreecommitdiffstats
path: root/Mk/bsd.sites.mk
diff options
context:
space:
mode:
authoraz <az@FreeBSD.org>2011-02-28 22:09:00 +0800
committeraz <az@FreeBSD.org>2011-02-28 22:09:00 +0800
commit2c9f11f4c561328e9b9a3af17b5eb2506aa1a211 (patch)
tree1af192a3e58d4bcae399bb842287eafc35d4be8e /Mk/bsd.sites.mk
parent9b52e005e0276786ddfd6e6959db07d8d908f05c (diff)
downloadfreebsd-ports-graphics-2c9f11f4c561328e9b9a3af17b5eb2506aa1a211.tar.gz
freebsd-ports-graphics-2c9f11f4c561328e9b9a3af17b5eb2506aa1a211.tar.zst
freebsd-ports-graphics-2c9f11f4c561328e9b9a3af17b5eb2506aa1a211.zip
Introduce new way to handle CPAN master sites.
All related information can be found inside PR. PR: ports/154994 Submitted by: az@ Tested by: miwi@ (exp-run)
Diffstat (limited to 'Mk/bsd.sites.mk')
-rw-r--r--Mk/bsd.sites.mk50
1 files changed, 34 insertions, 16 deletions
diff --git a/Mk/bsd.sites.mk b/Mk/bsd.sites.mk
index 7bc68a42449..cd5a12804c4 100644
--- a/Mk/bsd.sites.mk
+++ b/Mk/bsd.sites.mk
@@ -913,22 +913,40 @@ MASTER_SITE_PACKETSTORM+= \
.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.perl.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%/ \
- http://backpan.cpan.org/modules/by-module/%SUBDIR%/
+
+_PERL_CPAN_SORT?= modules/by-module
+
+# Please add URI to MASTER_SITE_PERL_CPAN_BY instead of this one.
+MASTER_SITE_PERL_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.perl.org/%CPANSORT%/%SUBDIR%/ \
+ ftp://ftp.funet.fi/pub/languages/perl/CPAN/%CPANSORT%/%SUBDIR%/ \
+ http://cpan.nctu.edu.tw/%CPANSORT%/%SUBDIR%/
+
+_PERL_CPAN_FLAG = ${MASTER_SITE_SUBDIR:C/(CPAN):.*$/\1/}
+
+_PERL_CPAN_ID = ${MASTER_SITE_SUBDIR:C/^CPAN:(.)(.)(.*)$/\1\/\1\2\/\1\2\3/}
+
+.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
#