SPECS: new-cpan.sh - check for tools early

glen glen at pld-linux.org
Tue Jan 17 11:35:34 CET 2006


Author: glen                         Date: Tue Jan 17 10:35:34 2006 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- check for tools early

---- Files affected:
SPECS:
   new-cpan.sh (1.4 -> 1.5) 

---- Diffs:

================================================================
Index: SPECS/new-cpan.sh
diff -u SPECS/new-cpan.sh:1.4 SPECS/new-cpan.sh:1.5
--- SPECS/new-cpan.sh:1.4	Thu Nov  3 21:32:56 2005
+++ SPECS/new-cpan.sh	Tue Jan 17 11:35:29 2006
@@ -1,5 +1,17 @@
 #!/bin/sh
 set -e
+toolcheck() {
+	local tool="$1"
+
+	if [ -z "$(which $tool 2>/dev/null)" ]; then
+		echo "Can't locate $tool. please install it"
+		exit 1
+	fi
+}
+
+toolcheck cpan2rpm
+toolcheck pldcpan
+
 # 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$,,')
================================================================

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



More information about the pld-cvs-commit mailing list