diff --git a/tcar-scripts-prepare/Modules/Conf/Configs/asciidoc.render.conf.tpl b/tcar-scripts-prepare/Modules/Conf/Configs/asciidoc.render.conf.tpl deleted file mode 100644 index 3883162..0000000 --- a/tcar-scripts-prepare/Modules/Conf/Configs/asciidoc.render.conf.tpl +++ /dev/null @@ -1,10 +0,0 @@ -[=SECTION=.html] -render-type = "asciidoc" -render-flow = "article" -render-from = "=SECTION=.asciidoc" -locale-from = "Locales/${TCAR_SCRIPT_LANG_LC}/=SECTION=.asciidoc.po" -images-from = "${TCAR_BASEDIR}/Artworks/Icons/Webenv" -styles-from = "${TCAR_BASEDIR}/Artworks/Webenv/Docbook/1.69.1/Css" -formats = "xhtml" -render-page = "single chunks" - diff --git a/tcar-scripts-prepare/Modules/Conf/Configs/svg.render.conf.tpl b/tcar-scripts-prepare/Modules/Conf/Configs/svg.render.conf.tpl deleted file mode 100644 index 10d323d..0000000 --- a/tcar-scripts-prepare/Modules/Conf/Configs/svg.render.conf.tpl +++ /dev/null @@ -1,6 +0,0 @@ -[=SECTION=.png] -render-type = "svg" -render-flow = "base" -render-from = "=SECTION=.svg" -locale-from = "Locales/${TCAR_SCRIPT_LANG_LC}/=SECTION=.svg.po" - diff --git a/tcar-scripts-prepare/Modules/Conf/Configs/svgz.render.conf.tpl b/tcar-scripts-prepare/Modules/Conf/Configs/svgz.render.conf.tpl deleted file mode 100644 index 6e45b4e..0000000 --- a/tcar-scripts-prepare/Modules/Conf/Configs/svgz.render.conf.tpl +++ /dev/null @@ -1,6 +0,0 @@ -[=SECTION=.png] -render-type = "svg" -render-flow = "base" -render-from = "=SECTION=.svgz" -locale-from = "Locales/${TCAR_SCRIPT_LANG_LC}/=SECTION=.svgz.po" - diff --git a/tcar-scripts-prepare/Modules/Conf/conf.sh b/tcar-scripts-prepare/Modules/Conf/conf.sh deleted file mode 100755 index 4000d9f..0000000 --- a/tcar-scripts-prepare/Modules/Conf/conf.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/bash -###################################################################### -# -# conf.sh -- This module prepares configuration files used by both -# render and locale modules. -# -# To build the configuration file, this module creates a list of -# files to process based on the arguments provided in the -# command-line line. With this list, then, it creates the -# configuration file using configuration templates for each file -# extension supported inside the repository. -# -# The configuration file this module creates doesn't include options -# like brand which require information about the image you are about -# to produce. The intention of this module is create the -# configuration files you need to produce content right away in the -# simplest way possible and then letting you improve it as needed. -# -# The name and location of the final configuration file is that -# passed as argument to prepare module in the command-line. -# -# Written by: -# * Alain Reguera Delgado , 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 conf { - - # Verify that a configuration file was provided as argument. - if [[ $# -eq 0 ]];then - tcar_printMessage "`gettext "The configuration file wasn't provided."`" --as-error-line - fi - - # Define configuration file. - local CONF_FILE=$(tcar_checkRepoDirSource "${1}") - tcar_checkFiles -m "\.conf$" ${CONF_FILE} - - # Define parent directory of configuration file. - local CONF_DIR=$(dirname ${CONF_FILE}) - tcar_checkFiles -ed "${CONF_DIR}" - - # Build the list of files to process. This is all the source files - # we want to produce th configuration file for. - local SOURCE_FILES=$(tcar_getFilesList ${CONF_DIR} \ - --mindepth=1 --maxdepth=1 --type=f \ - --pattern='.+\.(svgz|svg|asciidoc)$') - - # Verify the list of files to process. - tcar_checkFiles -ef ${SOURCE_FILES} - - # Print action message. - tcar_printMessage "${CONF_FILE}" --as-creating-line - - # Process list of files. - for SOURCE_FILE in ${SOURCE_FILES};do - - local CONF_FILE_NAME=$(tcar_getFileName "${SOURCE_FILE}") - local CONF_FILE_EXTENSION=$(tcar_getFileExtension "${SOURCE_FILE}") - local CONF_FILE_TEMPLATE=${TCAR_MODULE_DIR_CONFIGS}/${CONF_FILE_EXTENSION}.render.conf.tpl - - sed -r "s/=SECTION=/${CONF_FILE_NAME}/g" ${CONF_FILE_TEMPLATE} >> ${CONF_FILE} - - done - -} diff --git a/tcar-scripts-prepare/Modules/Documents/documents.sh b/tcar-scripts-prepare/Modules/Documents/documents.sh deleted file mode 100755 index 8f13836..0000000 --- a/tcar-scripts-prepare/Modules/Documents/documents.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -###################################################################### -# -# documents.sh -- This function renders all documentation files -# inside the repository using the render module. -# -# 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 documents { - - # Define base location where configuration files will be searched - # from. You can provide more than one location here. - local DIRS='/' - - # Define the name of the option you want to look configuration - # files for. - local NAME='render-type' - - # Define the value of the option you want to look configuration - # files for. - local VALUE='asciidoc' - - # Render configuration files that match specified options and - # values in the search directories. - prepare_setRenderEnvironment -o "${NAME}" -v "${VALUE}" "${DIRS}" - -} diff --git a/tcar-scripts-prepare/Modules/Images/images.sh b/tcar-scripts-prepare/Modules/Images/images.sh deleted file mode 100755 index 5916d70..0000000 --- a/tcar-scripts-prepare/Modules/Images/images.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash -###################################################################### -# -# images.sh -- This function renders all configuration images files -# inside the repository, using the render module and the correct -# production order. -# -# 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 images { - - # CAUTION: The order in which repository components are processed - # affect the final result. For instance, in order for theme images - # to hold the CentOS 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 but combined with them using - # ImageMagick, once they both have been rendered as PNG files. - - # Define base location where configuration files will be searched - # from. You can provide more than one location here. - local DIRS="\ - Artworks/Brands\ - Artworks/Documentation\ - Artworks/Themes" - - # Define the name of the option you want to look configuration - # files for. - local NAME='render-type' - - # Define the value of the option you want to look configuration - # files for. - local VALUE='svg' - - # Render configuration files that match specified options and - # values in the search directories. - prepare_setRenderEnvironment -o "${NAME}" -v "${VALUE}" "${DIRS}" - -} diff --git a/tcar-scripts-prepare/Modules/Links/Configs/render.conf b/tcar-scripts-prepare/Modules/Links/Configs/render.conf deleted file mode 100755 index 6982fd7..0000000 --- a/tcar-scripts-prepare/Modules/Links/Configs/render.conf +++ /dev/null @@ -1,26 +0,0 @@ -# Install centos-art command. -[centos-art] -render-type = "symlink" -render-from = "${TCAR_BASEDIR}/Automation/centos-art.sh" -link-target = "${HOME}/bin" - -# Install vim's settings used as convention to edit files inside the -# repository. In case the conventions change, and link-target is -# updated inside the repository, the new conventions will be available -# to you immediately after fetching changes from central repository. -[.vimrc] -render-type = "symlink" -render-from = "${TCAR_BASEDIR}/Automation/Modules/Prepare/Modules/Links/Configs/vimrc" -link-target = "${HOME}" - -# Install corporate typography. -[denmark.ttf] -render-type = "symlink" -render-from = "${TCAR_BASEDIR}/Artworks/Fonts/denmark.ttf" -link-target = "${HOME}/.fonts" - -# Install corporate palette of colors (for inkscape). -[corporate.gpl] -render-type = "symlink" -render-from = "${TCAR_BASEDIR}/Artworks/Palettes/corporate.gpl" -link-target = "${HOME}/.inkscape/palettes" diff --git a/tcar-scripts-prepare/Modules/Links/Configs/vimrc b/tcar-scripts-prepare/Modules/Links/Configs/vimrc deleted file mode 100755 index 5737ebd..0000000 --- a/tcar-scripts-prepare/Modules/Links/Configs/vimrc +++ /dev/null @@ -1,8 +0,0 @@ -set nu -set textwidth=70 -set autoindent -set tabstop=4 -set softtabstop=4 -set shiftwidth=4 -set expandtab -set tags=./tags,tags diff --git a/tcar-scripts-prepare/Modules/Links/links.sh b/tcar-scripts-prepare/Modules/Links/links.sh deleted file mode 100755 index d33b94a..0000000 --- a/tcar-scripts-prepare/Modules/Links/links.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -###################################################################### -# -# links.sh -- This function renders configuration files inside -# automation scripts directory structure, using the render module. -# These configuration files are mainly used to connect content -# inside the repository with applications outside the repository, -# using symbolic links. -# -# 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 links { - - # Define base location where configuration files will be searched - # from. You can provide more than one location here. - local DIRS="/" - - # Define the name of the option you want to look configuration - # files for. - local NAME='render-type' - - # Define the value of the option you want to look configuration - # files for. - local VALUE='symlink' - - # Render configuration files that match specified options and - # values in the search directories. - prepare_setRenderEnvironment -o "${NAME}" -v "${VALUE}" "${DIRS}" - -} - diff --git a/tcar-scripts-prepare/Modules/Locales/locales.sh b/tcar-scripts-prepare/Modules/Locales/locales.sh deleted file mode 100755 index b733cb1..0000000 --- a/tcar-scripts-prepare/Modules/Locales/locales.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -###################################################################### -# -# locales.sh -- This module retrieves translatable strings from -# automation scripts and creates the related machine objects, so -# script messages can be rendered in different languages. -# -# 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 locales { - - tcar_setModuleEnvironment locale "Automation/centos-art.sh" --update - -} diff --git a/tcar-scripts-prepare/Modules/Packages/packages.sh b/tcar-scripts-prepare/Modules/Packages/packages.sh deleted file mode 100755 index 17c0695..0000000 --- a/tcar-scripts-prepare/Modules/Packages/packages.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash -###################################################################### -# -# packages.sh -- This function defines and verifies packages -# required by centos-art.sh script. -# -# 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 packages { - - # Define required packages used by centos-art.sh script inside - # CentOS base repository. - local BASE_PACKAGES="ImageMagick netpbm netpbm-progs syslinux-perl - gimp coreutils texinfo texinfo-tex info tetex-latex - tetex-fonts tetex-xdvi tetex-dvips gettext texi2html libxml2 - gnome-doc-utils elinks docbook-style-xsl docbook-utils - docbook-dtds docbook-style-dsssl docbook-simple - docbook-utils-pdf docbook-slides firefox sudo yum rpm ctags - vim-enhanced" - - # Define required packages used by centos-art.sh script inside - # EPEL repository. Start verifying the package that contains - # repository configuration, then everything else. - local EPEL_PACKAGES="epel-release inkscape asciidoc" - - # Verify required packages. The order in which packages are - # verified my help to reduce some loops (e.g., verify packages - # containing the repository's configuration files first and - # packages from that repository later. It is rather possible that - # you won't be able to install any package from a repository you - # don't have configuration files for, in first place). - tcar_checkFiles -n ${BASE_PACKAGES} ${EPEL_PACKAGES} - - # Print a confirmation message here. - tcar_printMessage "`gettext "All required packages are installed already."`" --as-stdout-line - -} diff --git a/tcar-scripts-prepare/prepare.sh b/tcar-scripts-prepare/prepare.sh index 8a9f95c..32ab08d 100755 --- a/tcar-scripts-prepare/prepare.sh +++ b/tcar-scripts-prepare/prepare.sh @@ -1,17 +1,22 @@ #!/bin/bash ###################################################################### # -# prepare.sh -- This module standardizes repository configuration -# tasks. -# -# When you download a fresh working copy of CentOS artwork -# repository, most of its content is in source format. You need to -# process source formats in order to produce final content and make -# the connections between components (e.g., render brand images so -# they can be applied to other images). This function takes care of -# those actions and should be the first module you run in your -# workstation after downloading a fresh working copy of CentOS -# artwork repository. +# 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 @@ -36,17 +41,13 @@ function prepare { - local ACTION='' - local ACTIONS='' - prepare_getOptions - if [[ -z ${ACTIONS} ]];then - ACTIONS='packages locales images docs links' - fi + # Define absolute path to workplace. The workplace is where final + # images produced from source files will be stored and organized + # in. + local TCAR_WORKPLACE=${TCAR_SCRIPT_ARGUMENT} - for ACTION in ${ACTIONS};do - tcar_setModuleEnvironment -m "${ACTION}" -t "child" ${TCAR_MODULE_ARGUMENT} - done + prepare_setWorkplace } diff --git a/tcar-scripts-prepare/prepare_getOptions.sh b/tcar-scripts-prepare/prepare_getOptions.sh index 80b35e3..67a579d 100755 --- a/tcar-scripts-prepare/prepare_getOptions.sh +++ b/tcar-scripts-prepare/prepare_getOptions.sh @@ -33,7 +33,7 @@ function prepare_getOptions { local ARGSS="h::,v" # Define long options we want to support. - local ARGSL="help::,version,packages,locales,links,documents,images,conf" + local ARGSL="help::,version" # Redefine arguments using getopt(1) command parser. tcar_setModuleArguments @@ -54,36 +54,6 @@ function prepare_getOptions { tcar_printVersion "${TCAR_MODULE_NAME}" ;; - --packages ) - ACTIONS="${ACTIONS} packages" - shift 1 - ;; - - --locales ) - ACTIONS="${ACTIONS} locales" - shift 1 - ;; - - --links ) - ACTIONS="${ACTIONS} links" - shift 1 - ;; - - --documents ) - ACTIONS="${ACTIONS} documents" - shift 1 - ;; - - --images ) - ACTIONS="${ACTIONS} images" - shift 1 - ;; - - --conf ) - ACTIONS="${ACTIONS} conf" - shift 1 - ;; - -- ) shift 1 break diff --git a/tcar-scripts-prepare/prepare_getWorkplaceConf.sh b/tcar-scripts-prepare/prepare_getWorkplaceConf.sh new file mode 100644 index 0000000..c62fda3 --- /dev/null +++ b/tcar-scripts-prepare/prepare_getWorkplaceConf.sh @@ -0,0 +1,33 @@ +#!/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 new file mode 100644 index 0000000..9cf939a --- /dev/null +++ b/tcar-scripts-prepare/prepare_getWorkplaceDir.sh @@ -0,0 +1,37 @@ +#!/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_WORKPLACE}/!" \ + -e 's!/[a-z]+\.conf(\.tpl)?$!!' + +} diff --git a/tcar-scripts-prepare/prepare_setRenderEnvironment.sh b/tcar-scripts-prepare/prepare_setRenderEnvironment.sh index dc8d91e..1542475 100755 --- a/tcar-scripts-prepare/prepare_setRenderEnvironment.sh +++ b/tcar-scripts-prepare/prepare_setRenderEnvironment.sh @@ -103,7 +103,7 @@ function prepare_setRenderEnvironment { # point it is very difficult that DIRECTORY doesn't exist or # be outside the repository directory structure. CONFIGURATION_FILES[++${#CONFIGURATION_FILES[*]}]=$(tcar_getFilesList \ - ${DIRECTORY} --pattern='.+\.conf$' --type='f' \ + ${DIRECTORY} -p '.+\.conf$' -t 'f' \ | xargs egrep ${CONFIGURATION_PATTERN} | cut -d: -f1 | sort | uniq) done diff --git a/tcar-scripts-prepare/prepare_setWorkplace.sh b/tcar-scripts-prepare/prepare_setWorkplace.sh new file mode 100644 index 0000000..d29a81e --- /dev/null +++ b/tcar-scripts-prepare/prepare_setWorkplace.sh @@ -0,0 +1,57 @@ +#!/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_WORKPLACE} ]];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_WORKPLACE}" --as-removing-line + rm -r ${TCAR_WORKPLACE} + fi + + tcar_printMessage "${TCAR_WORKPLACE}" --as-creating-line + + for CONF in $(prepare_getWorkplaceConf);do + local TCAR_WORKPLACE_DIR=$(prepare_getWorkplaceDir ${CONF}) + local TCAR_WORKPLACE_LNK=${TCAR_WORKPLACE_DIR}/render.conf + mkdir -p ${TCAR_WORKPLACE_DIR} && ln -s ${CONF} ${TCAR_WORKPLACE_LNK} + tcar_checkFiles -s ${TCAR_WORKPLACE_LNK} + done + + if [[ -d ${TCAR_WORKPLACE}/Brands ]];then + tcar_printMessage "`gettext "The workplace doesn't include images for branding other images."`" + tcar_printMessage "`gettext "Do you want to render them now?"`" --as-yesornorequest-line + prepare_setRenderEnvironment -o "render-type" -v "svg" ${TCAR_WORKPLACE}/Brands + fi + +}