This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFE][PATCH] cygport: allow for subdirectory specification via CPAN_AUTHOR


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:

    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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]