diff --git a/Scripts/Documentation/Manpages/Locales/en_US/tcar-prepare.asciidoc.po b/Scripts/Documentation/Manpages/Locales/en_US/tcar-prepare.asciidoc.po new file mode 100644 index 0000000..8472ab2 --- /dev/null +++ b/Scripts/Documentation/Manpages/Locales/en_US/tcar-prepare.asciidoc.po @@ -0,0 +1,331 @@ +msgid "" +msgstr "" +"Project-Id-Version: prepare.asciidoc 0.6\n" +"POT-Creation-Date: 2013-11-07 14:49-0500\n" +"PO-Revision-Date: 2013-11-07 14:49-0500\n" +"Last-Translator: Localization SIG \n" +"Language-Team: English\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "prepare" +msgstr "prepare" + +msgid "1" +msgstr "1" + +msgid "Prepare your workstation for using the repository." +msgstr "Prepare your workstation for using the repository." + +msgid "centos-art.sh prepare [OPTIONS]" +msgstr "centos-art.sh prepare [OPTIONS]" + +msgid "Description" +msgstr "Description" + +msgid "" +"The first time you download the CentOS artwork repository into your " +"workstation, you only find source files inside the repository. In " +"order to produce each component of CentOS corporate visual " +"identity, it is necessary that you first transform the source files " +"(e.g., .svgz, .asciidoc, " +".po) into final files (e.g., .png, .html, .mo). This " +"process is known as preparing your workstation to use the " +"repository and is standardized through the prepare module. This way, the prepare module is the first command you " +"execute after downloading a fresh copy of CentOS artwork repository." +msgstr "" +"The first time you download the CentOS artwork repository into your " +"workstation, you only find source files inside the repository. In " +"order to produce each component of CentOS corporate visual " +"identity, it is necessary that you first transform the source files " +"(e.g., .svgz, .asciidoc, " +".po) into final files (e.g., .png, .html, .mo). This " +"process is known as preparing your workstation to use the " +"repository and is standardized through the prepare module. This way, the prepare module is the first command you " +"execute after downloading a fresh copy of CentOS artwork repository." + +msgid "" +"When you execute the prepare " +"module without any option, it first checks existence of required " +"packages (see --packages), then updates the locale information " +"required by centos-art.sh " +"script to show messages in your current locale, later renders " +"documentation (see --documents) and images (see --images) using " +"source files available inside the repository. Finally, it updates " +"the link relation that connects content inside the repository and " +"the applications outside it (see --links)." +msgstr "" +"When you execute the prepare " +"module without any option, it first checks existence of required " +"packages (see --packages), then updates the locale information " +"required by centos-art.sh " +"script to show messages in your current locale, later renders " +"documentation (see --documents) and images (see --images) using " +"source files available inside the repository. Finally, it updates " +"the link relation that connects content inside the repository and " +"the applications outside it (see --links)." + +msgid "" +"When you execute the prepare " +"module with options, the order in which preparation actions take " +"place is set by the order in which you passed the options. See " +", for more information about available " +"options and what they do." +msgstr "" +"When you execute the prepare " +"module with options, the order in which preparation actions take " +"place is set by the order in which you passed the options. See " +", for more information about available " +"options and what they do." + +msgid "" +"Once the prepare module " +"completes its execution, both your workstation and your copy of " +"CentOS artwork repository will be ready for production." +msgstr "" +"Once the prepare module " +"completes its execution, both your workstation and your copy of " +"CentOS artwork repository will be ready for production." + +msgid "Options" +msgstr "Options" + +msgid "" +"The prepare module accepts the " +"following options:" +msgstr "" +"The prepare module accepts the " +"following options:" + +msgid "--help" +msgstr "--help" + +msgid "Print module's documentation." +msgstr "Print module's documentation." + +msgid "--version" +msgstr "--version" + +msgid "Print module's version." +msgstr "Print module's version." + +msgid "--packages" +msgstr "--packages" + +msgid "" +"This option verifies whether you have installed the required " +"packages in your workstation or not. If they are not installed an " +"error will be printed telling you what the missing package is, so " +"you can install it. It is important that all the required packages " +"be installed for centos-art.sh " +"script modules to work as expected." +msgstr "" +"This option verifies whether you have installed the required " +"packages in your workstation or not. If they are not installed an " +"error will be printed telling you what the missing package is, so " +"you can install it. It is important that all the required packages " +"be installed for centos-art.sh " +"script modules to work as expected." + +msgid "" +"When you are verifying packages, be aware that it is required that " +"you have installed EPEL repository. The EPEL configuration package " +"(epel-release) isn't part of " +"CentOS distribution and you need to download it and install it " +"manually. The epel-release " +"package can be found in either of the locations (based on your " +"system version):" +msgstr "" +"When you are verifying packages, be aware that it is required that " +"you have installed EPEL repository. The EPEL configuration package " +"(epel-release) isn't part of " +"CentOS distribution and you need to download it and install it " +"manually. The epel-release " +"package can be found in either of the locations (based on your " +"system version):" + +msgid "" +"For CentOS-5: http://download.fedoraproject.org/pub/epel/5/i386/" +msgstr "" +"For CentOS-5: http://download.fedoraproject.org/pub/epel/5/i386/" + +msgid "" +"For CentOS-6: http://download.fedoraproject.org/pub/epel/6/i386/" +msgstr "" +"For CentOS-6: http://download.fedoraproject.org/pub/epel/6/i386/" + +msgid "--locales" +msgstr "--locales" + +msgid "" +"This option looks for all translatable strings inside the centos-art.sh script, updates the " +"related POT and PO files and produces the related MO file using the " +"specific locale environment information the script was run in. If " +"the PO file already have translations, they are preserved and used " +"to build the MO file." +msgstr "" +"This option looks for all translatable strings inside the centos-art.sh script, updates the " +"related POT and PO files and produces the related MO file using the " +"specific locale environment information the script was run in. If " +"the PO file already have translations, they are preserved and used " +"to build the MO file." + +msgid "--links" +msgstr "--links" + +msgid "" +"This updates the link information that connects the information " +"inside the repository with the information outside the repository. " +"For example, inside the repository we have the font information " +"required to build messages in specific typography, such information " +"isn't by default in the default system locations so we install them " +"in the home directory of the user running the prepare module, using symbolic links." +msgstr "" +"This updates the link information that connects the information " +"inside the repository with the information outside the repository. " +"For example, inside the repository we have the font information " +"required to build messages in specific typography, such information " +"isn't by default in the default system locations so we install them " +"in the home directory of the user running the prepare module, using symbolic links." + +msgid "" +"Whenever you need to update this information, use this option. Take " +"care that all links previously created in the target location will " +"be removed and recreated again. So, you can change the name " +"relation in the configuration files and install the changes without " +"leaving broken links in the target location." +msgstr "" +"Whenever you need to update this information, use this option. Take " +"care that all links previously created in the target location will " +"be removed and recreated again. So, you can change the name " +"relation in the configuration files and install the changes without " +"leaving broken links in the target location." + +msgid "" +"The file that controls the link configuration is inside the " +"repository at Automation/Modules/Prepare/Modules/Links/" +"Configs/render.conf." +msgstr "" +"The file that controls the link configuration is inside the " +"repository at Automation/Modules/Prepare/Modules/Links/" +"Configs/render.conf." + +msgid "--images" +msgstr "--images" + +msgid "" +"This option produces images from source files available inside the " +"repository, using the correct order. When you use this option, " +"centos-art.sh script calls the render module internally which " +"produces content for all configuration (render.conf) files found inside the repository." +msgstr "" +"This option produces images from source files available inside the " +"repository, using the correct order. When you use this option, " +"centos-art.sh script calls the render module internally which " +"produces content for all configuration (render.conf) files found inside the repository." + +msgid "--documents" +msgstr "--documents" + +msgid "" +"This options produces documentation from source files available " +"inside the repository. When you pass this option, the current " +"locale information is considered to produce the documentation. If " +"the current locale doesn't have translation files set for the " +"current locale information, English language is used as default " +"language." +msgstr "" +"This options produces documentation from source files available " +"inside the repository. When you pass this option, the current " +"locale information is considered to produce the documentation. If " +"the current locale doesn't have translation files set for the " +"current locale information, English language is used as default " +"language." + +msgid "Author" +msgstr "Author" + +msgid "" +"The prepare module has " +"received contributions from the following people:" +msgstr "" +"The prepare module has " +"received contributions from the following people:" + +msgid "" +"Alain Reguera Delgado <al@centos.org.cu>, 2009-2013" +msgstr "" +"Alain Reguera Delgado <al@centos.org.cu>, 2009-2013" + +msgid "Copyright" +msgstr "Copyright" + +msgid "Copyright © 2009-2013 The CentOS Project" +msgstr "Copyright © 2009-2013 The CentOS Project" + +msgid "" +"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." +msgstr "" +"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." + +msgid "" +"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." +msgstr "" +"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." + +msgid "" +"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." +msgstr "" +"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." + +msgid "See Also" +msgstr "See Also" + +msgid "" +"centos-art.sh(1), centos-art.sh-render(1), centos-art.sh-locale(1)" +msgstr "" +"centos-art.sh(1), centos-art.sh-render(1), centos-art.sh-locale(1)" + +#. Put one translator per line, in the form of NAME , YEAR1, YEAR2. +msgid "translator-credits" +msgstr "translator-credits" diff --git a/Scripts/Documentation/Manpages/tcar-prepare.asciidoc b/Scripts/Documentation/Manpages/tcar-prepare.asciidoc new file mode 100644 index 0000000..34b402d --- /dev/null +++ b/Scripts/Documentation/Manpages/tcar-prepare.asciidoc @@ -0,0 +1,89 @@ +tcar-prepare(1) +=============== + +Name +---- + +tcar-prepare - Prepare the repository workplace. + +Synopsis +-------- + +*centos-art.sh prepare /path/to/your/workplace* + +Description +----------- + +When you install The CentOS Artwork Repository in your workstation, it +only provides the source files and documentation you need to produce +final content but no way to produce final content inside the location +it was installed. To produce final content using the source files +provided by The CentOS Artwork Repository you need to create a +directory in your workstation where you can store the files you +produce and the configuration files provided by the installed +repository. This directory is known as the ``repository workplace'' +and you should create it using the *tcar-prepare* command. + +The *tcar-prepare* module creates the workplace in the location you +specified as argument in the command-line. Inside the workplace, there +is one directory for each visual manifestation The CentOS Project is +made of. Each directory inside the workplace might exist to organize +other directories or storing final content. The directories storing +final content hold one configuration file describing how the final +content is produced inside of it. The configuration files inside the +workplace are symbolic links to configuration files inside The CentOS +Artwork Repository installed in your workstation. + +The first time you create the workplace using the *tcar-prepare* +module, it doesn't include images required to brand other images +(e.g., The CentOS Symbol and The CentOS Type). This is something you +need to do in order for images requiring brand information to be +rendered as they are expected. Rendering images related to brands +might consume some time but it is something that needs to be done just +once, unless variations to brand information be introduced to The +CentOS Artwork Repository, in which case it would be required to +render them again to propagate the changes introduced to brand +information the next time images requiring them be rendered. + +[[options]] +Options +------- + +The *tcar-prepare* module accepts the following options: + +*--help*:: + Print module's documentation. + +*--version*:: + Print module's version. + +Author +------ + +Written by Alain Reguera Delgado + +Copyright +--------- + +Copyright (C) 2014 The CentOS Artwork SIG + +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. + +See Also +-------- + +tcar(1), tcar-render(1), tcar-locale(1) + +// vim: set syntax=asciidoc: diff --git a/Scripts/Documentation/Manpages/tcar-prepare.conf b/Scripts/Documentation/Manpages/tcar-prepare.conf new file mode 100644 index 0000000..9b6eccf --- /dev/null +++ b/Scripts/Documentation/Manpages/tcar-prepare.conf @@ -0,0 +1,7 @@ +[tcar-prepare] +render-type = "asciidoc" +render-flow = "manpage" +render-from = "tcar-prepare.asciidoc" +locale-from = "Locales/${TCAR_SCRIPT_LANG_LC}/tcar-prepare.po" +formats = "xhtml manpage" +mansect = "1" diff --git a/Scripts/Locales/es_ES/tcar-prepare.sh.po b/Scripts/Locales/es_ES/tcar-prepare.sh.po new file mode 100644 index 0000000..0bf026e --- /dev/null +++ b/Scripts/Locales/es_ES/tcar-prepare.sh.po @@ -0,0 +1,28 @@ +msgid "" +msgstr "" +"Project-Id-Version: prepare.sh 0.6\n" +"Report-Msgid-Bugs-To: centos-l10n-es@centos.org.cu\n" +"POT-Creation-Date: 2013-10-28 16:31-0400\n" +"PO-Revision-Date: 2013-10-28 16:31-0400\n" +"Last-Translator: Localization SIG \n" +"Language-Team: Spanish\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: Automation/Modules/Prepare/Modules/Packages/packages.sh:54 +msgid "All required packages are installed already." +msgstr "Todos los paquetes requeridos ya est\'an instalados." + +#: Automation/Modules/Prepare/prepare_setRenderEnvironment.sh:55 +msgid "The option name cannot be empty." +msgstr "El nombre de la opción no puede estar vacío." + +#: Automation/Modules/Prepare/prepare_setRenderEnvironment.sh:64 +msgid "The option value cannot be empty." +msgstr "El valor de la opción no puede estar vacío." + +#: Automation/Modules/Prepare/prepare_setRenderEnvironment.sh:80 +msgid "The search path cannot be empty." +msgstr "El camino de búsqueda no puede estar vacío." diff --git a/Scripts/Modules/Prepare/prepare.sh b/Scripts/Modules/Prepare/prepare.sh new file mode 100755 index 0000000..770a804 --- /dev/null +++ b/Scripts/Modules/Prepare/prepare.sh @@ -0,0 +1,49 @@ +#!/bin/bash +###################################################################### +# +# tcar - The CentOS Artwork Repository automation tool. +# Copyright © 2014 The CentOS Artwork SIG +# +# 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. +# +# Alain Reguera Delgado +# 39 Street No. 4426 Cienfuegos, Cuba. +# +###################################################################### + +# Standardize configuration tasks related to repository's workplace. +# +# When you install The CentOS Artwork Repository most of its content +# is in source format. In order to produce final content and make the +# connections between the produced components, you need to process the +# source formats somewhere inside your workstation. This module takes +# the first non-option argument passed in the command-line as the +# workplace where you are going to process source formats in your +# workstation. During the preparation process, this module creates the +# workplace directory structure, the workplace connection with The +# CentOS Artwork Repository using symbolic links, and images required +# to brand other images. +# +# This module should be the first module you run in your workstation +# after installing The CentOS Artwork Repository. +function prepare { + + prepare_getOptions + + for TCAR_WORKDIR in ${TCAR_SCRIPT_ARGUMENT};do + prepare_setWorkplace + done + +} diff --git a/Scripts/Modules/Prepare/prepare_getOptions.sh b/Scripts/Modules/Prepare/prepare_getOptions.sh new file mode 100755 index 0000000..2bf60a4 --- /dev/null +++ b/Scripts/Modules/Prepare/prepare_getOptions.sh @@ -0,0 +1,68 @@ +#!/bin/bash +###################################################################### +# +# tcar - The CentOS Artwork Repository automation tool. +# Copyright © 2014 The CentOS Artwork SIG +# +# 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. +# +# Alain Reguera Delgado +# 39 Street No. 4426 Cienfuegos, Cuba. +# +###################################################################### + +# Parse options passed to `tcar.sh' script command-line, when +# the first argument is the `prepare' word. To parse options, this +# function makes use of getopt program. +function prepare_getOptions { + + # Define short options we want to support. + local ARGSS="h::,v" + + # Define long options we want to support. + local ARGSL="help::,version" + + # Redefine arguments using getopt(1) command parser. + tcar_setModuleArguments + + # Reset positional parameters on this function, using output + # produced from (getopt) arguments parser. + eval set -- "${TCAR_MODULE_ARGUMENT}" + + # Look for options passed through command-line. + while true; do + case "${1}" in + + -h | --help ) + tcar_printHelp "${2}" + ;; + + -v | --version ) + tcar_printVersion "${TCAR_MODULE_NAME}" + ;; + + -- ) + shift 1 + break + ;; + + esac + done + + # Redefine arguments using current positional parameters. Only + # paths should remain as arguments, at this point. + TCAR_MODULE_ARGUMENT="${@}" + +} diff --git a/Scripts/Modules/Prepare/prepare_getWorkplaceConf.sh b/Scripts/Modules/Prepare/prepare_getWorkplaceConf.sh new file mode 100755 index 0000000..6ac8bfe --- /dev/null +++ b/Scripts/Modules/Prepare/prepare_getWorkplaceConf.sh @@ -0,0 +1,33 @@ +#!/bin/bash +###################################################################### +# +# tcar - The CentOS Artwork Repository automation tool. +# Copyright © 2014 The CentOS Artwork SIG +# +# 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. +# +# Alain Reguera Delgado +# 39 Street No. 4426 Cienfuegos, Cuba. +# +###################################################################### + +# Print configuration files (and their templates) to standard output. +function prepare_getWorkplaceConf { + + local DIRECTORY=${1:-${TCAR_BASEDIR}/Models} + + tcar_getFilesList -p '.+\.conf(\.tpl)?$' -t 'f' ${DIRECTORY} + +} diff --git a/Scripts/Modules/Prepare/prepare_getWorkplaceDir.sh b/Scripts/Modules/Prepare/prepare_getWorkplaceDir.sh new file mode 100755 index 0000000..38be07f --- /dev/null +++ b/Scripts/Modules/Prepare/prepare_getWorkplaceDir.sh @@ -0,0 +1,36 @@ +#!/bin/bash +###################################################################### +# +# tcar - The CentOS Artwork Repository automation tool. +# Copyright © 2014 The CentOS Artwork SIG +# +# 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. +# +# Alain Reguera Delgado +# 39 Street No. 4426 Cienfuegos, Cuba. +# +###################################################################### + +# Transform absolute paths to configuration files inside The CentOS +# Artwork Repository to directory absolute paths inside the workplace. +function prepare_getWorkplaceDir { + + local DIRECTORY=$1 + + echo ${DIRECTORY} \ + | sed -r -e "s!${TCAR_BASEDIR}/Models/!${TCAR_WORKDIR}/!" \ + -e 's!/[a-z]+\.conf(\.tpl)?$!!' + +} diff --git a/Scripts/Modules/Prepare/prepare_setRenderEnvironment.sh b/Scripts/Modules/Prepare/prepare_setRenderEnvironment.sh new file mode 100755 index 0000000..241d9bc --- /dev/null +++ b/Scripts/Modules/Prepare/prepare_setRenderEnvironment.sh @@ -0,0 +1,111 @@ +#!/bin/bash +###################################################################### +# +# tcar - The CentOS Artwork Repository automation tool. +# Copyright © 2014 The CentOS Artwork SIG +# +# 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. +# +# Alain Reguera Delgado +# 39 Street No. 4426 Cienfuegos, Cuba. +# +###################################################################### + +# Provide a secure interface to render content outside the render +# module. You can use this function to call the render module from +# other modules, safely. +# +# This function builds a list of all available configuration files in +# locations passed as argument and reduces the list by applying +# regular expression patterns to each file in the list. Only files +# that match the regular expression pattern will remain in the final +# list. The regular expression patterns are applied to file's content, +# generally to find out if it has an specific option, value or +# combination of both inside. Later, the resultant list of +# configuration files is passed to render module for processing. +# +# This function verifies the search path provided to render module to +# grant it is inside the repository before passing it to render module +# for processing. +function prepare_setRenderEnvironment { + + OPTIND=1 + while getopts "o:,v:" OPTION "${@}"; do + + case "${OPTION}" in + + o ) + # Define the name of the option you want to look + # configuration files for. + local OPTION_NAME=${OPTARG} + if [[ -z ${OPTION_NAME} ]];then + tcar_printMessage "`gettext "The option name cannot be empty."`" --as-error-line + fi + ;; + + v ) + # Define the value of the option you want to look + # configuration files for. + local OPTION_VALUE=${OPTARG} + if [[ -z ${OPTION_VALUE} ]];then + tcar_printMessage "`gettext "The option value cannot be empty."`" --as-error-line + fi + ;; + + esac + + done + + # Clean up positional parameters to reflect the fact that options + # have been processed already. + shift $(( ${OPTIND} - 1 )) + + # Now that option arguments have been removed from positional + # parameter, verify all other remaining arguments (the search + # paths) do exist. They are required to search. + if [[ -z ${@} ]];then + tcar_printMessage "`gettext "The search path cannot be empty."`" --as-error-line + fi + + # Define array variable to store configuration file paths. + local -a CONFIGURATION_FILES + + # Define final filter regular expression. This regular expression + # must match the option = "value" format we are using inside + # configuration files. + local CONFIGURATION_PATTERN="^${OPTION_NAME}[[:space:]]*=[[:space:]]*\"${OPTION_VALUE}\"$" + + for DIRECTORY in ${@};do + + # Clean-up the search path. This location must point to a + # directory inside the workplace. + DIRECTORY=$(tcar_checkWorkDirSource ${DIRECTORY}) + + # Verify the search path. It must exist and being a directory. + tcar_checkFiles -ed ${DIRECTORY} + + # Define the list of configuration files the render module + # will use as reference to produce documentation. At this + # point it is very difficult that DIRECTORY doesn't exist or + # be outside the workplace directory structure. + CONFIGURATION_FILES[++${#CONFIGURATION_FILES[*]}]=$(tcar_getFilesList \ + -p '.+\.conf$' -t 'l' ${DIRECTORY} \ + | xargs egrep ${CONFIGURATION_PATTERN} | cut -d: -f1 | sort | uniq) + + done + + # Process the list of configuration files using the render module. + tcar_setModuleEnvironment -m "render" -t "parent" ${CONFIGURATION_FILES[*]} +} diff --git a/Scripts/Modules/Prepare/prepare_setWorkplace.sh b/Scripts/Modules/Prepare/prepare_setWorkplace.sh new file mode 100755 index 0000000..84e4e1f --- /dev/null +++ b/Scripts/Modules/Prepare/prepare_setWorkplace.sh @@ -0,0 +1,53 @@ +#!/bin/bash +###################################################################### +# +# tcar - The CentOS Artwork Repository automation tool. +# Copyright © 2014 The CentOS Artwork SIG +# +# 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. +# +# Alain Reguera Delgado +# 39 Street No. 4426 Cienfuegos, Cuba. +# +###################################################################### + +# Create the repository's workplace. +function prepare_setWorkplace { + + local CONF='' + + if [[ -d ${TCAR_WORKDIR} ]];then + tcar_printMessage "`gettext "The workplace you provided already exist and will be removed."`" --as-stdout-line + tcar_printMessage "`gettext "Do you want to continue?"`" --as-yesornorequest-line + tcar_printMessage "${TCAR_WORKDIR}" --as-deleting-line + rm -r ${TCAR_WORKDIR} + fi + + tcar_printMessage "${TCAR_WORKDIR}" --as-creating-line + + for CONF in $(prepare_getWorkplaceConf);do + local TCAR_WORKDIR_DIR=$(prepare_getWorkplaceDir ${CONF}) + local TCAR_WORKDIR_LNK=${TCAR_WORKDIR_DIR}/render.conf + mkdir -p ${TCAR_WORKDIR_DIR} && ln -s ${CONF} ${TCAR_WORKDIR_LNK} + tcar_checkFiles -h ${TCAR_WORKDIR_LNK} + done + + if [[ -d ${TCAR_WORKDIR}/Brands ]];then + tcar_printMessage "`gettext "The workplace doesn't include images for branding other images."`" --as-stdout-line + tcar_printMessage "`gettext "Do you want to render them now?"`" --as-yesornorequest-line + prepare_setRenderEnvironment -o "render-type" -v "svg" Brands + fi + +} diff --git a/tcar-scripts-prepare-docs/Manpages/Locales/en_US/tcar-prepare.po b/tcar-scripts-prepare-docs/Manpages/Locales/en_US/tcar-prepare.po deleted file mode 100644 index 8472ab2..0000000 --- a/tcar-scripts-prepare-docs/Manpages/Locales/en_US/tcar-prepare.po +++ /dev/null @@ -1,331 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: prepare.asciidoc 0.6\n" -"POT-Creation-Date: 2013-11-07 14:49-0500\n" -"PO-Revision-Date: 2013-11-07 14:49-0500\n" -"Last-Translator: Localization SIG \n" -"Language-Team: English\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -msgid "prepare" -msgstr "prepare" - -msgid "1" -msgstr "1" - -msgid "Prepare your workstation for using the repository." -msgstr "Prepare your workstation for using the repository." - -msgid "centos-art.sh prepare [OPTIONS]" -msgstr "centos-art.sh prepare [OPTIONS]" - -msgid "Description" -msgstr "Description" - -msgid "" -"The first time you download the CentOS artwork repository into your " -"workstation, you only find source files inside the repository. In " -"order to produce each component of CentOS corporate visual " -"identity, it is necessary that you first transform the source files " -"(e.g., .svgz, .asciidoc, " -".po) into final files (e.g., .png, .html, .mo). This " -"process is known as preparing your workstation to use the " -"repository and is standardized through the prepare module. This way, the prepare module is the first command you " -"execute after downloading a fresh copy of CentOS artwork repository." -msgstr "" -"The first time you download the CentOS artwork repository into your " -"workstation, you only find source files inside the repository. In " -"order to produce each component of CentOS corporate visual " -"identity, it is necessary that you first transform the source files " -"(e.g., .svgz, .asciidoc, " -".po) into final files (e.g., .png, .html, .mo). This " -"process is known as preparing your workstation to use the " -"repository and is standardized through the prepare module. This way, the prepare module is the first command you " -"execute after downloading a fresh copy of CentOS artwork repository." - -msgid "" -"When you execute the prepare " -"module without any option, it first checks existence of required " -"packages (see --packages), then updates the locale information " -"required by centos-art.sh " -"script to show messages in your current locale, later renders " -"documentation (see --documents) and images (see --images) using " -"source files available inside the repository. Finally, it updates " -"the link relation that connects content inside the repository and " -"the applications outside it (see --links)." -msgstr "" -"When you execute the prepare " -"module without any option, it first checks existence of required " -"packages (see --packages), then updates the locale information " -"required by centos-art.sh " -"script to show messages in your current locale, later renders " -"documentation (see --documents) and images (see --images) using " -"source files available inside the repository. Finally, it updates " -"the link relation that connects content inside the repository and " -"the applications outside it (see --links)." - -msgid "" -"When you execute the prepare " -"module with options, the order in which preparation actions take " -"place is set by the order in which you passed the options. See " -", for more information about available " -"options and what they do." -msgstr "" -"When you execute the prepare " -"module with options, the order in which preparation actions take " -"place is set by the order in which you passed the options. See " -", for more information about available " -"options and what they do." - -msgid "" -"Once the prepare module " -"completes its execution, both your workstation and your copy of " -"CentOS artwork repository will be ready for production." -msgstr "" -"Once the prepare module " -"completes its execution, both your workstation and your copy of " -"CentOS artwork repository will be ready for production." - -msgid "Options" -msgstr "Options" - -msgid "" -"The prepare module accepts the " -"following options:" -msgstr "" -"The prepare module accepts the " -"following options:" - -msgid "--help" -msgstr "--help" - -msgid "Print module's documentation." -msgstr "Print module's documentation." - -msgid "--version" -msgstr "--version" - -msgid "Print module's version." -msgstr "Print module's version." - -msgid "--packages" -msgstr "--packages" - -msgid "" -"This option verifies whether you have installed the required " -"packages in your workstation or not. If they are not installed an " -"error will be printed telling you what the missing package is, so " -"you can install it. It is important that all the required packages " -"be installed for centos-art.sh " -"script modules to work as expected." -msgstr "" -"This option verifies whether you have installed the required " -"packages in your workstation or not. If they are not installed an " -"error will be printed telling you what the missing package is, so " -"you can install it. It is important that all the required packages " -"be installed for centos-art.sh " -"script modules to work as expected." - -msgid "" -"When you are verifying packages, be aware that it is required that " -"you have installed EPEL repository. The EPEL configuration package " -"(epel-release) isn't part of " -"CentOS distribution and you need to download it and install it " -"manually. The epel-release " -"package can be found in either of the locations (based on your " -"system version):" -msgstr "" -"When you are verifying packages, be aware that it is required that " -"you have installed EPEL repository. The EPEL configuration package " -"(epel-release) isn't part of " -"CentOS distribution and you need to download it and install it " -"manually. The epel-release " -"package can be found in either of the locations (based on your " -"system version):" - -msgid "" -"For CentOS-5: http://download.fedoraproject.org/pub/epel/5/i386/" -msgstr "" -"For CentOS-5: http://download.fedoraproject.org/pub/epel/5/i386/" - -msgid "" -"For CentOS-6: http://download.fedoraproject.org/pub/epel/6/i386/" -msgstr "" -"For CentOS-6: http://download.fedoraproject.org/pub/epel/6/i386/" - -msgid "--locales" -msgstr "--locales" - -msgid "" -"This option looks for all translatable strings inside the centos-art.sh script, updates the " -"related POT and PO files and produces the related MO file using the " -"specific locale environment information the script was run in. If " -"the PO file already have translations, they are preserved and used " -"to build the MO file." -msgstr "" -"This option looks for all translatable strings inside the centos-art.sh script, updates the " -"related POT and PO files and produces the related MO file using the " -"specific locale environment information the script was run in. If " -"the PO file already have translations, they are preserved and used " -"to build the MO file." - -msgid "--links" -msgstr "--links" - -msgid "" -"This updates the link information that connects the information " -"inside the repository with the information outside the repository. " -"For example, inside the repository we have the font information " -"required to build messages in specific typography, such information " -"isn't by default in the default system locations so we install them " -"in the home directory of the user running the prepare module, using symbolic links." -msgstr "" -"This updates the link information that connects the information " -"inside the repository with the information outside the repository. " -"For example, inside the repository we have the font information " -"required to build messages in specific typography, such information " -"isn't by default in the default system locations so we install them " -"in the home directory of the user running the prepare module, using symbolic links." - -msgid "" -"Whenever you need to update this information, use this option. Take " -"care that all links previously created in the target location will " -"be removed and recreated again. So, you can change the name " -"relation in the configuration files and install the changes without " -"leaving broken links in the target location." -msgstr "" -"Whenever you need to update this information, use this option. Take " -"care that all links previously created in the target location will " -"be removed and recreated again. So, you can change the name " -"relation in the configuration files and install the changes without " -"leaving broken links in the target location." - -msgid "" -"The file that controls the link configuration is inside the " -"repository at Automation/Modules/Prepare/Modules/Links/" -"Configs/render.conf." -msgstr "" -"The file that controls the link configuration is inside the " -"repository at Automation/Modules/Prepare/Modules/Links/" -"Configs/render.conf." - -msgid "--images" -msgstr "--images" - -msgid "" -"This option produces images from source files available inside the " -"repository, using the correct order. When you use this option, " -"centos-art.sh script calls the render module internally which " -"produces content for all configuration (render.conf) files found inside the repository." -msgstr "" -"This option produces images from source files available inside the " -"repository, using the correct order. When you use this option, " -"centos-art.sh script calls the render module internally which " -"produces content for all configuration (render.conf) files found inside the repository." - -msgid "--documents" -msgstr "--documents" - -msgid "" -"This options produces documentation from source files available " -"inside the repository. When you pass this option, the current " -"locale information is considered to produce the documentation. If " -"the current locale doesn't have translation files set for the " -"current locale information, English language is used as default " -"language." -msgstr "" -"This options produces documentation from source files available " -"inside the repository. When you pass this option, the current " -"locale information is considered to produce the documentation. If " -"the current locale doesn't have translation files set for the " -"current locale information, English language is used as default " -"language." - -msgid "Author" -msgstr "Author" - -msgid "" -"The prepare module has " -"received contributions from the following people:" -msgstr "" -"The prepare module has " -"received contributions from the following people:" - -msgid "" -"Alain Reguera Delgado <al@centos.org.cu>, 2009-2013" -msgstr "" -"Alain Reguera Delgado <al@centos.org.cu>, 2009-2013" - -msgid "Copyright" -msgstr "Copyright" - -msgid "Copyright © 2009-2013 The CentOS Project" -msgstr "Copyright © 2009-2013 The CentOS Project" - -msgid "" -"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." -msgstr "" -"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." - -msgid "" -"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." -msgstr "" -"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." - -msgid "" -"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." -msgstr "" -"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." - -msgid "See Also" -msgstr "See Also" - -msgid "" -"centos-art.sh(1), centos-art.sh-render(1), centos-art.sh-locale(1)" -msgstr "" -"centos-art.sh(1), centos-art.sh-render(1), centos-art.sh-locale(1)" - -#. Put one translator per line, in the form of NAME , YEAR1, YEAR2. -msgid "translator-credits" -msgstr "translator-credits" diff --git a/tcar-scripts-prepare-docs/Manpages/render.conf b/tcar-scripts-prepare-docs/Manpages/render.conf deleted file mode 100644 index 9b6eccf..0000000 --- a/tcar-scripts-prepare-docs/Manpages/render.conf +++ /dev/null @@ -1,7 +0,0 @@ -[tcar-prepare] -render-type = "asciidoc" -render-flow = "manpage" -render-from = "tcar-prepare.asciidoc" -locale-from = "Locales/${TCAR_SCRIPT_LANG_LC}/tcar-prepare.po" -formats = "xhtml manpage" -mansect = "1" diff --git a/tcar-scripts-prepare-docs/Manpages/tcar-prepare.asciidoc b/tcar-scripts-prepare-docs/Manpages/tcar-prepare.asciidoc deleted file mode 100644 index 5edb5c9..0000000 --- a/tcar-scripts-prepare-docs/Manpages/tcar-prepare.asciidoc +++ /dev/null @@ -1,92 +0,0 @@ -tcar-prepare(1) -=============== - -Name ----- - -tcar-prepare - Prepare the repository workplace. - -Synopsis --------- - -*centos-art.sh prepare /path/to/your/workplace* - -Description ------------ - -When you install The CentOS Artwork Repository in your workstation, it -only provides the source files and documentation you need to produce -final content but no way to produce final content inside the location -it was installed. To produce final content using the source files -provided by The CentOS Artwork Repository you need to create a -directory in your workstation where you can store the files you -produce and the configuration files provided by the installed -repository. This directory is known as the ``repository workplace'' -and you should create it using the *prepare* module of *tcar* script. - -The *prepare* module creates the workplace in the location you -specified as argument in the command-line. Inside the workplace, there -is one directory for each visual manifestation The CentOS Project is -made of. Each directory inside the workplace might exist to organize -other directories or storing final content. The directories storing -final content hold one configuration file describing how the final -content is produced inside of it. The configuration files inside the -workplace are symbolic links to configuration files inside The CentOS -Artwork Repository installed in your workstation. - -The first time you create the workplace using the *prepare* module, it -doesn't include images required to brand other images (e.g., The -CentOS Symbol and The CentOS Type). This is something you need to do -in order for images requiring brand information to be rendered as they -are expected. Rendering images related to brands might consume some -time but it is something that needs to be done just once, unless -variations to brand information be introduced to The CentOS Artwork -Repository, in which case it would be required to render them again to -propagate the changes introduced to brand information the next time -images requiring them be rendered. - -[[options]] -Options -------- - -The *prepare* module accepts the following options: - -*--help*:: - Print module's documentation. - -*--version*:: - Print module's version. - -Authors -------- - -The *prepare* module has received contributions from the following -people: - - * Alain Reguera Delgado , 2009-2013 - -Copyright ---------- - -Copyright (C) 2009-2013 The CentOS Artwork SIG - -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. - -See Also --------- - -tcar(1), tcar-render(1), tcar-locale(1) - -// vim: set syntax=asciidoc: diff --git a/tcar-scripts-prepare/Locales/es_ES/prepare.sh.po b/tcar-scripts-prepare/Locales/es_ES/prepare.sh.po deleted file mode 100644 index 0bf026e..0000000 --- a/tcar-scripts-prepare/Locales/es_ES/prepare.sh.po +++ /dev/null @@ -1,28 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: prepare.sh 0.6\n" -"Report-Msgid-Bugs-To: centos-l10n-es@centos.org.cu\n" -"POT-Creation-Date: 2013-10-28 16:31-0400\n" -"PO-Revision-Date: 2013-10-28 16:31-0400\n" -"Last-Translator: Localization SIG \n" -"Language-Team: Spanish\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: Automation/Modules/Prepare/Modules/Packages/packages.sh:54 -msgid "All required packages are installed already." -msgstr "Todos los paquetes requeridos ya est\'an instalados." - -#: Automation/Modules/Prepare/prepare_setRenderEnvironment.sh:55 -msgid "The option name cannot be empty." -msgstr "El nombre de la opción no puede estar vacío." - -#: Automation/Modules/Prepare/prepare_setRenderEnvironment.sh:64 -msgid "The option value cannot be empty." -msgstr "El valor de la opción no puede estar vacío." - -#: Automation/Modules/Prepare/prepare_setRenderEnvironment.sh:80 -msgid "The search path cannot be empty." -msgstr "El camino de búsqueda no puede estar vacío." diff --git a/tcar-scripts-prepare/prepare.sh b/tcar-scripts-prepare/prepare.sh deleted file mode 100755 index e937bf8..0000000 --- a/tcar-scripts-prepare/prepare.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -###################################################################### -# -# prepare.sh -- This module standardizes configuration tasks related -# to repository workplace. -# -# When you install The CentOS Artwork Repository most of its content -# is in source format. In order to produce final content and make -# the connections between the produced components, you need to -# process the source formats somewhere inside your workstation. -# This module takes the first non-option argument passed in the -# command-line as the workplace where you are going to process -# source formats in your workstation. During the preparation -# process, this module creates the workplace directory structure, -# the workplace connection with The CentOS Artwork Repository using -# symbolic links, and images required to brand other images. -# -# This module should be the first module you run in your workstation -# after installing The CentOS Artwork Repository. -# -# Written by: -# * Alain Reguera Delgado , 2009-2013 -# -# Copyright (C) 2009-2013 The CentOS Artwork SIG -# -# 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 { - - prepare_getOptions - - for TCAR_WORKDIR in ${TCAR_SCRIPT_ARGUMENT};do - prepare_setWorkplace - done - -} diff --git a/tcar-scripts-prepare/prepare_getOptions.sh b/tcar-scripts-prepare/prepare_getOptions.sh deleted file mode 100755 index 67a579d..0000000 --- a/tcar-scripts-prepare/prepare_getOptions.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash -###################################################################### -# -# prepare_getOptions.sh -- This function parses options passed to -# `centos-art.sh' script command-line, when the first argument is -# the `prepare' word. To parse options, this function makes use of -# getopt program. -# -# Written by: -# * Alain Reguera Delgado , 2009-2013 -# -# Copyright (C) 2009-2013 The CentOS Artwork SIG -# -# 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_getOptions { - - # Define short options we want to support. - local ARGSS="h::,v" - - # Define long options we want to support. - local ARGSL="help::,version" - - # Redefine arguments using getopt(1) command parser. - tcar_setModuleArguments - - # Reset positional parameters on this function, using output - # produced from (getopt) arguments parser. - eval set -- "${TCAR_MODULE_ARGUMENT}" - - # Look for options passed through command-line. - while true; do - case "${1}" in - - -h | --help ) - tcar_printHelp "${2}" - ;; - - -v | --version ) - tcar_printVersion "${TCAR_MODULE_NAME}" - ;; - - -- ) - shift 1 - break - ;; - - esac - done - - # Redefine arguments using current positional parameters. Only - # paths should remain as arguments, at this point. - TCAR_MODULE_ARGUMENT="${@}" - -} diff --git a/tcar-scripts-prepare/prepare_getWorkplaceConf.sh b/tcar-scripts-prepare/prepare_getWorkplaceConf.sh deleted file mode 100755 index c62fda3..0000000 --- a/tcar-scripts-prepare/prepare_getWorkplaceConf.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -###################################################################### -# -# prepare_getWorkplaceConf.sh -- This function prints to standard -# output all the models configuration files (and their templates) -# from The CentOS Artwork Repository. -# -# Written by: -# * Alain Reguera Delgado , 2009-2013 -# -# Copyright (C) 2009-2013 The CentOS Artwork SIG -# -# 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_getWorkplaceConf { - - tcar_getFilesList -p '.+\.conf(\.tpl)?$' -t 'f' ${TCAR_BASEDIR}/Models/ - -} diff --git a/tcar-scripts-prepare/prepare_getWorkplaceDir.sh b/tcar-scripts-prepare/prepare_getWorkplaceDir.sh deleted file mode 100755 index b04d034..0000000 --- a/tcar-scripts-prepare/prepare_getWorkplaceDir.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash -###################################################################### -# -# prepare_getWorkplaceDir.sh -- This function transform absolute -# paths to configuration files inside The CentOS Artwork Repository -# to directory absolute paths inside the workplace. -# -# Written by: -# * Alain Reguera Delgado , 2009-2013 -# -# Copyright (C) 2009-2013 The CentOS Artwork SIG -# -# 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_getWorkplaceDir { - - local DIRECTORY=$1 - - echo ${DIRECTORY} \ - | sed -r -e "s!${TCAR_BASEDIR}/Models/!${TCAR_WORKDIR}/!" \ - -e 's!/[a-z]+\.conf(\.tpl)?$!!' - -} diff --git a/tcar-scripts-prepare/prepare_setRenderEnvironment.sh b/tcar-scripts-prepare/prepare_setRenderEnvironment.sh deleted file mode 100755 index 64b8102..0000000 --- a/tcar-scripts-prepare/prepare_setRenderEnvironment.sh +++ /dev/null @@ -1,112 +0,0 @@ -#!/bin/bash -###################################################################### -# -# prepare_setRenderEnvironment.sh -- This function provides a secure -# interface to render content outside the render module. You can use -# this function to call the render module from other modules, -# safely. -# -# This function builds a list of all available configuration files -# in locations passed as argument and reduces the list by applying -# regular expression patterns to each file in the list. Only files -# that match the regular expression pattern will remain in the final -# list. The regular expression patterns are applied to file's -# content, generally to find out if it has an specific option, value -# or combination of both inside. Later, the resultant list of -# configuration files is passed to render module for processing. -# -# This function verifies the search path provided to render module -# to grant it is inside the repository before passing it to render -# module for processing. -# -# Written by: -# * Alain Reguera Delgado , 2009-2013 -# -# Copyright (C) 2009-2013 The CentOS Artwork SIG -# -# 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_setRenderEnvironment { - - OPTIND=1 - while getopts "o:,v:" OPTION "${@}"; do - - case "${OPTION}" in - - o ) - # Define the name of the option you want to look - # configuration files for. - local OPTION_NAME=${OPTARG} - if [[ -z ${OPTION_NAME} ]];then - tcar_printMessage "`gettext "The option name cannot be empty."`" --as-error-line - fi - ;; - - v ) - # Define the value of the option you want to look - # configuration files for. - local OPTION_VALUE=${OPTARG} - if [[ -z ${OPTION_VALUE} ]];then - tcar_printMessage "`gettext "The option value cannot be empty."`" --as-error-line - fi - ;; - - esac - - done - - # Clean up positional parameters to reflect the fact that options - # have been processed already. - shift $(( ${OPTIND} - 1 )) - - # Now that option arguments have been removed from positional - # parameter, verify all other remaining arguments (the search - # paths) do exist. They are required to search. - if [[ -z ${@} ]];then - tcar_printMessage "`gettext "The search path cannot be empty."`" --as-error-line - fi - - # Define array variable to store configuration file paths. - local -a CONFIGURATION_FILES - - # Define final filter regular expression. This regular expression - # must match the option = "value" format we are using inside - # configuration files. - local CONFIGURATION_PATTERN="^${OPTION_NAME}[[:space:]]*=[[:space:]]*\"${OPTION_VALUE}\"$" - - for DIRECTORY in ${@};do - - # Clean-up the search path. This location must point to a - # directory inside the workplace. - DIRECTORY=$(tcar_checkWorkDirSource ${DIRECTORY}) - - # Verify the search path. It must exist and being a directory. - tcar_checkFiles -ed ${DIRECTORY} - - # Define the list of configuration files the render module - # will use as reference to produce documentation. At this - # point it is very difficult that DIRECTORY doesn't exist or - # be outside the workplace directory structure. - CONFIGURATION_FILES[++${#CONFIGURATION_FILES[*]}]=$(tcar_getFilesList \ - -p '.+\.conf$' -t 'l' ${DIRECTORY} \ - | xargs egrep ${CONFIGURATION_PATTERN} | cut -d: -f1 | sort | uniq) - - done - - # Process the list of configuration files using the render module. - tcar_setModuleEnvironment -m "render" -t "parent" ${CONFIGURATION_FILES[*]} -} diff --git a/tcar-scripts-prepare/prepare_setWorkplace.sh b/tcar-scripts-prepare/prepare_setWorkplace.sh deleted file mode 100755 index 798bf44..0000000 --- a/tcar-scripts-prepare/prepare_setWorkplace.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash -###################################################################### -# -# prepare_setWorkplace.sh -- This function rebuilds the workplace -# directory structure based on The CentOS Artwork Repository -# directory structure. This is required because The CentOS Artwork -# Repository directory structure might change from one release to -# another. -# -# Written by: -# * Alain Reguera Delgado , 2009-2013 -# -# Copyright (C) 2009-2013 The CentOS Artwork SIG -# -# 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_setWorkplace { - - local CONF='' - - if [[ -d ${TCAR_WORKDIR} ]];then - tcar_printMessage "`gettext "The workplace you provided already exist and will be removed."`" --as-stdout-line - tcar_printMessage "`gettext "Do you want to continue?"`" --as-yesornorequest-line - tcar_printMessage "${TCAR_WORKDIR}" --as-deleting-line - rm -r ${TCAR_WORKDIR} - fi - - tcar_printMessage "${TCAR_WORKDIR}" --as-creating-line - - for CONF in $(prepare_getWorkplaceConf);do - local TCAR_WORKDIR_DIR=$(prepare_getWorkplaceDir ${CONF}) - local TCAR_WORKDIR_LNK=${TCAR_WORKDIR_DIR}/render.conf - mkdir -p ${TCAR_WORKDIR_DIR} && ln -s ${CONF} ${TCAR_WORKDIR_LNK} - tcar_checkFiles -h ${TCAR_WORKDIR_LNK} - done - - if [[ -d ${TCAR_WORKDIR}/Brands ]];then - tcar_printMessage "`gettext "The workplace doesn't include images for branding other images."`" --as-stdout-line - tcar_printMessage "`gettext "Do you want to render them now?"`" --as-yesornorequest-line - prepare_setRenderEnvironment -o "render-type" -v "svg" Brands - fi - -}