SPECS: new-cpan.sh - work with direct urls, in case cpan can't fin...

glen glen at pld-linux.org
Mon Sep 5 14:45:00 CEST 2005


Author: glen                         Date: Mon Sep  5 12:45:00 2005 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- work with direct urls, in case cpan can't find  the packages

---- Files affected:
SPECS:
   new-cpan.sh (1.2 -> 1.3) 

---- Diffs:

================================================================
Index: SPECS/new-cpan.sh
diff -u SPECS/new-cpan.sh:1.2 SPECS/new-cpan.sh:1.3
--- SPECS/new-cpan.sh:1.2	Mon Sep  5 14:11:09 2005
+++ SPECS/new-cpan.sh	Mon Sep  5 14:44:55 2005
@@ -1,12 +1,13 @@
 #!/bin/sh
-pkg=$1
-pkg=$(echo $1 | sed -e 's,::,-,g;s,^perl-,,')
+# argument $1 can be URL, perl module name and name of .spec
+uri=$(echo $1 | sed -e 's,::,-,g;s,^perl-,,;s,\.spec$,,')
+pkg=$(basename $uri | sed -e 's,\(-[\.0-9]*\)\?\.tar\.gz$,,')
 spec=$(echo $pkg | sed -e 's,^,perl-,').spec
 
-cpan2rpm $pkg
+cpan2rpm $uri
 # pldcpan can't work with tar.gz, uncompress
-gzip -d ../SOURCES/$pkg-*.tar.gz 
-pldcpan ../SOURCES/$pkg-*.tar 
+gzip -fd ../SOURCES/$pkg-*.tar.gz
+pldcpan ../SOURCES/$pkg-*.tar
 rm -rf $pkg*
 
 # revert back to tar.gz
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/new-cpan.sh?r1=1.2&r2=1.3&f=u




More information about the pld-cvs-commit mailing list