[vhffs-dev] [svn] commit: r242 - /trunk/Makefile

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Author: beuss
Date: Sat Oct 28 12:07:55 2006
New Revision: 242

Log:
Improved et simpler perl module detection 


Modified:
    trunk/Makefile

Modified: trunk/Makefile
==============================================================================
--- trunk/Makefile (original)
+++ trunk/Makefile Sat Oct 28 12:07:55 2006
@@ -39,21 +39,13 @@
 	/usr/bin/apt-get install $(DEBIAN_PACKAGES)
 
 test-deps:
-	@perl -e "foreach ( qw(	$(PERL_MODULES) ) ){\
-   		    \$$found = 0;\
-        	\$$dep = \$$_;\
-        	\$$dep =~ s/::/\//g;\
-        	\$$dep .=\".pm\";\
-	        foreach \$$dir ( @INC )\
-			{\
-				\$$file = \$$dir . \"/\" . \$$dep; \$$found = 1 if( -f \$$file );\
-        	}\
-        	if( \$$found == 0 )\
-        	{\
-				print \"Error, \$$_ perl-module is not installed\n\";\
-                exit( 1 );\
-        	}\
-		}\
+	@perl -e " \
+		foreach ( qw( $(PERL_MODULES) ) ) { \
+			if( eval \"require \$$_;\" == 0 ) { \
+				print \"\n\n** ERROR ** \$$_ perl-module is not installed\n\n\"; \
+				exit( 1 ); \
+			} \
+		} \
 		print \"Good all perl-deps are installed\n\"; exit( 0 );"
 
 install-shell: build-shell add-shell




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/