This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: [RFE][PATCH] cygport: allow for subdirectory specification via CPAN_AUTHOR
- From: Reini Urban <rurban at x-ray dot at>
- To: cygwin at cygwin dot com
- Date: Sat, 29 Sep 2012 12:51:15 -0500
- Subject: Re: [RFE][PATCH] cygport: allow for subdirectory specification via CPAN_AUTHOR
- References: <loom.20120926T132447-881@post.gmane.org>
On 09/26/2012 06:51 AM, Achim Gratz wrote:
Hi Yaakov,
several Perl distributions have chosen to put the actual archives in a
subdirectory (e.g. Inline::Files). So far I've dealt with those by editing
SRC_URI after "inherit perl", but I'd like something more straigtforward. I
propose that CPAN_AUTHOR should optionally include this additional subdirectory
as a "/subdir" suffix. Patch to that effect:
Just for easier understanding:
How would that look like for e.g.
A/AM/AMBS/Inline/Inline-Files-0.68.tar.gz
NAME=Inline-Files
inherit perl
CPAN_AUTHOR=AMBS/Inline
Looks a bit weird. Don't we have a better field for this cpan quirks?
Like a new CPAN_DIR which defaults to CPAN_AUTHOR?
Support subdirectories in CPAN download URL
* cygclass/perl.cygclass: Allow CPAN_AUTHOR to have a /subdir suffix.
This is necessary for some modules that put the distribution files
in some subdirectory. Only upcase the actual author name (up until
the first "/") and preserve case for the suffix part.
Modified cygclass/perl.cygclass
diff --git a/cygclass/perl.cygclass b/cygclass/perl.cygclass
index b4aecdf..4dbe824 100644
--- a/cygclass/perl.cygclass
+++ b/cygclass/perl.cygclass
@@ -139,9 +139,12 @@ HOMEPAGE="http://search.cpan.org/dist/${ORIG_PN}/"
# SEE ALSO
# mirror_cpan
#****
-cpan_author_ftp=${CPAN_AUTHOR^^}
-SRC_URI="mirror://cpan/authors/id/${cpan_author_ftp:0:1}
/${cpan_author_ftp:0:2}/${cpan_author_ftp}
/${ORIG_PN}-${PV}.${CPAN_TARBALL_SUFFIX:-tar.gz}"
+cpan_author_ftp="${CPAN_AUTHOR%%/*}"
+cpan_module_ftp="${CPAN_AUTHOR#${cpan_author_ftp}}"
+cpan_author_ftp="${cpan_author_ftp^^}"
+SRC_URI="mirror://cpan/authors/id/${cpan_author_ftp:0:1}
/${cpan_author_ftp:0:2}/${cpan_author_ftp}$cpan_module_ftp
/${ORIG_PN}-${PV}.${CPAN_TARBALL_SUFFIX:-tar.gz}"
unset cpan_author_ftp
+unset cpan_module_ftp
fi # defined CPAN_AUTHOR
(Watch for the linewrap)
Regards,
Achim
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple