From d942fc46f2ecd4b22df1f08ab41c91e00f3fe8ac Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Sep 23 2013 20:45:14 +0000 Subject: Update the tuneup module of centos-art.sh script. - Rename varialbe from MODULE_ to SUBMODULE_ to move tuneup sub-modules from module space to sub-module space. --- diff --git a/Automation/Modules/Tuneup/Modules/Sh/sh.conf.sh b/Automation/Modules/Tuneup/Modules/Sh/sh.conf.sh deleted file mode 100644 index 00da998..0000000 --- a/Automation/Modules/Tuneup/Modules/Sh/sh.conf.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -# -# sh.conf.sh -- This file defines environment variables for -# sh module's execution environment. -# -# Written by: -# * Alain Reguera Delgado , 2009-2013 -# -# Copyright (C) 2009-2013 The CentOS Project -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -###################################################################### - -declare -x TCAR_SCRIPT_MODULES_BASEDIR=${MODULE_DIR_MODULES} diff --git a/Automation/Modules/Tuneup/Modules/Sh/sh_setTopComment.sh b/Automation/Modules/Tuneup/Modules/Sh/sh_setTopComment.sh index ef12c09..83de5f1 100755 --- a/Automation/Modules/Tuneup/Modules/Sh/sh_setTopComment.sh +++ b/Automation/Modules/Tuneup/Modules/Sh/sh_setTopComment.sh @@ -25,7 +25,7 @@ function sh_setTopComment { - local COMMENT_TEMPLATE="${MODULE_DIR_CONFIGS}/topcomment.sed" + local COMMENT_TEMPLATE="${SUBMODULE_DIR_CONFIGS}/topcomment.sed" tcar_checkFiles -ef ${COMMENT_TEMPLATE} diff --git a/Automation/Modules/Tuneup/Modules/Svg/svg.conf.sh b/Automation/Modules/Tuneup/Modules/Svg/svg.conf.sh deleted file mode 100755 index 9a5ced0..0000000 --- a/Automation/Modules/Tuneup/Modules/Svg/svg.conf.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -# -# svg.conf.sh -- This file defines environment variables for svg -# module's execution environment. -# -# Written by: -# * Alain Reguera Delgado , 2009-2013 -# -# Copyright (C) 2009-2013 The CentOS Project -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -###################################################################### - -declare -x TCAR_SCRIPT_MODULES_BASEDIR=${MODULE_DIR_MODULES} diff --git a/Automation/Modules/Tuneup/Modules/Svg/svg_setMetadata.sh b/Automation/Modules/Tuneup/Modules/Svg/svg_setMetadata.sh index 7af256c..990599e 100755 --- a/Automation/Modules/Tuneup/Modules/Svg/svg_setMetadata.sh +++ b/Automation/Modules/Tuneup/Modules/Svg/svg_setMetadata.sh @@ -29,7 +29,7 @@ function svg_setMetadata { # Define template file name. - local TEMPLATE="${MODULE_DIR_CONFIGS}/metadata.sed" + local TEMPLATE="${SUBMODULE_DIR_CONFIGS}/metadata.sed" # Check template file existence. tcar_checkFiles -ef ${TEMPLATE} diff --git a/Automation/Modules/Tuneup/Modules/Xhtml/xhtml.conf.sh b/Automation/Modules/Tuneup/Modules/Xhtml/xhtml.conf.sh deleted file mode 100755 index 98ab3dc..0000000 --- a/Automation/Modules/Tuneup/Modules/Xhtml/xhtml.conf.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -# -# xhtml.conf.sh -- This file defines environment variables for xhtml -# module's execution environment. -# -# Written by: -# * Alain Reguera Delgado , 2009-2013 -# -# Copyright (C) 2009-2013 The CentOS Project -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -###################################################################### - -declare -x TCAR_SCRIPT_MODULES_BASEDIR=${MODULE_DIR_MODULES} diff --git a/Automation/Modules/Tuneup/Modules/Xhtml/xhtml_setToc.sh b/Automation/Modules/Tuneup/Modules/Xhtml/xhtml_setToc.sh index da458fd..8c259f1 100755 --- a/Automation/Modules/Tuneup/Modules/Xhtml/xhtml_setToc.sh +++ b/Automation/Modules/Tuneup/Modules/Xhtml/xhtml_setToc.sh @@ -60,7 +60,7 @@ function xhtml_setToc { # Define table of content configuration file, the file used to # produce the table of content XHTML output code. - local TOC_CONFIG=${MODULE_DIR_CONFIGS}/toc.awk + local TOC_CONFIG=${SUBMODULE_DIR_CONFIGS}/toc.awk # Verify table of content configuration file. tcar_checkFiles -ef ${TOC_CONFIG} diff --git a/Automation/Modules/Tuneup/tuneup.conf.sh b/Automation/Modules/Tuneup/tuneup.conf.sh deleted file mode 100644 index 76cd45c..0000000 --- a/Automation/Modules/Tuneup/tuneup.conf.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -###################################################################### -# -# tuneup.conf.sh -- This file defines environment variables for -# tuneup module's execution environment. -# -# Written by: -# * Alain Reguera Delgado , 2009-2013 -# -# Copyright (C) 2009-2013 The CentOS Project -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -###################################################################### - -declare -x TCAR_SCRIPT_MODULES_BASEDIR=${MODULE_DIR_MODULES} - -# Define file extensions tuneup module will look for processing. -declare -xr FILE_EXTENSION_REGEX='\.(svgz|svg|shtml|xhtml|html|sh)$' diff --git a/Automation/Modules/Tuneup/tuneup.sh b/Automation/Modules/Tuneup/tuneup.sh index 896174e..37b41cc 100755 --- a/Automation/Modules/Tuneup/tuneup.sh +++ b/Automation/Modules/Tuneup/tuneup.sh @@ -27,6 +27,9 @@ function tuneup { + # Define file extensions tuneup module will look for processing. + local FILE_EXTENSION_REGEX='\.(svgz|svg|shtml|xhtml|html|sh)$' + tuneup_getOptions "${@}" eval set -- "${TCAR_ARGUMENTS}" @@ -55,16 +58,16 @@ function tuneup { tcar_printMessage "${FILE}" --as-tuningup-line # Retrieve module name to apply based on file extension . - local MODULE_NAME=$(echo ${FILE} \ + local SUBMODULE_NAME=$(echo ${FILE} \ | sed -r "s/.+${FILE_EXTENSION_REGEX}/\1/") # Set module aliases. - if [[ ${MODULE_NAME} =~ '(shtml|html|htm)' ]];then - MODULE_NAME='xhtml' + if [[ ${SUBMODULE_NAME} =~ '(shtml|html|htm)' ]];then + SUBMODULE_NAME='xhtml' fi # Initiate module's environment for processing file. - tcar_setModuleEnvironment "${MODULE_NAME}" "${@}" + tcar_setSubModuleEnvironment "${SUBMODULE_NAME}" "${@}" done