Date: Mon, 21 Feb 2011 19:33:40 +0300 From: Andrej Zverev <andrej.zverev@gmail.com> To: "Philip M. Gollucci" <pgollucci@p6m7g8.com> Cc: freebsd-perl@freebsd.org Subject: Re: MASTER_SITES/MASTER_SITE_SUBDIR for perl ports Message-ID: <AANLkTinH5hP5cgrGVqQOxJyO3PwPJ-aPigiYtoW122OV@mail.gmail.com> In-Reply-To: <4D614914.8020603@p6m7g8.com> References: <20110210091512.GE81862@hal.rescomp.berkeley.edu> <20110210093934.GA75152@heechee.tobez.org> <4D5F3AE6.1010304@p6m7g8.com> <AANLkTiku98T88UnsnZaZt4poif0niRWKUQN0QcPfk2b0@mail.gmail.com> <4D614898.8090501@p6m7g8.com> <4D614914.8020603@p6m7g8.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Feb 20, 2011 at 8:02 PM, Philip M. Gollucci <pgollucci@p6m7g8.com>wrote: > On 2/20/2011 12:00 PM, Philip M. Gollucci wrote: > > On 2/19/2011 2:42 AM, Andrej Zverev wrote: > >> Do we need take some action for that situation? At current moment > normaly to > >> put inside Makefile MASTER_SITES=CPAN/../../ or same via subdir. Ideally > for > >> me is to bring some magic inside Mk. For example if MASTER_SITES = CPAN > let > >> MASTER_SITE_SUBDIR contain CPAN AUTHOR NAME. > > .............. > > > >> Example: > >> MASTER_SITES= CPAN > >> MASTER_SITE_SUBDIR= CPAN:DDUMONT > >> > >> Inside Mk parse DDUMONT to id/D/DD/DDUMONT and concatenate with > MASTER_SITE > >> (like right now). It looks more universal. CPAN: - keyword tell us to > use > >> new logic otherwise use old one. > > This is the same issue of pulling the CPAN dependency bits right? > > The list changes hourly. If we could keep the meta info up-to-date > > I think thats a great idea. tobez would have some thoughts here. > > > > > Bah, UI misread that. DDUMONT contains all the info you need. So I'm > in favor of it. > > Here is patch ( http://people.freebsd.org/~az/bsd.sites.mk.diff.txt )which implement stuff described above. Since my make(1) skill almost zero I don't know about correct writing such things. But it can work as proof-of-concept :-) And i do my copy-paste in inline :-) MASTER_SITE_SUBDIR= CPAN:DDUMONT Same as MASTER_SITE_SUBDIR= ../../authors/id/D/DD/DDUMONT diff -r d8f71caf03dd -r a4026a5097b8 Mk/bsd.sites.mk --- a/Mk/bsd.sites.mk Mon Feb 21 16:56:30 2011 +0300 +++ b/Mk/bsd.sites.mk Mon Feb 21 19:14:11 2011 +0300 @@ -913,7 +913,9 @@ .endif .if !defined(IGNORE_MASTER_SITE_PERL_CPAN) -MASTER_SITE_PERL_CPAN+= \ + +# Allow override +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/&,} \ @@ -928,6 +930,24 @@ 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%/ + +MASTER_SITE_PERL_CPAN_BY_ID+= \ + # Here we don't need %SUBDIR% + http://www.cpan.dk/modules/by-authors/id/${_PERL_CPAN_ID}/ \ + ftp://ftp.cpan.org/pub/CPAN/modules/by-authors/id/${_PERL_CPAN_ID} + http://backpan.cpan.org/modules/by-authors/id/${_PERL_CPAN_ID}/ \ + ftp://ftp.funet.fi/pub/languages/perl/CPAN/modules/by-authors/id/${_PERL_CPAN_ID}/ \ + +# Cut out our FLAG +_PERL_CPAN_FLAG = ${MASTER_SITE_SUBDIR:C/(CPAN):(.*)/\1/} +# Concat right ID (eg FLORA = F/FL/FLORA) +_PERL_CPAN_ID = ${MASTER_SITE_SUBDIR:C/^CPAN:(.)(.)(.*)$/\1\/\1\2\/\1\2\3/} + +# Apply only if CPAN:NAME found, otherwise use old way +.if !empty(_PERL_CPAN_ID) && ${_PERL_CPAN_FLAG} == "CPAN" + MASTER_SITE_PERL_CPAN=${MASTER_SITE_PERL_CPAN_BY_ID} +.endif + .endif #
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTinH5hP5cgrGVqQOxJyO3PwPJ-aPigiYtoW122OV>