From 49bab3049a1c424248c3bb192671cda38271587e Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Jul 17 2013 22:21:29 +0000 Subject: Update prepare module from centos-art.sh script. - Remove images, links and manuals options and add repository option instead of them. They are no longer needed inside prepare module. Production tasks related to images, links and manuals are taken by render module now. - Rename function from prepare_setConfiguration to prepare_setRepository. - Update centos-art.asciidoc. --- diff --git a/Automation/Modules/Prepare/Scripts/prepare_getOptions.sh b/Automation/Modules/Prepare/Scripts/prepare_getOptions.sh index 9ac104f..a2b185d 100755 --- a/Automation/Modules/Prepare/Scripts/prepare_getOptions.sh +++ b/Automation/Modules/Prepare/Scripts/prepare_getOptions.sh @@ -31,10 +31,10 @@ function prepare_getOptions { # Define short options we want to support. - local ARGSS="h,v,q" + local ARGSS="h,v,q,y" # Define long options we want to support. - local ARGSL="help,version,quiet,yes,packages,links,images,manuals,all,synchronize" + local ARGSL="help,version,quiet,yes,packages,repository" # Define module arguments local to this function. This is very # important in order to provide option parsing for different @@ -65,7 +65,7 @@ function prepare_getOptions { shift 1 ;; - --yes ) + -y | --yes ) TCAR_FLAG_YES="true" shift 1 ;; @@ -75,29 +75,8 @@ function prepare_getOptions { shift 1 ;; - --images ) - MODULE_ACTIONS="${MODULE_ACTIONS} prepare_setImages" - shift 1 - ;; - - --manuals ) - MODULE_ACTIONS="${MODULE_ACTIONS} prepare_setManuals" - shift 1 - ;; - - --links ) - MODULE_ACTIONS="${MODULE_ACTIONS} prepare_setLinks" - shift 1 - ;; - - --all ) - MODULE_ACTIONS="prepare_setPackages prepare_setImages - prepare_setManuals prepare_setLinks" - shift 1 - ;; - - --synchronize ) - TCAR_FLAG_SYNCHRONIZE="true" + --repository ) + MODULE_ACTIONS="${MODULE_ACTIONS} prepare_setRepository" shift 1 ;; diff --git a/Automation/Modules/Prepare/Scripts/prepare_setConfiguration.sh b/Automation/Modules/Prepare/Scripts/prepare_setConfiguration.sh deleted file mode 100755 index 6a30a53..0000000 --- a/Automation/Modules/Prepare/Scripts/prepare_setConfiguration.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash -###################################################################### -# -# prepare_setConfiguration.sh -- This function builds a list of -# configuration files and calls the render module for processing it. -# The list of configuration files is built using the first argument -# provided to this function as reference. -# -# Written by: -# * Alain Reguera Delgado , 2009-2013 -# Key fingerprint = D67D 0F82 4CBD 90BC 6421 DF28 7CCE 757C 17CA 3951 -# -# 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. -# -###################################################################### - -function prepare_setConfiguration { - - local FILENAME=${1} - - # Verify the file name passed to this function. Just to avoid - # trickery when building the list of configuration files. - tcar_checkFiles "${FILENAME}" --match="^(images|links|manual)$" - - # Build list of configuration files to be produced. - local CONFIGURATION_FILES=$(tcar_getFilesList \ - ${TCAR_BASEDIR} --type="f" --pattern=".+/${FILENAME}\.conf") - - # Verify list of configuration files. - if [[ -z ${CONFIGURATION_FILES} ]];then - return - fi - - # CAUTION: The order in which configuration files are processed is - # relevant to final production result. For example, in order for - # theme images to hold the branding information the - # `Artworks/Brands' directory must be rendered before the - # `Artworks/Themes' directory. The reason of this is that brand - # images are not drawn inside theme design models themselves, but - # combined with theme images using the ImageMagick tool suite once - # they both have been rendered as PNG files. - - # Rebuild the list of configuration files to grant brand correct - # production order when they are included in the list of files to - # produce. - echo "${CONFIGURATION_FILES}" | grep "${TCAR_BASEDIR}/Artworks/Brands" > /dev/null - if [[ $? -eq 0 ]];then - CONFIGURATION_FILES="${TCAR_BASEDIR}/Artworks/Brands - $(echo "${CONFIGURATION_FILES}" | grep -v "${TCAR_BASEDIR}/Artworks/Brands")" - fi - - # Process configuration files using render module. - tcar_setFnEnvironment render ${CONFIGURATION_FILES} - -} diff --git a/Automation/Modules/Prepare/Scripts/prepare_setImages.sh b/Automation/Modules/Prepare/Scripts/prepare_setImages.sh deleted file mode 100755 index 6554ed0..0000000 --- a/Automation/Modules/Prepare/Scripts/prepare_setImages.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -###################################################################### -# -# prepare_setImages.sh -- This function is an interface for -# prepare_setConfiguration function. -# -# Written by: -# * Alain Reguera Delgado , 2009-2013 -# Key fingerprint = D67D 0F82 4CBD 90BC 6421 DF28 7CCE 757C 17CA 3951 -# -# 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. -# -###################################################################### - -function prepare_setImages { - - prepare_setConfiguration "images" - -} diff --git a/Automation/Modules/Prepare/Scripts/prepare_setLinks.sh b/Automation/Modules/Prepare/Scripts/prepare_setLinks.sh deleted file mode 100755 index 6239e14..0000000 --- a/Automation/Modules/Prepare/Scripts/prepare_setLinks.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -###################################################################### -# -# prepare_setImages.sh -- This function is an interface for -# prepare_setConfiguration function. -# -# Written by: -# * Alain Reguera Delgado , 2009-2013 -# Key fingerprint = D67D 0F82 4CBD 90BC 6421 DF28 7CCE 757C 17CA 3951 -# -# 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. -# -###################################################################### - -function prepare_setLinks { - - prepare_setConfiguration "links" - -} diff --git a/Automation/Modules/Prepare/Scripts/prepare_setManuals.sh b/Automation/Modules/Prepare/Scripts/prepare_setManuals.sh deleted file mode 100755 index 59c6348..0000000 --- a/Automation/Modules/Prepare/Scripts/prepare_setManuals.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -###################################################################### -# -# prepare_setImages.sh -- This function is an interface for -# prepare_setConfiguration function. -# -# Written by: -# * Alain Reguera Delgado , 2009-2013 -# Key fingerprint = D67D 0F82 4CBD 90BC 6421 DF28 7CCE 757C 17CA 3951 -# -# 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. -# -###################################################################### - -function prepare_setManuals { - - prepare_setConfiguration "manual" - -} diff --git a/Automation/Modules/Prepare/Scripts/prepare_setRepository.sh b/Automation/Modules/Prepare/Scripts/prepare_setRepository.sh new file mode 100755 index 0000000..a453eac --- /dev/null +++ b/Automation/Modules/Prepare/Scripts/prepare_setRepository.sh @@ -0,0 +1,62 @@ +#!/bin/bash +###################################################################### +# +# prepare_setRepository.sh -- This function builds a list of all +# configuration files inside the repository and calls the render +# module for processing it. +# +# Written by: +# * Alain Reguera Delgado , 2009-2013 +# Key fingerprint = D67D 0F82 4CBD 90BC 6421 DF28 7CCE 757C 17CA 3951 +# +# 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. +# +###################################################################### + +function prepare_setRepository { + + # Build list of configuration files to be produced. + local CONFIGURATION_FILES=$(tcar_getFilesList \ + ${TCAR_BASEDIR} --type="f" --pattern=".+/${FILENAME}\.conf") + + # Verify list of configuration files. + if [[ -z ${CONFIGURATION_FILES} ]];then + return + fi + + # CAUTION: The order in which configuration files are processed is + # relevant to final production result. For example, in order for + # theme images to hold the branding information the + # `Artworks/Brands' directory must be rendered before the + # `Artworks/Themes' directory. The reason of this is that brand + # images are not drawn inside theme design models themselves, but + # combined with theme images using the ImageMagick tool suite once + # they both have been rendered as PNG files. + + # Rebuild the list of configuration files to grant brand correct + # production order when they are included in the list of files to + # produce. + echo "${CONFIGURATION_FILES}" | grep "${TCAR_BASEDIR}/Artworks/Brands" > /dev/null + if [[ $? -eq 0 ]];then + CONFIGURATION_FILES="${TCAR_BASEDIR}/Artworks/Brands + $(echo "${CONFIGURATION_FILES}" | grep -v "${TCAR_BASEDIR}/Artworks/Brands")" + fi + + # Process configuration files using render module. + tcar_setFnEnvironment render ${CONFIGURATION_FILES} + +} diff --git a/Automation/Modules/Prepare/prepare.asciidoc b/Automation/Modules/Prepare/prepare.asciidoc index 19dc075..1b6663c 100644 --- a/Automation/Modules/Prepare/prepare.asciidoc +++ b/Automation/Modules/Prepare/prepare.asciidoc @@ -34,25 +34,13 @@ The *prepare* module has the following options: installed in the workstation, the *prepare* module executes the *yum install* command through *sudo* to install the required packages. -*--images*:: +*--repository*:: This option calls the *render* module of *centos-art.sh* script - and produces content related to all +images.conf+ files found - inside the repository's root directory. -*--manuals*:: - This option calls the *render* module of *centos-art.sh* script - and produces content related to all +manual.conf+ files found - inside the repository's root directory. -*--links*:: - This option calls the *render* module of *centos-art.sh* script - and produces content related to all +links.conf+ files found - inside the repository's root directory. -*--directories*:: - This option produces mirrored directories structures. -*--synchronize*:: - This option brings remote changes from central repository up to - the working copy and pushes local changes from working copy up to - the central repository, using the repository's version control - system (e.g., git or subversion). + and produces content for all configuration (+*.conf+) files found + inside the repository. This option produces images, documentation + and internal links inside the repository and outside it (e.g., to + link GIMP's components produced in the repository from GIMP's + search path). Reporting Bugs -------------- diff --git a/Automation/Modules/Prepare/prepare.conf.sh b/Automation/Modules/Prepare/prepare.conf.sh index 82f8e5e..9a7f6e5 100755 --- a/Automation/Modules/Prepare/prepare.conf.sh +++ b/Automation/Modules/Prepare/prepare.conf.sh @@ -30,6 +30,5 @@ # Module-specific configuration variables. # -------------------------------------------------------------------- declare -xr MODULE_VERSION='0.1' -declare -x MODULE_BASEDIR=${MODULE_DIR}/Modules declare -x MODULE_ACTIONS='' diff --git a/Automation/centos-art.asciidoc b/Automation/centos-art.asciidoc index 202d5a5..f9b1e99 100644 --- a/Automation/centos-art.asciidoc +++ b/Automation/centos-art.asciidoc @@ -67,14 +67,15 @@ The following modules are available for *centos-art.sh* script: *prepare*:: This module standardizes configuration tasks needed by your - working copy (e.g., creation of links, images and documentations). - This is the first task you should run in your workstation, just - after downloading a fresh working copy of CentOS artwork - repository. + working copy (e.g., verify whether required packages are installed + or not in your workstation). This is the first task you should run + in your workstation, just after downloading a fresh working copy + of CentOS artwork repository. *render*:: This module standardizes the way content is produced inside the - repository. Whenever you need to produce images, documentation or + repository. This function relies on configuration files to do its + work. Whenever you need to produce images, documentation or localized content this is the module you'll need to use. *locale*::