forked from HPR/hpr_generator
		
	#267 - remove dependency check for DBD::mysql
This commit is contained in:
		| @@ -18,7 +18,7 @@ | ||||
| #      REVISION:  --- | ||||
| #=============================================================================== | ||||
|  | ||||
| set -o nounset                              # Treat unset variables as an error | ||||
| set -o nounset # Treat unset variables as an error | ||||
|  | ||||
| #---  FUNCTION  ---------------------------------------------------------------- | ||||
| #          NAME: is_module_installed | ||||
| @@ -27,47 +27,41 @@ set -o nounset                              # Treat unset variables as an error | ||||
| #       RETURNS: 0 if not found, 1 if found | ||||
| #------------------------------------------------------------------------------- | ||||
| function is_module_installed { | ||||
| 	HR="----------------------" | ||||
| 	perl -e "use ${1} "  | ||||
| 	if  [ $? -ne 0 ] | ||||
| 	then | ||||
| 		echo ${HR} | ||||
| 	else | ||||
| 		echo "Found module ${1}" | ||||
| 		echo ${HR} | ||||
| 	fi | ||||
|   HR="----------------------" | ||||
|   perl -e "use ${1} " | ||||
|   if [ $? -ne 0 ]; then | ||||
|     echo ${HR} | ||||
|   else | ||||
|     echo "Found module ${1}" | ||||
|     echo ${HR} | ||||
|   fi | ||||
| } | ||||
|  | ||||
| MODULES=( \ | ||||
| 	 "Getopt::Long" \ | ||||
| 	 "Pod::Usage" \ | ||||
| 	 "Config::Std" \ | ||||
| 	 "Template" \ | ||||
| 	 "Template::Plugin::File" \ | ||||
| 	 "Template::Plugin::DBI" \ | ||||
| 	 "Template::Plugin::HTML::Strip" \ | ||||
| 	 "DBI" \ | ||||
| 	 "Tie::DBI" \ | ||||
| 	 "DBD::SQLite" \ | ||||
| 	 "DBD::mysql" \ | ||||
| 	 "Date::Calc" \ | ||||
| 	 "Text::CSV_XS" \ | ||||
| MODULES=( | ||||
|   "Getopt::Long" | ||||
|   "Pod::Usage" | ||||
|   "Config::Std" | ||||
|   "Template" | ||||
|   "Template::Plugin::File" | ||||
|   "Template::Plugin::DBI" | ||||
|   "Template::Plugin::HTML::Strip" | ||||
|   "DBI" | ||||
|   "Tie::DBI" | ||||
|   "DBD::SQLite" | ||||
|   "Date::Calc" | ||||
|   "Text::CSV_XS" | ||||
| ) | ||||
|  | ||||
| echo "The following modules must be installed for the site-generator to function: " | ||||
| for module in "${MODULES[@]}" | ||||
| do | ||||
| 	echo "* ${module}" | ||||
| for module in "${MODULES[@]}"; do | ||||
|   echo "* ${module}" | ||||
| done | ||||
| echo "When MySQL is used, the DBD:mysql module is required (otherwise it is optional)" | ||||
| echo "When SQLite is used, then the DBD:SQLite module is required (otherwise it is optional)" | ||||
|  | ||||
| echo "Scanning for modules ..." | ||||
| echo "----------------------" | ||||
|  | ||||
| for module in "${MODULES[@]}" | ||||
| do | ||||
| 	is_module_installed "${module}" | ||||
| for module in "${MODULES[@]}"; do | ||||
|   is_module_installed "${module}" | ||||
| done | ||||
|  | ||||
| echo "Finished scanning." | ||||
|   | ||||
		Reference in New Issue
	
	Block a user