diff --git a/Automation/Functions/Commons/cli.sh b/Automation/Functions/Commons/cli.sh deleted file mode 100755 index 9d9a17d..0000000 --- a/Automation/Functions/Commons/cli.sh +++ /dev/null @@ -1,136 +0,0 @@ -#!/bin/bash -# -# cli.sh -- This function initiates the centos-art.sh script -# command-line interface. Variables defined in this function are -# accesible by all other functions. The cli function is the first -# script executed by centos-art.sh, onces executed in a terminal. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function cli { - - # Initialize global variables. - local CLI_FUNCNAME='' - local CLI_FUNCDIRNAM='' - local CLI_FUNCSCRIPT='' - local ARGUMENTS='' - - # Initialize default value to filter flag. The filter flag - # (--filter) is used mainly to reduce the number of files to - # process. The value of this variable is interpreted as - # egrep-posix regular expression. By default, when the --filter - # option is not provided, all paths in the working copy must match - # except files under hidden directories like `.svn'. We do this in - # conjunction with `cli_getFilesList', when building the list of - # files that will be processed. - local FLAG_FILTER='[[:alnum:]_/-]+' - - # Initialize default value to verbosity flag. The verbosity flag - # (-v | --verbose) controls whether centos-art.sh script prints - # messages or not. By default, all messages are suppressed except - # those directed to standard error. - local FLAG_QUIET='false' - - # Initialize default value to answer flag. The answer flag - # (--answer-yes) controls whether centos-art.sh script does or - # does not pass confirmation request points. By default, it - # doesn't. - local FLAG_ANSWER='false' - - # Initialize default value to commit changes flag. This flag - # (--synchronize) controls whether version control system is - # triggered or not after realizing changes to source files under - # version control. - local FLAG_SYNCHRONIZE='false' - - # Initialize list of common functionalities to load. - local FILES=$(ls ${CLI_FUNCDIR}/Commons/*.sh) - - # Initialize common functionalities. - for FILE in ${FILES};do - if [[ -x ${FILE} ]];then - . ${FILE} - export -f $(grep '^function ' ${FILE} | cut -d' ' -f2) - else - echo "`eval_gettext "The \\\$FILE needs to have execution rights."`" - exit - fi - done - - # Trap signals in order to terminate the script execution - # correctly (e.g., removing all temporal files before leaving). - # Trapping the exit signal seems to be enough by now, since it is - # always present as part of the script execution flow. Each time - # the centos-art.sh script is executed it will inevitably end with - # an EXIT signal at some point of its execution, even if it is - # interrupted in the middle of its execution (e.g., through - # `Ctrl+C'). - trap cli_terminateScriptExecution 0 - - # Redefine ARGUMENTS variable using current positional parameters. - cli_parseArgumentsReDef "$@" - - # Check function name. The function name is critical for - # centos-art.sh script to do something coherent. If it is not - # provided, execute the help functionality and end script - # execution. - if [[ ! "$1" ]] || [[ ! "$1" =~ '^[[:alpha:]]' ]];then - cli_runFnEnvironment help --read --format="texinfo" tcar-fs::: - exit - fi - - # Define function name (CLI_FUNCNAME) using the first argument in - # the command-line. - CLI_FUNCNAME=$(cli_getRepoName $1 -f | cut -d '-' -f1) - - # Define function directory. - CLI_FUNCDIRNAM=$(cli_getRepoName $CLI_FUNCNAME -d) - - # Define function file name. - CLI_FUNCSCRIPT=${CLI_FUNCDIR}/${CLI_FUNCDIRNAM}/${CLI_FUNCNAME}.sh - - # Check function script execution rights. - cli_checkFiles -x "${CLI_FUNCSCRIPT}" - - # Remove the first argument passed to centos-art.sh command-line - # in order to build optional arguments inside functionalities. We - # start counting from second argument (inclusive) on. - shift 1 - - # Redefine ARGUMENTS using current positional parameters. - cli_parseArgumentsReDef "$@" - - # Define default text editors used by centos-art.sh script. - if [[ ! "$EDITOR" =~ '/usr/bin/(vim|emacs|nano)' ]];then - EDITOR='/usr/bin/vim' - fi - - # Check text editor execution rights. - cli_checkFiles -x ${EDITOR} - - # Go for function initialization. Keep the cli_exportFunctions - # function calling after all variables and arguments definitions. - cli_exportFunctions "${CLI_FUNCDIRNAM}/${CLI_FUNCNAME}" - - # Execute function. - $CLI_FUNCNAME - -} diff --git a/Automation/Functions/Commons/cli_checkFiles.sh b/Automation/Functions/Commons/cli_checkFiles.sh deleted file mode 100755 index 3c65ed4..0000000 --- a/Automation/Functions/Commons/cli_checkFiles.sh +++ /dev/null @@ -1,187 +0,0 @@ -#!/bin/bash -# -# cli_checkFiles.sh -- This function standardizes the way file -# conditional expressions are applied inside centos-art.sh script. -# Here is where we answer questions like: is the file a regular file -# or a directory? Or, is it a symbolic link? Or even, does it have -# execution rights, etc. If the verification fails somehow at any -# point, an error message is output and centos-art.sh script finishes -# its execution. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function cli_checkFiles { - - # Define short options. - local ARGSS='i:,r,m:,n,d,e,f,h,x' - - # Define long options. - local ARGSL='mime:,is-versioned,match:,is-installed' - - # Initialize array variables. - local -a CONDITION_COMMAND - local -a CONDITION_PATTERN - local -a CONDITION_MESSAGE - - # Initialize array variable counter. - local COUNTER=0 - - # Initialize arguments with an empty value and set it as local - # variable to this function scope. Doing this is very important to - # avoid any clash with higher execution environments. - local ARGUMENTS='' - - # Prepare ARGUMENTS for getopt. - cli_parseArgumentsReDef "$@" - - # Redefine ARGUMENTS using getopt(1) command parser. - cli_parseArguments - - # Redefine positional parameters using ARGUMENTS variable. - eval set -- "$ARGUMENTS" - - # Look for options passed through positional parameters. - while true; do - - case "$1" in - - -d ) - CONDITION_COMMAND[((++${#CONDITION_COMMAND[*]}))]='test' - CONDITION_PATTERN[((++${#CONDITION_PATTERN[*]}))]='-d' - CONDITION_MESSAGE[((++${#CONDITION_MESSAGE[*]}))]="`gettext "isn't a directory."`" - shift 1 - ;; - - -e ) - CONDITION_COMMAND[((++${#CONDITION_COMMAND[*]}))]='test' - CONDITION_PATTERN[((++${#CONDITION_PATTERN[*]}))]='-e' - CONDITION_MESSAGE[((++${#CONDITION_MESSAGE[*]}))]="`gettext "doesn't exist."`" - shift 1 - ;; - - -f ) - CONDITION_COMMAND[((++${#CONDITION_COMMAND[*]}))]='test' - CONDITION_PATTERN[((++${#CONDITION_PATTERN[*]}))]='-f' - CONDITION_MESSAGE[((++${#CONDITION_MESSAGE[*]}))]="`gettext "isn't a regular file."`" - shift 1 - ;; - - -h ) - CONDITION_COMMAND[((++${#CONDITION_COMMAND[*]}))]='test' - CONDITION_PATTERN[((++${#CONDITION_PATTERN[*]}))]='-h' - CONDITION_MESSAGE[((++${#CONDITION_MESSAGE[*]}))]="`gettext "isn't a symbolic link."`" - shift 1 - ;; - - -x ) - CONDITION_COMMAND[((++${#CONDITION_COMMAND[*]}))]='test' - CONDITION_PATTERN[((++${#CONDITION_PATTERN[*]}))]='-x' - CONDITION_MESSAGE[((++${#CONDITION_MESSAGE[*]}))]="`gettext "isn't an executable file."`" - shift 1 - ;; - - -i | --mime ) - local MIME=$2 - CONDITION_COMMAND[((++${#CONDITION_COMMAND[*]}))]='file' - CONDITION_PATTERN[((++${#CONDITION_PATTERN[*]}))]='-bi' - CONDITION_MESSAGE[((++${#CONDITION_MESSAGE[*]}))]="`eval_gettext "isn't a \\\"\\\$MIME\\\" file."`" - shift 2 - ;; - - -m | --match ) - CONDITION_COMMAND[((++${#CONDITION_COMMAND[*]}))]='match' - CONDITION_PATTERN[((++${#CONDITION_PATTERN[*]}))]="$2" - CONDITION_MESSAGE[((++${#CONDITION_MESSAGE[*]}))]="`eval_gettext "doesn't match its pattern."`" - shift 2 - ;; - - -r | --is-versioned ) - CONDITION_COMMAND[((++${#CONDITION_COMMAND[*]}))]="centos-art" - CONDITION_PATTERN[((++${#CONDITION_PATTERN[*]}))]="vcs --is-versioned" - CONDITION_MESSAGE[((++${#CONDITION_MESSAGE[*]}))]="" - shift 1 - ;; - - -n | --is-installed ) - CONDITION_COMMAND[((++${#CONDITION_COMMAND[*]}))]="rpm" - CONDITION_PATTERN[((++${#CONDITION_PATTERN[*]}))]="-q --quiet" - CONDITION_MESSAGE[((++${#CONDITION_MESSAGE[*]}))]="`gettext "isn't installed in the system."`" - shift 1 - ;; - - -- ) - shift 1 - break - ;; - - esac - done - - # Define list of files we want to apply verifications to, now that - # all option-like arguments have been removed from positional - # parameters list so we are free to go with the verifications. - local FILE='' - local FILES=$@ - - for FILE in $FILES;do - - until [[ ${COUNTER} -eq ${#CONDITION_PATTERN[*]} ]];do - - case ${CONDITION_COMMAND[$COUNTER]} in - - "test" | "rpm" ) - ${CONDITION_COMMAND[$COUNTER]} ${CONDITION_PATTERN[$COUNTER]} ${FILE} \ - || cli_printMessage "${FILE} ${CONDITION_MESSAGE[$COUNTER]}" --as-error-line - ;; - - "centos-art" ) - # Don't create another level for error messages here - # (that would duplicate them unnecessarily). Instead, - # set error messages inside specific functionalities - # and use them directly from there. - cli_runFnEnvironment ${CONDITION_PATTERN[$COUNTER]} ${FILE} - ;; - - "file" ) - if [[ ! $(${CONDITION_COMMAND[$COUNTER]} ${CONDITION_PATTERN[$COUNTER]} ${FILE}) == "$MIME" ]];then - cli_printMessage "${FILE} ${CONDITION_MESSAGE[$COUNTER]}" --as-error-line - fi - ;; - - "match" ) - if [[ ! ${FILE} =~ "${CONDITION_PATTERN[$COUNTER]}" ]];then - cli_printMessage "${FILE} ${CONDITION_MESSAGE[$COUNTER]}" --as-error-line - fi - ;; - - * ) - cli_printMessage "`gettext "The condition command provided isn't supported."`" --as-error-line - ;; - - esac - - COUNTER=$(($COUNTER + 1)) - - done - - done - -} diff --git a/Automation/Functions/Commons/cli_checkRepoDirSource.sh b/Automation/Functions/Commons/cli_checkRepoDirSource.sh deleted file mode 100755 index c7a299a..0000000 --- a/Automation/Functions/Commons/cli_checkRepoDirSource.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/bash -# -# cli_checkRepoDirSource.sh -- This function standardizes the path -# construction to directories inside the working copy, using absolute -# paths. This function transforms relative paths passed as non-option -# arguments to centos-art.sh script command-line into absolute paths -# inside the working copy based on whether you are using Subversion or -# Git as version control system. Further verifications, (e.g., whether -# they really exist as directories inside the working copy or not) -# should be realized outside this function. -# -# NOTE: Transforming relative paths into absolute paths before -# processing them is very useful when you need to execute the -# centos-art.sh script as command (e.g., `centos-art') anywhere -# inside the workstation. -# -# Use this function whenever you need to be sure that non-option -# arguments passed to centos-art.sh script command-line will always -# point to directories inside the working copy. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function cli_checkRepoDirSource { - - local LOCATION=${1} - - # Remove any dot from arguments passed to centos-art.sh script. - # This way it is possible to use a single dot to reflect the - # current location from which centos-art.sh was executed. Notice - # that using a dot as argument is optional (e.g.: when you pass no - # argument to centos-art command-line, the current location is - # used as default location). However, it might be useful to use a - # dot as argument when you want to include the current location in - # a list of arguments to process. - LOCATION=$(echo "$LOCATION" | sed -r "s,^\.$,$(pwd),g") - - # Remove the working directory absolute path from location to - # avoid path duplications here. - LOCATION=$(echo "$LOCATION" | sed "s,${TCAR_WORKDIR}/,,g") - - # When we use Git as version control system, there isn't a need of - # using the `trunk', `branches', `tags' convention we were using - # for Subversion. The working copy begins directly with the - # content of our repository (e.g., Documentation, Scripts, - # Identity and Locales). - # - # When we use Subversion as version control system, we follow the - # `trunk', `branches', `tags' convention to organize files inside - # the repository and need to redefine the source path in order to - # build the repository absolute path from the repository top level - # on. As convention, when you prepare your working copy through - # centos-art.sh script, the absolute path to the `trunk/' - # directory is used as working copy. This is, path arguments - # provided to centos-art.sh script will be interpreted from trunk/ - # directory level on. For example, the following command should - # work correctly in both Subversion and Git repositories: - # - # centos-art render Documentation/Manuals/Docbook/Tcar-ug - # - # There isn't a need of verifying the paths built here. This is - # something we do later, using the cli_checkFiles function. We - # don't do the file verification here to avoid malformed error - # messages when we reassign variable values using this function as - # reference (e.g., in order to prevent error messages from being - # stored inside variables.). - LOCATION=${TCAR_WORKDIR}/${LOCATION} - - # Output the absolute path to location. - echo "${LOCATION}" - -} diff --git a/Automation/Functions/Commons/cli_expandTMarkers.sh b/Automation/Functions/Commons/cli_expandTMarkers.sh deleted file mode 100755 index d8b6806..0000000 --- a/Automation/Functions/Commons/cli_expandTMarkers.sh +++ /dev/null @@ -1,194 +0,0 @@ -#!/bin/bash -# -# cli_expandTMarkers.sh -- This function standardizes construction of -# translation markers and their related expansion. As convention, -# translation markers must be set inside source files (e.g., Docbook, -# Svg, etc.) and expanded inside temporal instances used to produce -# final contents. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function cli_expandTMarkers { - - # Initialize variables. - local -a SRC - local -a DST - local COUNT=0 - local COUNTSRC=0 - local COUNTDST=0 - - # Define source location on which sed replacements take place. - local LOCATION="$1" - - # Verify that source location does exist. - cli_checkFiles -e ${LOCATION} - - # Define copyright translation markers. - SRC[((++${#SRC[*]}))]='=COPYRIGHT_YEAR(_LAST)?=' - DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --year)" - SRC[((++${#SRC[*]}))]='=COPYRIGHT_YEAR(S)?_LIST=' - DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --years-list)" - SRC[((++${#SRC[*]}))]='=COPYRIGHT_HOLDER=' - DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --holder)" - SRC[((++${#SRC[*]}))]='=COPYRIGHT_HOLDER_PREDICATE=' - DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --holder-predicate)" - - # Define name of branding files. This files are mainly used under - # Identity/(Images|Models)/Brands/ directory structure. These - # file names may vary from one project to another so we use this - # variable to control the name of such files. - SRC[((++${#SRC[*]}))]='=BRAND=' - DST[((++${#DST[*]}))]="${TCAR_BRAND}" - - # Define license translation markers. - SRC[((++${#SRC[*]}))]='=LICENSE=' - DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --license)" - SRC[((++${#SRC[*]}))]='=LICENSE_URL=' - DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --license-url)" - - # Define theme translation markers. - SRC[((++${#SRC[*]}))]='=THEME=' - DST[((++${#DST[*]}))]="$(cli_getPathComponent $OUTPUT --motif)" - SRC[((++${#SRC[*]}))]='=THEMENAME=' - DST[((++${#DST[*]}))]="$(cli_getPathComponent $OUTPUT --motif-name)" - SRC[((++${#SRC[*]}))]='=THEMERELEASE=' - DST[((++${#DST[*]}))]="$(cli_getPathComponent $OUTPUT --motif-release)" - - # Define release-specific translation markers. - SRC[((++${#SRC[*]}))]='=RELEASE=' - DST[((++${#DST[*]}))]="$FLAG_RELEASEVER" - SRC[((++${#SRC[*]}))]='=MAJOR_RELEASE=' - DST[((++${#DST[*]}))]="$(echo $FLAG_RELEASEVER | cut -d'.' -f1)" - SRC[((++${#SRC[*]}))]='=MINOR_RELEASE=' - DST[((++${#DST[*]}))]="$(echo $FLAG_RELEASEVER | cut -d'.' -f2)" - - # Define architectures translation markers. - SRC[((++${#SRC[*]}))]='=ARCH=' - DST[((++${#DST[*]}))]="$(cli_getPathComponent $FLAG_BASEARCH --architecture)" - - # Define url translation markers. - SRC[((++${#SRC[*]}))]='=URL=' - DST[((++${#DST[*]}))]=$(cli_printUrl '--home' '--with-locale') - SRC[((++${#SRC[*]}))]='=URL_WIKI=' - DST[((++${#DST[*]}))]=$(cli_printUrl '--wiki' '--with-locale') - SRC[((++${#SRC[*]}))]='=URL_LISTS=' - DST[((++${#DST[*]}))]=$(cli_printUrl '--lists' '--with-locale') - SRC[((++${#SRC[*]}))]='=URL_FORUMS=' - DST[((++${#DST[*]}))]=$(cli_printUrl '--forums' '--with-locale') - SRC[((++${#SRC[*]}))]='=URL_MIRRORS=' - DST[((++${#DST[*]}))]=$(cli_printUrl '--mirrors' '--with-locale') - SRC[((++${#SRC[*]}))]='=URL_DOCS=' - DST[((++${#DST[*]}))]=$(cli_printUrl '--docs' '--with-locale') - SRC[((++${#SRC[*]}))]='=URL_PROJECTS=' - DST[((++${#DST[*]}))]=$(cli_printUrl '--projects' '--with-locale') - SRC[((++${#SRC[*]}))]='=URL_BUGS=' - DST[((++${#DST[*]}))]=$(cli_printUrl '--bugs' '--with-locale') - SRC[((++${#SRC[*]}))]='=URL_SVN=' - DST[((++${#DST[*]}))]=$(cli_printUrl '--svn' '--with-locale') - SRC[((++${#SRC[*]}))]='=URL_TRAC=' - DST[((++${#DST[*]}))]=$(cli_printUrl '--trac' '--with-locale') - SRC[((++${#SRC[*]}))]='=URL_PLANET=' - DST[((++${#DST[*]}))]=$(cli_printUrl '--planet' '--with-locale') - - # Define emails translation markers. - SRC[((++${#SRC[*]}))]='=MAIL_DOCS=' - DST[((++${#DST[*]}))]="$(cli_printMailingList --docs)" - - # Define locale translation markers. - SRC[((++${#SRC[*]}))]='=LOCALE=' - DST[((++${#DST[*]}))]="${CLI_LANG_LC}" - SRC[((++${#SRC[*]}))]='=LOCALE_LL=' - DST[((++${#DST[*]}))]="${CLI_LANG_LL}" - SRC[((++${#SRC[*]}))]='=LOCALE_CC=' - DST[((++${#DST[*]}))]="${CLI_LANG_CC}" - - # Define domain translation markers for domains. - SRC[((++${#SRC[*]}))]='=DOMAIN_LL=' - if [[ ! ${CLI_LANG_LL} =~ '^en' ]];then - DST[((++${#DST[*]}))]="${CLI_LANG_LL}" - else - DST[((++${#DST[*]}))]="" - fi - - # Define repository translation markers. - SRC[((++${#SRC[*]}))]='=(REPO_TLDIR|REPO_HOME|TCAR_WORKDIR)=' - DST[((++${#DST[*]}))]="${TCAR_WORKDIR}" - - # Do replacement of nested translation markers. - while [[ $COUNTDST -lt ${#DST[@]} ]];do - - # Verify existence of translation markers. If there is no - # translation marker on replacement, continue with the next - # one in the list. - if [[ ! ${DST[$COUNTDST]} =~ '=[A-Z_]+=' ]];then - # Increment destination counter. - COUNTDST=$(($COUNTDST + 1)) - # The current replacement value doesn't have translation - # marker inside, so skip it and evaluate the next - # replacement value in the list. - continue - fi - - while [[ $COUNTSRC -lt ${#SRC[*]} ]];do - - # Update replacements. - DST[$COUNTDST]=$(echo ${DST[$COUNTDST]} \ - | sed -r "s!${SRC[$COUNTSRC]}!${DST[$COUNTSRC]}!g") - - # Increment source counter. - COUNTSRC=$(($COUNTSRC + 1)) - - done - - # Reset source counter - COUNTSRC=0 - - # Increment destination counter. - COUNTDST=$(($COUNTDST + 1)) - - done - - # Apply replacements for translation markers. - while [[ ${COUNT} -lt ${#SRC[*]} ]];do - - # Use sed to replace translation markers inside the design - # model instance. - sed -r -i "s!${SRC[$COUNT]}!${DST[$COUNT]}!g" ${LOCATION} - - # Increment counter. - COUNT=$(($COUNT + 1)) - - done - - # Remove escaped character from translation markers. This is one - # of the reasons why translation marker should be expanded in - # source files instances not the source files themselves. - # Escaping translation markers provides a way of talking about - # them without expanding them. - sed -r -i 's/(=)\\([A-Z_]+=)/\1\2/g' ${LOCATION} - - # Unset specific translation markers and specific replacement - # variables in order to clean them up. Otherwise, undesired values - # may remain from one file to another. - unset SRC - unset DST - -} diff --git a/Automation/Functions/Commons/cli_exportFunctions.sh b/Automation/Functions/Commons/cli_exportFunctions.sh deleted file mode 100755 index 1af3c72..0000000 --- a/Automation/Functions/Commons/cli_exportFunctions.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/bin/bash -# -# cli_exportFunctions.sh -- This function standardizes the way -# specific functionalities are exported to centos-art.sh script -# environment. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function cli_exportFunctions { - - # Retrieve export identifier for the function we want to export. - local EXPORTID="$1" - - # Verify the export identification existence. This argument must - # be passed as first argument and match a relative path format. - if [[ ! $EXPORTID =~ '^[A-Z][[:alpha:]]+(/[[:alpha:]_]+)+$' ]];then - cli_printMessage "`gettext "The export id doesn't match its pattern."`" --as-error-line - fi - - # Define the source location where function files are placed in. - local LOCATION=${CLI_FUNCDIR}/$(dirname ${EXPORTID}) - - # Define suffix used to retrieve function files. - local SUFFIX=$(basename "$EXPORTID") - - # Verify the suffix value used to retrieve function files. - # Assuming no suffix value is passed as second argument to this - # function, use the function name value (CLI_FUNCNAME) as default - # value. - if [[ $SUFFIX == '' ]];then - SUFFIX="${CLI_FUNCNAME}" - fi - - # Redefine suffix to match all related function files inside the - # related function directory. - SUFFIX=${SUFFIX}'[[:alpha:]_]*' - - # Define the pattern used to retrieve function names from function - # files. - local PATTERN="^function[[:space:]]+${SUFFIX}[[:space:]]+{[[:space:]]*$" - - # Define the list of files. - local FUNCFILE='' - local FUNCFILES=$(cli_getFilesList ${LOCATION} --pattern="${LOCATION}/${SUFFIX}\.sh$" \ - --maxdepth='1' --mindepth='1' --type='f') - - # Verify the list of files. If no function file exists for the - # location specified stop the script execution. Otherwise the - # script will surely try to execute a function that haven't been - # exported yet and report an error about it. - if [[ $FUNCFILES == '' ]];then - cli_printMessage "${FUNCNAME}: `gettext "No function file was found."`" --as-error-line - fi - - # Process the list of files. - for FUNCFILE in $FUNCFILES;do - - # Verify the execution rights for function file. - cli_checkFiles -x ${FUNCFILE} - - # Verify that function files have not been already exported. - # If they have been already exported don't export them again. - # Instead, continue with the next function file in the list. - declare -F | gawk '{ print $3 }' | egrep "^${FUNCFILE}$" > /dev/null - if [[ $? -eq 0 ]];then - continue - fi - - # Initialize the function file. - . ${FUNCFILE} - - # Export the function names inside the file to current shell - # script environment. - export -f $(egrep "${PATTERN}" ${FUNCFILE} | gawk '{ print $2 }') - - done - -} diff --git a/Automation/Functions/Commons/cli_getConfigLines.sh b/Automation/Functions/Commons/cli_getConfigLines.sh deleted file mode 100755 index 2d9b636..0000000 --- a/Automation/Functions/Commons/cli_getConfigLines.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash -# -# cli_getConfigLines.sh -- This function standardizes the way -# configuration lines are retrieved form configuration files. As -# arguments, the configuration file absolute path, the configuration -# section name, and the configuration option name must be provided. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function cli_getConfigLines { - - # Initialize absolute path to configuration file. - local CONFIG_ABSPATH="$1" - - # Verify that configuration file does exist. - cli_checkFiles -e ${CONFIG_ABSPATH} - - # Initialize configuration section name where the variable value - # we want to to retrieve is set in. - local CONFIG_SECTION="$2" - - # Be sure the configuration section name has the correct format. - if [[ ! $CONFIG_SECTION =~ '^[[:alnum:]._-]+$' ]];then - cli_printMessage "`gettext "The configuration section provided is incorrect."`" --as-error-line - fi - - # Initialize variable name we want to retrieve value from. - local CONFIG_OPTION="$3" - - # Verify configuration variable name. When no variable name is - # provided print all configuration lines that can be considered as - # well-formed paths. Be sure configuration variable name starts - # just at the beginning of the line. - if [[ ! $CONFIG_OPTION =~ '^[[:alnum:]_./-]+$' ]];then - CONFIG_OPTION='[[:alnum:]_./-]+[[:space:]]*=' - fi - - # Retrieve configuration lines from configuration file. - local CONFIG_LINES=$(cat ${CONFIG_ABSPATH} \ - | egrep -v '^#' \ - | egrep -v '^[[:space:]]*$' \ - | sed -r -n "/^\[${CONFIG_SECTION}\][[:space:]]*$/,/^\[/p" \ - | egrep -v '^\[' | sort | uniq \ - | egrep "^${CONFIG_OPTION}") - - # Output value related to variable name. - echo "$CONFIG_LINES" - -} diff --git a/Automation/Functions/Commons/cli_getConfigSectionNames.sh b/Automation/Functions/Commons/cli_getConfigSectionNames.sh deleted file mode 100755 index a280736..0000000 --- a/Automation/Functions/Commons/cli_getConfigSectionNames.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -# -# cli_getConfigSectionNames.sh -- This function standardizes the way -# section names are retrieved from configuration files. Once section -# names are retrieved they are printed to standard output for further -# processing. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function cli_getConfigSectionNames { - - # Define absolute path to configuration file we want to retrieve - # section names from. - local CONF_FILE=$1 - - # Verify existence of configuration file. - cli_checkFiles $CONF_FILE -f - - # Output all section names without brackets, one per line. - egrep '^\[[[:alnum:]._-]+\][[:space:]]*$' $CONF_FILE \ - | sed -r 's/\[(.+)\]/\1/' - -} diff --git a/Automation/Functions/Commons/cli_getConfigValue.sh b/Automation/Functions/Commons/cli_getConfigValue.sh deleted file mode 100755 index 08065ae..0000000 --- a/Automation/Functions/Commons/cli_getConfigValue.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -# -# cli_getConfigValue.sh -- This function standardizes the way configuration -# files are retrieved from configuration files. As arguments, the -# configuration file absolute path, the configuration section name, and the -# configuration option name must be provided. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function cli_getConfigValue { - - # Initialize absolute path to configuration file. - local CONFIG_ABSPATH="$1" - - # Initialize configuration section name where the variable value - # we want to to retrieve is set in. - local CONFIG_SECTION="$2" - - # Initialize variable name we want to retrieve value from. - local CONFIG_OPTION="$3" - - # Retrieve configuration lines from configuration file. - local CONFIG_LINES=$(cli_getConfigLines \ - "$CONFIG_ABSPATH" "$CONFIG_SECTION" "$CONFIG_OPTION") - - # Parse configuration lines to retrieve the values of variable - # names. - local CONFIG_VALUE=$(echo $CONFIG_LINES \ - | cut -d= -f2- \ - | sed -r -e 's/"//g' -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' ) - - # Output values related to variable name. - echo "$CONFIG_VALUE" - -} diff --git a/Automation/Functions/Commons/cli_getFilesList.sh b/Automation/Functions/Commons/cli_getFilesList.sh deleted file mode 100755 index 8a6e42b..0000000 --- a/Automation/Functions/Commons/cli_getFilesList.sh +++ /dev/null @@ -1,125 +0,0 @@ -#!/bin/bash -# -# cli_getFilesList.sh -- This function standardizes the way list of -# files are built inside centos-art.sh script. This function outputs a -# sorted and unique list of files based on the options and locations -# passed as argument. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function cli_getFilesList { - - # Define short options. - local ARGSS='' - - # Define long options. - local ARGSL='pattern:,mindepth:,maxdepth:,type:,uid:' - - # Initialize pattern used to reduce the find output. - local PATTERN="$FLAG_FILTER" - - # Initialize options used with find command. - local OPTIONS='' - - # Initialize arguments with an empty value and set it as local - # variable to this function scope. Doing this is very important to - # avoid any clash with higher execution environments. - local ARGUMENTS='' - - # Prepare ARGUMENTS for getopt. - cli_parseArgumentsReDef "$@" - - # Redefine ARGUMENTS using getopt(1) command parser. - cli_parseArguments - - # Redefine positional parameters using ARGUMENTS variable. - eval set -- "$ARGUMENTS" - - while true;do - case "$1" in - - --pattern ) - PATTERN="$2" - shift 2 - ;; - - --maxdepth ) - OPTIONS="$OPTIONS -maxdepth $2" - shift 2 - ;; - - --mindepth ) - OPTIONS="$OPTIONS -mindepth $2" - shift 2 - ;; - - --type ) - OPTIONS="$OPTIONS -type $2" - shift 2 - ;; - - --uid ) - OPTIONS="$OPTIONS -uid $2" - shift 2 - ;; - - -- ) - shift 1 - break - ;; - esac - done - - # At this point all options arguments have been processed and - # removed from positional parameters. Only non-option arguments - # remain so we use them as source location for find command to - # look files for. - local LOCATIONS=$@ - - # Verify that locations does exist. - cli_checkFiles -e ${LOCATIONS} - - # Redefine pattern as regular expression. When we use regular - # expressions with find, regular expressions are evaluated against - # the whole file path. This way, when the regular expression is - # specified, we need to build it in a way that matches the whole - # path we are using. Doing so, every time we pass the `--filter' - # option in the command-line could be a tedious task. Instead, in - # the sake of reducing some typing, we prepare the regular - # expression here to match the whole path using the regular - # expression provided by the user as pattern. Do not use LOCATION - # variable as part of regular expression so it could be possible - # to use path expansion. Using path expansion reduce the amount - # of places to find out things and so the time required to finish - # the task. - # - # Don't do such path expansion here. Instead, do it when you call - # this function. Otherwise you would be prohibiting the - # application of exact patterns. - #PATTERN="^/.*${PATTERN}$" - - # Define list of files to process. At this point we cannot verify - # whether the LOCATION is a directory or a file since path - # expansion could be introduced to it. The best we can do is - # verifying exit status and go on. - find ${LOCATIONS} -regextype posix-egrep ${OPTIONS} -regex "${PATTERN}" | sort | uniq - -} diff --git a/Automation/Functions/Commons/cli_getLocalizationDir.sh b/Automation/Functions/Commons/cli_getLocalizationDir.sh deleted file mode 100755 index 42c4456..0000000 --- a/Automation/Functions/Commons/cli_getLocalizationDir.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash -# -# cli_getLocalizationDir.sh -- This function standardizes the way -# localization paths are created. The first argument of this function -# must be a path pointing a directory inside the repository. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function cli_getLocalizationDir { - - # Sanitate non-option arguments to be sure they match the - # directory conventions established by centos-art.sh script - # against source directory locations in the working copy. - LOCATION=$(cli_checkRepoDirSource "${1}") - - # In case the location specified would be a file, remove the file - # part from the path so only its parent directory remains. - if [[ -f ${LOCATION} ]];then - LOCATION=$(dirname ${LOCATION}) - fi - - # Make path transformation. - case "${2}" in - - '--no-lang' ) - LOCATION=$(echo "${LOCATION}" \ - | sed -r -e "s!(Identity|Scripts|Documentation)!Locales/\1!") - ;; - - * ) - LOCATION=$(echo "${LOCATION}" \ - | sed -r -e "s!(Identity|Scripts|Documentation)!Locales/\1!")/${CLI_LANG_LC} - ;; - - esac - - # Output transformed path. - echo "${LOCATION}" - -} diff --git a/Automation/Functions/Commons/cli_getPathComponent.sh b/Automation/Functions/Commons/cli_getPathComponent.sh deleted file mode 100755 index cb262dd..0000000 --- a/Automation/Functions/Commons/cli_getPathComponent.sh +++ /dev/null @@ -1,140 +0,0 @@ -#!/bin/bash -# -# cli_getPathComponent.sh -- This function standardizes the way -# directory structures are organized inside the working copy of CentOS -# Artwork Repository. You can use this function to retrieve -# information from paths (e.g., releases, architectures and theme -# artistic motifs) or the patterns used to build the paths. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function cli_getPathComponent { - - # Define short options. - local ARGSS='' - - # Define long options. - local ARGSL='release,release-major,release-minor,release-pattern,architecture,architecture-pattern,motif,motif-name,motif-release,motif-pattern,repo-dir' - - # Define release pattern. - local RELEASE="(([[:digit:]]+)(\.([[:digit:]]+))?)" - - # Define architecture pattern. Make it match the architectures the - # CentOS distribution is able to be installed on. - local ARCHITECTURE="(i386|x86_64)" - - # Define regular expression pattern that match the theme artistic - # motif component inside the path strings. - local THEME_MOTIF="Identity/Images/Themes/(([[:alnum:]]+)/(${RELEASE}))" - - # Initialize arguments with an empty value and set it as local - # variable to this function scope. Doing this is very important to - # avoid any clash with higher execution environments. - local ARGUMENTS='' - - # Prepare ARGUMENTS variable for getopt. - cli_parseArgumentsReDef "$@" - - # Redefine ARGUMENTS using getopt(1) command parser. - cli_parseArguments - - # Redefine positional parameters using ARGUMENTS variable. - eval set -- "$ARGUMENTS" - - # Define location we want to apply verifications to. - local LOCATION=$(echo $@ | sed -r 's!^.*--[[:space:]](.+)$!\1!') - - # Look for options passed through positional parameters. - while true;do - - case "$1" in - - --release ) - echo "$LOCATION" | egrep "${RELEASE}" | sed -r "s!.*/${RELEASE}/.*!\1!" - shift 1 - break - ;; - - --release-major ) - echo "$LOCATION" | egrep "${RELEASE}" | sed -r "s!.*/${RELEASE}/.*!\2!" - shift 1 - break - ;; - - --release-minor ) - echo "$LOCATION" | egrep "${RELEASE}" | sed -r "s!.*/${RELEASE}/.*!\4!" - shift 1 - break - ;; - - --release-pattern ) - echo "${RELEASE}" - shift 1 - break - ;; - - --architecture ) - echo "$LOCATION" | egrep "${ARCHITECTURE}" | sed -r "s!${ARCHITECTURE}!\1!" - shift 1 - break - ;; - - --architecture-pattern ) - echo "${ARCHITECTURE}" - shift 1 - break - ;; - - --motif ) - echo "$LOCATION" | egrep "${THEME_MOTIF}" | sed -r "s!.*${THEME_MOTIF}.*!\1!" - shift 1 - break - ;; - - --motif-name ) - echo "$LOCATION" | egrep "${THEME_MOTIF}" | sed -r "s!.*${THEME_MOTIF}.*!\2!" - shift 1 - break - ;; - - --motif-release ) - echo "$LOCATION" | egrep "${THEME_MOTIF}" | sed -r "s!.*${THEME_MOTIF}.*!\3!" - shift 1 - break - ;; - - --motif-pattern ) - echo "${THEME_MOTIF}" - shift 1 - break - ;; - - --repo-dir ) - echo "${LOCATION}" | sed "s,${TCAR_WORKDIR}/,," - shift 1 - break - ;; - - esac - - done - -} diff --git a/Automation/Functions/Commons/cli_getRepoName.sh b/Automation/Functions/Commons/cli_getRepoName.sh deleted file mode 100755 index 3680252..0000000 --- a/Automation/Functions/Commons/cli_getRepoName.sh +++ /dev/null @@ -1,133 +0,0 @@ -#!/bin/bash -# -# cli_getRepoName.sh -- This function standardizes files and -# directories name convection inside the working copy of CentOS -# Artowrk Repository. As convection, regular files are written in -# lower-case and directories are written capitalized. Use this -# function to sanitate the name of regular files and directories on -# paths you work with. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function cli_getRepoName { - - # Define the name we want to apply verifications to. - local NAME="$1" - - # Avoid using options as it were names. When name value is empty - # but an option is provided, the option becomes the first - # positional argument and is evaluated as it were a name which is - # something we need to prevent from happening. - if [[ $NAME =~ '^-' ]];then - return - fi - - # Look for options passed through positional parameters. - case "$2" in - - -f|--basename ) - - # Reduce the path passed to use just the non-directory - # part of it (i.e., the last component in the path; _not_ - # the last "real" directory in the path). - NAME=$(basename $NAME) - - # Clean value. - NAME=$(echo $NAME \ - | tr -s ' ' '_' \ - | tr '[:upper:]' '[:lower:]') - ;; - - -d|--dirname ) - - local DIR='' - local DIRS='' - local CLEANDIRS='' - local PREFIXDIR='' - - # In order to sanitate each directory in a path, it is - # required to break off the path string so each component - # can be worked out individually and later combine them - # back to create a clean path string. - - # Reduce path information passed to use the directory part - # of it only. Of course, this is applied if there is a - # directory part in the path. Assuming there is no - # directory part but a non-empty value in the path, use - # that value as directory part and clean it up. - if [[ $NAME =~ '.+/.+' ]];then - - # When path information is reduced, we need to - # consider that absolute paths contain some - # directories outside the working copy directory - # structure that shouldn't be sanitized (e.g., /home, - # /home/centos, /home/centos/artwork, - # /home/centos/artwork/turnk, trunk, etc.) So, we keep - # them unchanged for later use. - PREFIXDIR=$(echo $NAME \ - | sed -r "s,^((${TCAR_WORKDIR}/)?(trunk|branches|tags)/)?.+$,\1,") - - # ... and remove them from the path information we do - # want to sanitate. - DIRS=$(dirname "$NAME" \ - | sed -r "s!^${PREFIXDIR}!!" \ - | tr '/' ' ') - - else - - # At this point, there is not directory part in the - # information passed, so use the value passed as - # directory part as such. - DIRS=$NAME - - fi - - for DIR in $DIRS;do - - # Sanitate directory component. - if [[ $DIR =~ '^[a-z]' ]];then - DIR=$(echo ${DIR} \ - | tr -s ' ' '_' \ - | tr '[:upper:]' '[:lower:]' \ - | sed -r 's/^([[:alpha:]])/\u\1/') - fi - - # Rebuild path using sanitized values. - CLEANDIRS="${CLEANDIRS}/$DIR" - - done - - # Redefine path using sanitized values. - NAME=$(echo ${CLEANDIRS} | sed -r "s!^/!!") - - # Add prefix directory information to sanitate path - # information. - if [[ "$PREFIXDIR" != '' ]];then - NAME=${PREFIXDIR}${NAME} - fi - ;; - - esac - - # Print out the clean path string. - echo $NAME - -} diff --git a/Automation/Functions/Commons/cli_getTemporalFile.sh b/Automation/Functions/Commons/cli_getTemporalFile.sh deleted file mode 100755 index 73849ce..0000000 --- a/Automation/Functions/Commons/cli_getTemporalFile.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# -# cli_getTemporalFile.sh -- This function returns the absolute path -# you need to use to create temporal files. Use this function whenever -# you need to create temporal files inside centos-art.sh script. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function cli_getTemporalFile { - - # Define base name for temporal file. This is required when svg - # instances are created previous to be parsed by inkscape in order - # to be exported as png. In such cases .svg file extension is - # required in order to avoid complains from inkscape. - local NAME="$(cli_getRepoName $1 -f)" - - # Check default base name for temporal file, it can't be an empty - # value. - if [[ "$NAME" == '' ]];then - cli_printMessage "`gettext "The first argument cannot be empty."`" --as-error-line - fi - - # Define absolute path for temporal file. - local TEMPFILE="${TMPDIR}/${NAME}" - - # Output absolute path to final temporal file. - echo $TEMPFILE - -} diff --git a/Automation/Functions/Commons/cli_parseArguments.sh b/Automation/Functions/Commons/cli_parseArguments.sh deleted file mode 100755 index d583ac6..0000000 --- a/Automation/Functions/Commons/cli_parseArguments.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -# -# cli_parseArguments.sh -- This function redefines arguments -# (ARGUMENTS) global variable using getopt(1) output. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function cli_parseArguments { - - # Reset positional parameters using optional arguments. - eval set -- "$ARGUMENTS" - - # Parse optional arguments using getopt. - ARGUMENTS=$(getopt -o "$ARGSS" -l "$ARGSL" -n "$CLI_NAME (${FUNCNAME[1]})" -- "$@") - - # Be sure getout parsed arguments successfully. Otherwise, finish - # script execution with a to know more line. - if [[ $? != 0 ]]; then - cli_printMessage "${CLI_FUNCDIRNAM}" --as-toknowmore-line - exit - fi - -} diff --git a/Automation/Functions/Commons/cli_parseArgumentsReDef.sh b/Automation/Functions/Commons/cli_parseArgumentsReDef.sh deleted file mode 100755 index 6cb7f77..0000000 --- a/Automation/Functions/Commons/cli_parseArgumentsReDef.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash -# -# cli_parseArgumentsReDef.sh -- This function initiates/reset and -# sanitizes positional parameters passed to this function and creates -# the list of arguments that getopt will process. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function cli_parseArgumentsReDef { - - local ARG - - # Clean up arguments global variable. - ARGUMENTS='' - - # Fill up arguments global variable with current positional - # parameter information. To avoid interpretation problems, use - # single quotes to enclose each argument (ARG) from command-line - # individually. - for ARG in "$@"; do - - # Remove any single quote from arguments passed to - # centos-art.sh script. We will use single quotes for grouping - # option values so white space can be passed through them. - ARG=$(echo "$ARG" | tr -d "'") - - # Concatenate arguments and enclose them to let getopt to - # process them when they have spaces inside. - ARGUMENTS="$ARGUMENTS '$ARG'" - - done - - # Verify non-option arguments passed to command-line. If there - # isn't any or dot is provided, redefine the ARGUMENTS variable to - # use the current location the centos-art.sh script was called - # from. - if [[ -z $ARGUMENTS ]];then - ARGUMENTS=${PWD} - fi - -} diff --git a/Automation/Functions/Commons/cli_printCopyrightInfo.sh b/Automation/Functions/Commons/cli_printCopyrightInfo.sh deleted file mode 100755 index 078bc05..0000000 --- a/Automation/Functions/Commons/cli_printCopyrightInfo.sh +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/bash -# -# cli_printCopyrightInfo.sh -- This function standardizes the -# copyright information printed on content produced by centos-art.sh -# script. -# -# As far as I understand, the copyright exists to make people create -# more. The copyright gives creators the legal power over their -# creations and so the freedom to distribute them under the ethical -# terms the creator considers better. At this moment I don't feel -# very confident about this legal affairs and their legal -# implications, but I need to decide what copyright information the -# centos-art.sh script will print out when it be requested about it. -# So, in that sake, I'll assume the same copyright information used by -# The CentOS Wiki (http://wiki.centos.org/) as reference. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function cli_printCopyrightInfo { - - case "$1" in - - --license ) - - # Print the license name. - echo "`gettext "Creative Common Attribution-ShareAlike 3.0 License"`" - ;; - - --license-url ) - - # Print the url related to license name. - cli_printUrl --cc-sharealike - ;; - - --first-year ) - - # The former year when I (as collaborator of The CentOS - # Project) started to consolidate The CentOS Project - # Corporate Visual Identity through the CentOS Artwork - # Repository. - echo '2009' - ;; - - --year|--last-year) - - # The last year when The CentOS Project stopped working in - # its Corporate Visual Identity through the CentOS Artwork - # Repository. That is something that I hope never happens, - # so assume the current year as last working year. - date +%Y - ;; - - --years-range ) - - local FIRST_YEAR=$(cli_printCopyrightInfo --first-year) - local LAST_YEAR=$(cli_printCopyrightInfo --last-year) - echo "${FIRST_YEAR}-${LAST_YEAR}" - ;; - - --years-list ) - - local FIRST_YEAR=$(cli_printCopyrightInfo --first-year) - local LAST_YEAR=$(cli_printCopyrightInfo --last-year) - - # Define full copyright year string based on first and - # last year. - local FULL_YEAR=$(\ - while [[ ${FIRST_YEAR} -le ${LAST_YEAR} ]];do - echo -n "${FIRST_YEAR}, " - FIRST_YEAR=$(($FIRST_YEAR + 1)) - done) - - # Prepare full copyright year string and print it out. - echo "${FULL_YEAR}" | sed 's!, *$!!' - ;; - - --holder ) - - # Print centos-art.sh script default copyright holder. - echo "The CentOS Project" - ;; - - --holder-predicate ) - - local HOLDER=$(cli_printCopyrightInfo --holder) - echo "${HOLDER}. `gettext "All rights reserved."`" - ;; - - * ) - - local YEAR=$(cli_printCopyrightInfo --last-year) - local HOLDER=$(cli_printCopyrightInfo --holder) - echo "Copyright © ${YEAR} ${HOLDER}" - ;; - - esac - -} diff --git a/Automation/Functions/Commons/cli_printMailingList.sh b/Automation/Functions/Commons/cli_printMailingList.sh deleted file mode 100755 index b6053d7..0000000 --- a/Automation/Functions/Commons/cli_printMailingList.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/bash -# -# cli_printMailingList.sh -- This function standardize the way mailing -# list addresses are printed on content produced by centos-art.sh -# script. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function cli_printMailingList { - - local MAILADDRS='' - - # Define short options. - local ARGSS='' - - # Define long options. - local ARGSL='as-html-link:,docs' - - # Initialize arguments with an empty value and set it as local - # variable to this function scope. Doing this is very important to - # avoid any clash with higher execution environments. - local ARGUMENTS='' - - # Prepare ARGUMENTS for getopt. - cli_parseArgumentsReDef "$@" - - # Redefine ARGUMENTS using getopt(1) command parser. - cli_parseArguments - - # Redefine positional parameters using ARGUMENTS variable. - eval set -- "$ARGUMENTS" - - # Look for options passed through command-line. - while true; do - case "$1" in - - --docs ) - MAILADDRS="${TCAR_BRAND}-docs@$(cli_printUrl --domain)" - shift 1 - ;; - - --as-html-link ) - MAILADDRS="${2}" - shift 2 - ;; - - -- ) - - shift 1 - break - ;; - esac - done - - # Print mail address. - echo "$MAILADDRS" - -} diff --git a/Automation/Functions/Commons/cli_printMessage.sh b/Automation/Functions/Commons/cli_printMessage.sh deleted file mode 100755 index e4cdd4d..0000000 --- a/Automation/Functions/Commons/cli_printMessage.sh +++ /dev/null @@ -1,285 +0,0 @@ -#!/bin/bash -# -# cli_printMessage.sh -- This function standardizes the way messages -# are printed by centos-art.sh script. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function cli_printMessage { - - local MESSAGE="$1" - local FORMAT="$2" - - # Verify message variable, it cannot have an empty value. - if [[ $MESSAGE == '' ]];then - cli_printMessage "`gettext "The message cannot be empty."`" --as-error-line - fi - - # Define message horizontal width. This is the max number of - # horizontal characters the message will use to be displayed on - # the screen. - local MESSAGE_WIDTH=66 - - # Remove empty spaces from message. - MESSAGE=$(echo $MESSAGE | sed -r -e 's!^[[:space:]]+!!') - - # Print messages that will always be printed no matter what value - # the FLAG_QUIET variable has. - case "$FORMAT" in - - --as-stdout-line ) - - # Default printing format. This is the format used when no - # other specification is passed to this function. As - # convenience, we transform absolute paths into relative - # paths in order to free horizontal space on final output - # messages. - echo "$MESSAGE" | sed -r \ - -e "s!${TCAR_WORKDIR}/!!g" \ - -e "s!> /!> !g" \ - -e "s!/{2,}!/!g" \ - | awk 'BEGIN { FS=": " } - { - if ( $0 ~ /^-+$/ ) - print $0 - else - printf "%-15s\t%s\n", $1, $2 - } - END {}' - ;; - - --as-error-line ) - - # Define where the error was originated inside the - # centos-art.sh script. Print out the function name and - # line from the caller. - local ORIGIN="$(caller 1 | gawk '{ print $2 " L." $1 }')" - - # Build the error message. - cli_printMessage "${CLI_NAME} (${ORIGIN}):" --as-stdout-line - cli_printMessage "${MESSAGE}" --as-response-line - cli_printMessage "${CLI_FUNCNAME}" --as-toknowmore-line - - # Finish script execution with exit status 1 (SIGHUP) to - # imply the script finished because an error. We are - # using this as convention to finish the script execution. - # So, don't remove the following line, please. - exit 1 - ;; - - --as-suggestion-line ) - - # Define where the error was originated inside the - # centos-art.sh script. Print out the function name and - # line from the caller. - local ORIGIN="$(caller 1 | gawk '{ print $2 " L." $1 }')" - - # Build the error message. - cli_printMessage "${CLI_NAME} (${ORIGIN}):" --as-stdout-line - cli_printMessage "`gettext "The path provided cannot be processed the way you entered it."`" --as-stdout-line - cli_printMessage "`gettext "Instead, try the following equivalence:"`" --as-stdout-line - cli_printMessage "${MESSAGE}" --as-response-line - cli_printMessage "${CLI_FUNCNAME}" --as-toknowmore-line - - # Finish script execution with exit status 1 (SIGHUP) to - # imply the script finished because an error. We are - # using this as convention to finish the script execution. - # So, don't remove the following line, please. - exit 1 - ;; - - --as-toknowmore-line ) - cli_printMessage '-' --as-separator-line - cli_printMessage "`gettext "To know more, run"` ${CLI_NAME} ${MESSAGE} --help" --as-stdout-line - cli_printMessage '-' --as-separator-line - ;; - - --as-yesornorequest-line ) - - # Define positive answer. - local Y="`gettext "yes"`" - - # Define negative answer. - local N="`gettext "no"`" - - # Define default answer. - local ANSWER=${N} - - if [[ $FLAG_ANSWER == 'true' ]];then - - ANSWER=${Y} - - else - - # Print the question to standard error. - cli_printMessage "$MESSAGE [${Y}/${N}]" --as-request-line - - # Redefine default answer based on user's input. - read ANSWER - - fi - - # Verify user's answer. Only positive answer let the - # script flow to continue. Otherwise, if something - # different from positive answer is passed, the script - # terminates its execution immediately. - if [[ ! ${ANSWER} =~ "^${Y}" ]];then - exit - fi - ;; - - --as-selection-line ) - # Create selection based on message. - local NAME='' - select NAME in ${MESSAGE};do - echo $NAME - break - done - ;; - - --as-response-line ) - cli_printMessage "--> $MESSAGE" --as-stdout-line - ;; - - --as-request-line ) - cli_printMessage "${MESSAGE}:\040" --as-notrailingnew-line - ;; - - --as-notrailingnew-line ) - echo -e -n "${MESSAGE}" | sed -r \ - -e "s!${TCAR_WORKDIR}/!!g" - ;; - - --as-stderr-line ) - echo "$MESSAGE" | sed -r \ - -e "s!${TCAR_WORKDIR}/!!g" 1>&2 - ;; - - esac - - # Verify verbose option. The verbose option controls whether - # messages are printed or not. - if [[ "$FLAG_QUIET" == 'true' ]];then - return - fi - - # Print messages that will be printed only when the FLAG_QUIET - # variable is provided to centos-art.sh script. - case "$FORMAT" in - - --as-separator-line ) - - # Build the separator line. - MESSAGE=$(\ - until [[ $MESSAGE_WIDTH -eq 0 ]];do - echo -n "$(echo $MESSAGE | sed -r 's!(.).*!\1!')" - MESSAGE_WIDTH=$(($MESSAGE_WIDTH - 1)) - done) - - # Draw the separator line. - echo "$MESSAGE" - ;; - - --as-banner-line ) - cli_printMessage '-' --as-separator-line - cli_printMessage "$MESSAGE" --as-stdout-line - cli_printMessage '-' --as-separator-line - ;; - - --as-processing-line ) - cli_printMessage "`gettext "Processing"`: $MESSAGE" --as-stdout-line - ;; - - --as-cropping-line ) - cli_printMessage "`gettext "Cropping from"`: $MESSAGE" --as-stdout-line - ;; - - --as-tuningup-line ) - cli_printMessage "`gettext "Tuning-up"`: $MESSAGE" --as-stdout-line - ;; - - --as-checking-line ) - cli_printMessage "`gettext "Checking"`: $MESSAGE" --as-stdout-line - ;; - - --as-combining-line ) - cli_printMessage "`gettext "Combining"`: $MESSAGE" --as-stdout-line - ;; - - --as-creating-line | --as-updating-line ) - if [[ -a "$MESSAGE" ]];then - cli_printMessage "`gettext "Updating"`: $MESSAGE" --as-stdout-line - else - cli_printMessage "`gettext "Creating"`: $MESSAGE" --as-stdout-line - fi - ;; - - --as-deleting-line ) - cli_printMessage "`gettext "Deleting"`: $MESSAGE" --as-stdout-line - ;; - - --as-reading-line ) - cli_printMessage "`gettext "Reading"`: $MESSAGE" --as-stdout-line - ;; - - --as-savedas-line ) - cli_printMessage "`gettext "Saved as"`: $MESSAGE" --as-stdout-line - ;; - - --as-linkto-line ) - cli_printMessage "`gettext "Linked to"`: $MESSAGE" --as-stdout-line - ;; - - --as-movedto-line ) - cli_printMessage "`gettext "Moved to"`: $MESSAGE" --as-stdout-line - ;; - - --as-translation-line ) - cli_printMessage "`gettext "Translation"`: $MESSAGE" --as-stdout-line - ;; - - --as-translating-line ) - cli_printMessage "`gettext "Translating"`: $MESSAGE" --as-stdout-line - ;; - - --as-validating-line ) - cli_printMessage "`gettext "Validating"`: $MESSAGE" --as-stdout-line - ;; - - --as-template-line ) - cli_printMessage "`gettext "Template"`: $MESSAGE" --as-stdout-line - ;; - - --as-configuration-line ) - cli_printMessage "`gettext "Configuration"`: $MESSAGE" --as-stdout-line - ;; - - --as-palette-line ) - cli_printMessage "`gettext "Palette"`: $MESSAGE" --as-stdout-line - ;; - - --as-inkscape-line ) - cli_printMessage "$MESSAGE" --as-stdout-line - ;; - - esac - -} diff --git a/Automation/Functions/Commons/cli_printUrl.sh b/Automation/Functions/Commons/cli_printUrl.sh deleted file mode 100755 index 2a6ce80..0000000 --- a/Automation/Functions/Commons/cli_printUrl.sh +++ /dev/null @@ -1,149 +0,0 @@ -#!/bin/bash -# -# cli_printUrl.sh -- This function standardizes the way URLs are -# printed by centos-art.sh script. This function describes the -# domain organization of The CentOS Project through its URLs and -# provides a way to print them out when needed. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function cli_printUrl { - - local URL='' - - # Define short options. - local ARGSS='' - - # Define long options. - local ARGSL='domain,home,lists,wiki,forums,bugs,planet,docs,mirrors,projects,svn,trac,irc,cc-sharealike,with-locale,as-html-link' - - # Initialize arguments with an empty value and set it as local - # variable to this function scope. Doing this is very important to - # avoid any clash with higher execution environments. - local ARGUMENTS='' - - # Prepare ARGUMENTS for getopt. - cli_parseArgumentsReDef "$@" - - # Redefine ARGUMENTS using getopt(1) command parser. - cli_parseArguments - - # Redefine positional parameters using ARGUMENTS variable. - eval set -- "$ARGUMENTS" - - # Look for options passed through command-line. - while true; do - case "$1" in - - --domain ) - URL="${TCAR_BRAND}.org" - shift 1 - ;; - - --home ) - URL="http://www.$(cli_printUrl --domain)/" - shift 1 - ;; - - --lists ) - URL="http://lists.$(cli_printUrl --domain)/" - shift 1 - ;; - - --wiki ) - URL="http://wiki.$(cli_printUrl --domain)/" - shift 1 - ;; - - --forums ) - URL="http://forums.$(cli_printUrl --domain)/" - shift 1 - ;; - - --bugs ) - URL="http://bugs.$(cli_printUrl --domain)/" - shift 1 - ;; - - --projects ) - URL="https://projects.$(cli_printUrl --domain)/" - shift 1 - ;; - - --svn ) - URL="$(cli_printUrl --projects)svn/" - shift 1 - ;; - - --trac ) - URL="$(cli_printUrl --projects)trac/" - shift 1 - ;; - - --planet ) - URL="http://planet.$(cli_printUrl --domain)/" - shift 1 - ;; - - --docs ) - URL="http://docs.$(cli_printUrl --domain)/" - shift 1 - ;; - - --mirrors ) - URL="http://mirrors.$(cli_printUrl --domain)/" - shift 1 - ;; - - --irc ) - URL="http://$(cli_printUrl --home)modules/tinycontent/index.php?id=8" - shift 1 - ;; - - --cc-sharealike ) - URL="http://creativecommons.org/licenses/by-sa/3.0/" - shift 1 - ;; - - --with-locale ) - if [[ ! ${LANG} =~ '^en' ]];then - URL="${URL}${CLI_LANG_LL}/" - fi - shift 1 - ;; - - --as-html-link ) - URL="${URL}" - shift 1 - ;; - - -- ) - - shift 1 - break - ;; - esac - done - - # Print Url. - echo "$URL" - -} diff --git a/Automation/Functions/Commons/cli_runFnEnvironment.sh b/Automation/Functions/Commons/cli_runFnEnvironment.sh deleted file mode 100755 index 5b9641d..0000000 --- a/Automation/Functions/Commons/cli_runFnEnvironment.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -# -# cli_runFnEnvironment.sh -- This function standardizes the way -# centos-art.sh script is called to itself. The main purpose of this -# somehow own interface is to control the parent script flow based on -# specific function environments exit status. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function cli_runFnEnvironment { - - # Execute specific function environment. - ${CLI_NAME} $@ - - # Retrieve exit status. - local STATUS=$? - - # Finish script execution based on exit status. - if [[ ${STATUS} -ne 0 ]];then - exit ${STATUS} - fi - -} diff --git a/Automation/Functions/Commons/cli_synchronizeRepoChanges.sh b/Automation/Functions/Commons/cli_synchronizeRepoChanges.sh deleted file mode 100755 index 5bfb877..0000000 --- a/Automation/Functions/Commons/cli_synchronizeRepoChanges.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -# -# cli_synchronizeRepoChanges.sh -- This function standardizes the way -# changes are synchronized between the working copy and the central -# repository. This function is an interface to the Svn functionality -# of the centos-art.sh script. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function cli_synchronizeRepoChanges { - - # Verify synchronization flag. - if [[ ! $FLAG_SYNCHRONIZE == 'true' ]];then - return - fi - - # Verify existence of locations passed to this function. - cli_checkFiles -e $@ - - # Synchronize changes. - cli_runFnEnvironment vcs --synchronize $@ - -} diff --git a/Automation/Functions/Commons/cli_terminateScriptExecution.sh b/Automation/Functions/Commons/cli_terminateScriptExecution.sh deleted file mode 100755 index cf855ed..0000000 --- a/Automation/Functions/Commons/cli_terminateScriptExecution.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -# -# cli_terminateScriptExecution.sh -- This function standardizes the -# actions that must be realized just before leaving the script -# execution (e.g., cleaning temporal files). This function is the one -# called when interruption signals like EXIT, SIGHUP, SIGINT and -# SIGTERM are detected. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function cli_terminateScriptExecution { - - # Remove temporal directory. - rm -r ${TMPDIR} - - # NOTE: Don't specify an exit status here. As convenction we do - # this when error messages are triggerd. See `--as-error-line' - # option from `cli_printMessage' functionality. - -} diff --git a/Automation/Functions/Commons/cli_unsetFunctions.sh b/Automation/Functions/Commons/cli_unsetFunctions.sh deleted file mode 100755 index 8a31dff..0000000 --- a/Automation/Functions/Commons/cli_unsetFunctions.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash -# -# cli_unsetFunctions.sh -- This function unsets functionalities from -# `centos-art.sh' script execution environment. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function cli_unsetFunctions { - - # Define export id used to retrive function files. This is the - # same export id used to export functions without the directory - # part. - local EXPORTID=$(basename "$1") - - # Verify suffix value used to retrive function files. Assuming no - # suffix value is passed as second argument to this function, use - # the function name value (CLI_FUNCNAME) as default value. - if [[ $EXPORTID == '' ]];then - cli_printMessage "`gettext "The export id was not provided."`" --as-error-line - fi - - # Define list of format-specific functionalities. This is the - # list of function definitions previously exported by - # `cli_exportFunctions'. Be sure to limit the list to function - # names that start with the suffix specified only. - local FUNCDEF='' - local FUNCDEFS=$(declare -F | gawk '{ print $3 }' | egrep "^${EXPORTID}") - - # Unset function names from current execution environment. - for FUNCDEF in $FUNCDEFS;do - unset -f $FUNCDEF - done - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo.sh b/Automation/Functions/Help/Texinfo/texinfo.sh deleted file mode 100755 index 8e5951f..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo.sh +++ /dev/null @@ -1,136 +0,0 @@ -#!/bin/bash -# -# texinfo.sh -- This function initializes Texinfo documentation format -# used by `centos-art.sh' script to produce and maintain documentation -# manuals written in Texinfo format, inside the working copy of The -# CentOS Artwork Repository. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo { - - # Verify documentation entry to be sure it coincides with - # Texinfo's supported structuring (e.g., texinfo-4.8 doesn't - # support structuring through parts, but chapters and sections - # only). - if [[ $MANUAL_PART_NAME != '' ]];then - cli_printMessage "`gettext "The documentation entry provided isn't supported."`" --as-error-line - fi - - # Verify documentation format based on file type. - if [[ -f ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} ]];then - cli_checkFiles -i "text/x-texinfo" ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} - fi - - # Define absolute path to template directory. This is the place - # where we store locale directories (e.g., en_US, es_ES, etc.) - # used to build manuals in texinfo format. - MANUAL_TEMPLATE=${MANUAL_TLDIR}/$(cli_getRepoName ${FLAG_FORMAT} -d)/Default - - # Define absolute path to language-specific template directory. - # This is the place where we store locale-specific files used to - # build manuals in texinfo format. - MANUAL_TEMPLATE_L10N=${MANUAL_TEMPLATE}/${MANUAL_L10N} - - # Verify absolute path to language-specific template directory. - # If it doesn't exist, use English language as default location to - # retrieve template files. - if [[ ! -d $MANUAL_TEMPLATE_L10N ]];then - MANUAL_TEMPLATE_L10N=${MANUAL_TEMPLATE}/en_US - fi - - # Initialize document structure for new manuals. - texinfo_createStructure - - # Define documentation entry default values. To build the - # documentation entry, we combine the manual's name, part, chapter - # and section information retrieved from the command-line. - if [[ $MANUAL_CHAPTER_NAME == '' ]];then - - # When chapter option is not provided, discard the section - # name and define documentation entry based on manual's main - # definition file. - MANUAL_ENTRY="${MANUAL_BASEFILE}.${MANUAL_EXTENSION}" - - elif [[ $MANUAL_CHAPTER_NAME != '' ]] && [[ $MANUAL_SECTION_NAME == '' ]];then - - # When chapter option is provided without a section name, - # verify chapter's directory inside the manual, - texinfo_createChapter - - # and define documentation entry based on chapter's main - # definition file. - MANUAL_ENTRY="${MANUAL_BASEDIR_L10N}/${MANUAL_CHAPTER_NAME}.${MANUAL_EXTENSION}" - - elif [[ $MANUAL_CHAPTER_NAME != '' ]] && [[ $MANUAL_SECTION_NAME != '' ]];then - - # When both the chapter option and non-option arguments are - # provided, define documentation entries based on manual, - # chapter and non-option arguments. - MANUAL_ENTRY="$(texinfo_getEntry "$MANUAL_SECTION_NAME")" - - else - cli_printMessage "`gettext "The parameters you provided are not supported."`" --as-error-line - fi - - # Execute action names. Notice that we've separated execution of - # action names in order to control and save differences among - # them. - if [[ $ACTIONNAM == "" ]];then - - # When no action name is provided to `centos-art.sh' script, - # read manual's info output in order to provide a way for - # people to get oriented about The CentOS Artwork Repository - # and its automation too. Be sure the manual and its info - # output file do exist. Later, once the reading is done, - # terminate the script execution. - - # Update manual's output files. - texinfo_updateOutputFiles - - # Read manual's Top node from its info output file. - info --node="Top" --file="${MANUAL_OUTPUT_BASEFILE}.info.bz2" - - elif [[ $ACTIONNAM =~ "^(copy|rename|delete)Entry$" ]];then - - # Both `--copy' and `--rename' actions interpret non-option - # arguments passed to `centos-art.sh' script in a special way. - # In this configuration, only two non-option arguments are - # processed in the first loop of their interpretation. - texinfo_${ACTIONNAM} - - # Rebuild output files to propagate recent changes, if any. - texinfo_updateOutputFiles - - # Break interpretation of non-option arguments to prevent the - # second and further non-option arguments from being - # considered as source location. - break - - else - - # Execute action names as part of normal help command's - # execution flow, without any extra modification. - texinfo_${ACTIONNAM} - - fi - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_checkEntrySrcDst.sh b/Automation/Functions/Help/Texinfo/texinfo_checkEntrySrcDst.sh deleted file mode 100755 index 3bb829d..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_checkEntrySrcDst.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash -# -# texinfo_checkEntrySrcDst.sh -- This function standardizes -# verification actions of source and target locations for tasks like -# copying and renaming. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_checkEntrySrcDst { - - # Initialize entry source absolute path. - local MANUAL_ENTRY_SRC="$1" - - # Initialize entry target absolute path. - local MANUAL_ENTRY_DST="$2" - - # Verify existence of source location. - if [[ ! -a ${MANUAL_ENTRY_SRC} ]];then - cli_printMessage "`gettext "The source location doesn't exist."`" --as-error-line - fi - - # Verify source and target locations to be sure they are different - # one another. We cannot copy a source location to itself. - if [[ $MANUAL_ENTRY_SRC == $MANUAL_ENTRY_DST ]];then - cli_printMessage "`gettext "The source and target locations cannot be the same."`" --as-error-line - fi - - # Verify source location to be sure it is under version control - # and there isn't pending change to be committed first. - cli_checkFiles ${MANUAL_ENTRY_SRC} --is-versioned - if [[ $(cli_runFnEnvironment vcs --status ${MANUAL_ENTRY_SRC}) != '' ]];then - cli_printMessage "`gettext "The source location has pending changes."`" --as-error-line - fi - - # Verify target directory where the source will be duplicated in. - # The target directory must exist before copying the source - # location into it. If it doesn't exist, use subversion to create - # it it. - if [[ ! -d $(dirname ${MANUAL_ENTRY_DST}) ]];then - cli_runFnEnvironment vcs --mkdir $(dirname ${MANUAL_ENTRY_DST}) - fi - - # Verify existence of target location. - if [[ -a ${MANUAL_ENTRY_DST} ]];then - cli_printMessage "`gettext "The target location already exists."`" --as-error-line - fi - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_copyEntry.sh b/Automation/Functions/Help/Texinfo/texinfo_copyEntry.sh deleted file mode 100755 index 8bedf1e..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_copyEntry.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash -# -# texinfo_copyEntry.sh -- This function standardizes the duplication -# actions related to manuals written in texinfo format. This function -# duplicates manuals, chapters inside manuals, and sections inside -# chapters. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_copyEntry { - - # Initialize source and target locations. - local MANUAL_ENTRY_SRC='' - local MANUAL_ENTRY_DST='' - - # Execute copying action based on documentation entries passed as - # non-option arguments to `centos-art.sh' script in the - # command-line. - if [[ ${MANUAL_SECT[${MANUAL_DOCENTRY_ID}]} != '' ]];then - - # In this configuration, the section name is specified in - # first non-option argument and optionally in the second - # non-option argument. - texinfo_copyEntrySection - - elif [[ ${MANUAL_CHAP[${MANUAL_DOCENTRY_ID}]} != '' ]] \ - && [[ ${MANUAL_CHAP[((${MANUAL_DOCENTRY_ID} + 1))]} != '' ]];then - - # In this configuration, the section name wasn't specified - # neither in first or second non-option argument. So, we - # perform a copying action for the chapter directory itself. - # In this configuration, the whole chapter directory and all - # the content inside are duplicated from source to target. - texinfo_copyEntryChapter - - elif [[ ${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]} != '' ]] \ - && [[ ${MANUAL_DIRN[((${MANUAL_DOCENTRY_ID} + 1))]} != '' ]];then - - # In this configuration, the chapter name wasn't specified - # neither in first or second non-option argument. So, we - # perform copying actions on manual directory itself. Notice - # that, in this configuration, the whole manual is duplicated. - texinfo_copyEntryManual - - # In this configuration, there is no need to update section - # menus, nodes and cross references. The section definition - # files were copied from the source manual with any change so - # the manual should build without any problem. Be sure such - # verification will never happen. - - else - cli_printMessage "`gettext "The parameters you provided are not supported."`" --as-error-line - fi - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_copyEntryChapter.sh b/Automation/Functions/Help/Texinfo/texinfo_copyEntryChapter.sh deleted file mode 100755 index 191be20..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_copyEntryChapter.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash -# -# texinfo_copyEntryChapter.sh -- This function standardizes chapter -# duplication inside manuals written in texinfo format. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_copyEntryChapter { - - # Redefine documentation entry source's location. - MANUAL_ENTRY_SRC=${MANUAL_BASEDIR_L10N}/${MANUAL_CHAP[${MANUAL_DOCENTRY_ID}]} - - # Redefine documentation entry target's location. - MANUAL_ENTRY_DST=${MANUAL_BASEDIR_L10N}/${MANUAL_CHAP[((${MANUAL_DOCENTRY_ID} + 1))]} - - # Verify entry source and target locations. - texinfo_checkEntrySrcDst "${MANUAL_ENTRY_SRC}" "${MANUAL_ENTRY_DST}" - - # When we are copying chapters, document structure actualization - # needs to be performed against the target chapter not the source - # one used to create the duplication. To achieve this goal, - # define both chapter's directory and chapter's name at this - # point. - local MANUAL_CHAPTER_DIR=$MANUAL_ENTRY_DST - local MANUAL_CHAPTER_NAME=${MANUAL_CHAP[((${MANUAL_DOCENTRY_ID} + 1))]} - - # When we are copying chapters, the chapter itself cannot be - # copied as we regularly do with sections. Instead, the target - # chapter must be created as a new chapter and then sections from - # source chapter must be copied one by one to the recently created - # chapter. At this point then, is when menu, nodes and cross - # references for the new chapter are updated. - texinfo_createChapter - - # Create list of sections from source chapter that need to be - # copied to target chapter. Don't include chapter's main - # definition files. - local MANUAL_ENTRIES=$(cli_getFilesList $MANUAL_ENTRY_SRC \ - --pattern="^.+\.${MANUAL_EXTENSION}$" | egrep -v '/chapter') - - for MANUAL_ENTRY in $MANUAL_ENTRIES;do - - # Copy sections from source chapter to target chapter. - cli_runFnEnvironment vcs --copy $MANUAL_ENTRY $MANUAL_ENTRY_DST - - # Update section menu, nodes and cross reference definitions - # to all sections inside the documentation manual. - texinfo_updateStructureSection "${MANUAL_ENTRY_DST}/$(basename ${MANUAL_ENTRY})" - - done - - # Update chapter menu and node definitions inside the manual - # structure. - texinfo_updateChapterMenu - texinfo_updateChapterNodes - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_copyEntryManual.sh b/Automation/Functions/Help/Texinfo/texinfo_copyEntryManual.sh deleted file mode 100755 index 423b4b9..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_copyEntryManual.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash -# -# texinfo_copyEntryChapter.sh -- This function standardizes -# duplication of manuals written in texinfo format. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_copyEntryManual { - - # Define list of chapters inside source manual excluding those - # created from template, rendition output and subversion. - local MANUAL_CHAPTER='' - local MANUAL_CHAPTERS=$(cli_getFilesList ${MANUAL_BASEDIR_L10N} \ - --maxdepth=1 --mindepth=1 --type="d" --pattern='^.+$' \ - | egrep -v "(Licenses|\.svn)") - - # Redefine manual name using manual name passed to `centos-art.sh' - # script as second non-option argument. - local MANUAL_NAME=${MANUAL_SLFN[((${MANUAL_DOCENTRY_ID} + 1))]} - - # Redefine absolute path to manual directory using manual name - # passed to `centos-art.sh' script as second non-option argument. - local MANUAL_BASEDIR="$(echo $MANUAL_BASEDIR \ - | sed -r "s!${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]}!${MANUAL_DIRN[((${MANUAL_DOCENTRY_ID} + 1))]}!")" - - # Redefine absolute path to manual directory using manual name - # passed to `centos-art.sh' script as second non-option argument. - local MANUAL_BASEDIR_L10N="${MANUAL_BASEDIR}/${MANUAL_L10N}" - - # Redefine absolute path to base file using manual name passed to - # `centos-art.sh' script as second non-option argument. - local MANUAL_BASEFILE="${MANUAL_BASEDIR_L10N}/${MANUAL_NAME}" - - # Create manual structure - texinfo_createStructure - - # Loop through list of chapters. - for MANUAL_CHAPTER in ${MANUAL_CHAPTERS};do - - # Print action name. - cli_printMessage "${MANUAL_BASEDIR_L10N}" --as-creating-line - - # Copy chapter directory from source to target using - # subversion. - cli_runFnEnvironment vcs --copy ${MANUAL_CHAPTER} ${MANUAL_BASEDIR_L10N} - - # Define manual chapter name. - local MANUAL_CHAPTER_NAME=$(basename ${MANUAL_CHAPTER}) - - # Update chapter information inside the manual's texinfo - # structure. - texinfo_updateChapterMenu - texinfo_updateChapterNodes - - done - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_copyEntrySection.sh b/Automation/Functions/Help/Texinfo/texinfo_copyEntrySection.sh deleted file mode 100755 index 1698dcc..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_copyEntrySection.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/bash -# -# texinfo_copyEntrySection.sh -- This function standardizes section -# duplication inside manuals written in texinfo format. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_copyEntrySection { - - # Define absolute path to section source and target locations - # based on non-option arguments passed to `centos-art.sh' script. - if [[ ${MANUAL_SECT[((${MANUAL_DOCENTRY_ID} + 1))]} != '' ]];then - - # When the section name is specified in first and second - # non-option arguments, source and target are set as specified - # in first and second non-option arguments respectively. - MANUAL_ENTRY_SRC=$(texinfo_getEntry ${MANUAL_SECT[${MANUAL_DOCENTRY_ID}]}) - MANUAL_ENTRY_DST=$(texinfo_getEntry ${MANUAL_SECT[((${MANUAL_DOCENTRY_ID} + 1))]}) - - elif [[ ${MANUAL_SECT[((${MANUAL_DOCENTRY_ID} + 1))]} == '' ]] \ - && [[ ${MANUAL_CHAP[((${MANUAL_DOCENTRY_ID} + 1))]} != '' ]];then - - # When the section name is specified only in the first - # non-option argument and the chapter name has been provided - # in the second non-option argument, use the section name - # passed in first argument to build the section name that will - # be used as target. - MANUAL_ENTRY_SRC=$(texinfo_getEntry ${MANUAL_SECT[${MANUAL_DOCENTRY_ID}]}) - MANUAL_ENTRY_DST=$(echo $MANUAL_ENTRY_SRC \ - | sed -r "s!${MANUAL_CHAP[${MANUAL_DOCENTRY_ID}]}!${MANUAL_CHAP[((${MANUAL_DOCENTRY_ID} + 1))]}!") - - else - cli_printMessage "`gettext "The location provided as target isn't valid."`" --as-error-line - fi - - # Print separator line along with action message. - cli_printMessage '-' --as-separator-line - cli_printMessage "${MANUAL_ENTRY_DST}" --as-creating-line - - # Verify entry source and target locations. - texinfo_checkEntrySrcDst "${MANUAL_ENTRY_SRC}" "${MANUAL_ENTRY_DST}" - - # Copy section entry from source to target using subversion. - cli_runFnEnvironment vcs --quiet --copy "${MANUAL_ENTRY_SRC}" "${MANUAL_ENTRY_DST}" - - # Redefine chapter name using chapter name passed to - # `centos-art.sh' script as second non-option argument. - local MANUAL_CHAPTER_NAME=${MANUAL_CHAP[((${MANUAL_DOCENTRY_ID} + 1))]} - - # Redefine chapter directory to use the chapter provided to - # `centos-art.sh' script as second non-option argument. This is - # required in order to update the `chapter-menu.texinfo' file - # inside the target chapter where section entry was copied to, not - # the source chapter where the section entry was taken from. This - # is particularly useful section entries are copied from one - # chapter into another different. - local MANUAL_CHAPTER_DIR=$(dirname ${MANUAL_ENTRY_DST}) - - # At this point, all copying actions and chapter related - # redefinitions have took place. It is time, then, to update the - # document structure using the information collected so far. - texinfo_updateStructureSection "${MANUAL_ENTRY_DST}" - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_createChapter.sh b/Automation/Functions/Help/Texinfo/texinfo_createChapter.sh deleted file mode 100755 index 66cb08e..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_createChapter.sh +++ /dev/null @@ -1,120 +0,0 @@ -#!/bin/bash -# -# texinfo_createChapter.sh -- This function standardizes chapter -# creation insdie the manual structure. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_createChapter { - - # Verify chapter directory inside the manual structure. The - # chapter directory is where chapter-specific information (e.g., - # chapter definition files and sections) are stored in. If this - # directory already exist, assume it was created correctly in the - # past. Otherwise, request confirmation for creating it. - if [[ -d $MANUAL_CHAPTER_DIR ]];then - return - else - cli_printMessage "`gettext "The following documentation chapter doesn't exist:"`" --as-stdout-line - cli_printMessage "${MANUAL_CHAPTER_DIR}.${MANUAL_EXTENSION}" --as-response-line - cli_printMessage "`gettext "Do you want to create it now?"`" --as-yesornorequest-line - fi - - # Initialize chapter node, chapter index and chapter title. - local MANUAL_CHAPTER_NODE='' - local MANUAL_CHAPTER_TITLE='' - local MANUAL_CHAPTER_CIND='' - - # Request the user to enter a chapter title. - cli_printMessage "`gettext "Enter chapter's title"`" --as-request-line - read MANUAL_CHAPTER_TITLE - - # Sanitate chapter node, chapter index and chapter title. - MANUAL_CHAPTER_NODE=$(texinfo_getEntryNode "$MANUAL_CHAPTER_NAME") - MANUAL_CHAPTER_CIND=$(texinfo_getEntryIndex "$MANUAL_CHAPTER_TITLE") - MANUAL_CHAPTER_TITLE=$(texinfo_getEntryTitle "$MANUAL_CHAPTER_TITLE") - - # Define list of template files used to build the chapter main - # definition files. - local FILE='' - local FILES=$(cli_getFilesList "${MANUAL_TEMPLATE_L10N}" \ - --maxdepth='1' \ - --pattern="^.+/Chapters(-menu|-nodes)?\.${MANUAL_EXTENSION}$") - - # Create chapter directory using version control. This is the - # place where all chapter-specific files will be stored in. - if [[ ! -d ${MANUAL_CHAPTER_DIR} ]];then - cli_printMessage "${MANUAL_CHAPTER_DIR}" --as-creating-line - cli_runFnEnvironment vcs --quiet --mkdir ${MANUAL_CHAPTER_DIR} - fi - - # Create chapter-specific files using template files as reference. - for FILE in $FILES;do - - # Verify texinfo templates used as based to build the chapter - # structure. Be sure they are inside the working copy of The - # CentOS Artwork Repository (-w) and under version control - # (-n), too. - cli_checkFiles ${FILE} - - # Redefine the chapter file using the correct name. - local MANUAL_CHAPTER_FILE=${MANUAL_CHAPTER_DIR}$(basename ${FILE} \ - | sed -r 's,Chapters,,') - - # Print action name. - cli_printMessage "${MANUAL_CHAPTER_FILE}" --as-creating-line - - # Copy template files into the chapter directory. - cli_runFnEnvironment vcs --quiet --copy ${FILE} ${MANUAL_CHAPTER_FILE} - - done - - # Before expanding chapter information, be sure the slash (/) - # character be escaped. Otherwise, if the slashes aren't scape, - # they will be interpreted as sed's separator and might provoke - # sed to complain. - MANUAL_CHAPTER_NODE=$(echo "$MANUAL_CHAPTER_NODE" | sed -r 's/\//\\\//g') - MANUAL_CHAPTER_CIND=$(echo "$MANUAL_CHAPTER_CIND" | sed -r 's/\//\\\//g') - MANUAL_CHAPTER_TITLE=$(echo "$MANUAL_CHAPTER_TITLE" | sed -r 's/\//\\\//g') - MANUAL_CHAPTER_NAME=$(echo "$MANUAL_CHAPTER_NAME" | sed -r 's/\//\\\//g') - - # Expand translation markers inside chapter main definition file. - sed -i -r \ - -e "s/=CHAPTER_NODE=/${MANUAL_CHAPTER_NODE}/" \ - -e "s/=CHAPTER_TITLE=/${MANUAL_CHAPTER_TITLE}/" \ - -e "s/=CHAPTER_CIND=/${MANUAL_CHAPTER_CIND}/" \ - -e "s/=CHAPTER_NAME=/${MANUAL_CHAPTER_NAME}/" \ - ${MANUAL_CHAPTER_DIR}.${MANUAL_EXTENSION} - - # Remove content from `chapter-nodes.texinfo' file to start with a - # clean node structure. This file is also used to create new - # documentation entries, but we don't need that information right - # now (when the chapter structure is created), just an empty copy - # of the file. The node structure of chapter is created - # automatically based on action value. - echo "" > ${MANUAL_CHAPTER_DIR}-nodes.${MANUAL_EXTENSION} - - # Update chapter information inside the manual's texinfo - # structure. - texinfo_updateChapterMenu - texinfo_updateChapterNodes - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_createStructure.sh b/Automation/Functions/Help/Texinfo/texinfo_createStructure.sh deleted file mode 100755 index 6338aa3..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_createStructure.sh +++ /dev/null @@ -1,118 +0,0 @@ -#!/bin/bash -# -# texinfo_createStructure.sh -- This function creates the -# documentation structure of a manual using the current language as -# reference. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_createStructure { - - # Verify manual main definition file. If it already exist, assume - # it was correctly created in the past. Otherwise try to create - # it. Don't use the manual base directory here, it would prevent - # documentation manuals from being created on different languages. - if [[ -f ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} ]];then - return - else - cli_printMessage "`eval_gettext "The following documentation manual doesn't exist:"`" --as-stdout-line - cli_printMessage "${MANUAL_BASEFILE}.${MANUAL_EXTENSION}" --as-response-line - cli_printMessage "`gettext "Do you want to create it now?"`" --as-yesornorequest-line - fi - - # Initialize manual's information (e.g., title, subtitle, abstract). - local MANUAL_TITLE='' - local MANUAL_SUBTITLE='' - local MANUAL_ABSTRACT='' - - # Retrieve manual's information from standard input. - cli_printMessage "`gettext "Enter manual's title"`" --as-request-line - read MANUAL_TITLE - cli_printMessage "`gettext "Enter manual's subtitle"`" --as-request-line - read MANUAL_SUBTITLE - cli_printMessage "`gettext "Enter manual's abstract"`" --as-request-line - read MANUAL_ABSTRACT - - # Verify manual's information. The title information must be - # non-empty value. - if [[ $MANUAL_TITLE == '' ]];then - cli_printMessage "`gettext "The manual title cannot be empty."`" --as-error-line - fi - - # Create manual's top-level directory using default version - # control system. This is the place where all texinfo - # documentation manuals are stored in. - if [[ ! -d ${MANUAL_BASEDIR} ]];then - cli_printMessage "${MANUAL_BASEDIR}" --as-creating-line - cli_runFnEnvironment vcs --quiet --mkdir ${MANUAL_BASEDIR} - fi - - # Create manual's base directory. This is the place where - # language-specific documentation source files are stored in. - cli_printMessage "${MANUAL_BASEDIR_L10N}" --as-creating-line - cli_runFnEnvironment vcs --quiet --mkdir ${MANUAL_BASEDIR_L10N} - - # Define file names required to build the manual. - local FILE='' - local FILES=$(cli_getFilesList "${MANUAL_TEMPLATE_L10N}" \ - --maxdepth='1' \ - --pattern="^.+/manual((-menu|-nodes|-index)?\.${MANUAL_EXTENSION}|\.conf)$") - - # Verify manual base file. The manual base file is where the - # documentation manual is defined in the format format. Assuming - # no file exists (e.g., a new language-specific manual is being - # created), use texinfo templates for it. - for FILE in $FILES;do - if [[ ! -f ${MANUAL_BASEDIR_L10N}/$(basename ${FILE}) ]];then - - # Be sure the file is inside the working copy and under - # version control. - cli_checkFiles ${FILE} --is-versioned - - # Define target file. - local DST=${MANUAL_BASEDIR_L10N}/$(basename ${FILE} \ - | sed -r "s!manual!${MANUAL_NAME}!") - - # Print action name. - cli_printMessage "${DST}" --as-creating-line - - # Copy using subversion to register this action. - cli_runFnEnvironment vcs --quiet --copy ${FILE} ${DST} - - # Expand common translation markers inside target file. - cli_expandTMarkers ${DST} - - # Expand specific translation markers inside target file. - sed -r -i -e "s!=MANUAL_NAME=!${MANUAL_NAME}!g" \ - -e "s!=MANUAL_TITLE=!${MANUAL_TITLE}!g" \ - -e "s!=MANUAL_SUBTITLE=!${MANUAL_SUBTITLE}!g" \ - -e "s!=MANUAL_ABSTRACT=!${MANUAL_ABSTRACT}!g" $DST - - fi - done - - # Initialize chapter structure inside the manual. - texinfo_createStructureChapters - - # Redefine absolute path to changed directory. - MANUAL_CHANGED_DIRS=${MANUAL_BASEDIR} - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_createStructureChapters.sh b/Automation/Functions/Help/Texinfo/texinfo_createStructureChapters.sh deleted file mode 100755 index 8356255..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_createStructureChapters.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash -# -# texinfo_createStructureChapters.sh -- This function initiates the -# chapter documentation structure of a manual, using the current -# language and template files as reference. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_createStructureChapters { - - local MANUAL_CHAPTER_DIR='' - - # Define list of chapter templates files used to build the - # documentation manual. Do not include the `Chapters' and - # `Licenses' directory here. The Chapters directory is used to - # build chapters based on value of `--chapter' option passed - # through the command-line. The `Licenses' directory is linked - # from its default template directory. - local FILE='' - local FILES=$(cli_getFilesList ${MANUAL_TEMPLATE_L10N} \ - --pattern="^.+/Chapters(-menu|-nodes)?\.${MANUAL_EXTENSION}$" --mindepth='1' \ - | egrep -v '/(Chapters|Licenses)/') - - # Loop through chapter structures and create them inside the - # manual. - for FILE in $FILES;do - - # Redefine manual's chapter directory based on template files. - MANUAL_CHAPTER_DIR=${MANUAL_BASEDIR_L10N}/$(basename $(dirname ${FILE})) - - # Verify texinfo templates used as based to build the chapter. - # Be sure they are inside the working copy of CentOS Artwork - # Repository and under version control, too. - cli_checkFiles ${FILE} --is-versioned - - # Print action name. - cli_printMessage "${MANUAL_CHAPTER_DIR}/$(basename ${FILE})" --as-creating-line - - # Verify chapter's directory. If it doesn't exist, create it. - if [[ ! -d ${MANUAL_CHAPTER_DIR} ]];then - cli_runFnEnvironment vcs --quiet --mkdir ${MANUAL_CHAPTER_DIR} - fi - - # Copy template files into chapter's directory. - cli_runFnEnvironment vcs --quiet --copy ${FILE} ${MANUAL_CHAPTER_DIR} - - done - - # Create link to `Licenses' default template directory. There - # isn't a need to duplicate this information. In fact it is - # important not to have it duplicated so we can centralize such - # information for all documentation manuals. - texinfo_updateLicenseLink - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_deleteCrossReferences.sh b/Automation/Functions/Help/Texinfo/texinfo_deleteCrossReferences.sh deleted file mode 100755 index 0793e56..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_deleteCrossReferences.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/bash -# -# texinfo_deleteCrossReferences.sh -- This function looks inside -# texinfo source files, from section level on, and removes all cross -# reference definitions related to a documentation entry. Use this -# function in coordination with texinfo_deleteEntry function, in order -# to keep cross reference information, inside the documentation -# manual, synchronized. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_deleteCrossReferences { - - local -a PATTERN - local -a REPLACE - - # Define documentation entry. - local MANUAL_ENTRY="$1" - - # Verify documentation entry. If documentation entry is empty, - # stop script execution with an error message. - if [[ $MANUAL_ENTRY == '' ]];then - cli_printMessage "`gettext "The first positional parameter cannot be empty."`" --as-error-line - fi - - # Build the node string using entry location. - local NODE="$(texinfo_getEntryNode "$MANUAL_ENTRY")" - - # Define regular expression patterns for texinfo cross reference - # commands. - PATTERN[0]="@(pxref|xref|ref)\{(${NODE})\}" - REPLACE[0]='--- @strong{'`gettext "Removed"`'}(\1:\2) ---' - - # Define replacement string for missing entries. It is convenient - # to keep missing entries in documentation for documentation team - # to know. Removing the missing cross reference may introduce - # confusion. Imagine that you are spending lots of hours in an - # article and suddenly one of your cross references disappears - # with no visible reason, with the next working copy update you - # perform. That's frustrating. Instead, when centos-art.sh script - # finds a missing cross reference it removes the link and remark - # the issue for you to act on it. - PATTERN[1]="^(\* ${NODE}:(.*):(.*))$" - REPLACE[1]='\@comment --- '`gettext "Removed"`'(\1) ---' - - # Define list of entries to process. - local MANUAL_ENTRIES=$(cli_getFilesList ${MANUAL_BASEDIR_L10N} \ - --pattern="^.+\.${MANUAL_EXTENSION}$" \ - | egrep -v "(${MANUAL_NAME}|chapter)-(menu|nodes|index)") - - # Update node-related cross references. The node-related cross - # reference definition, long ones specially, could require more - # than one line to be set. By default, GNU sed does not matches - # newline characters in the pattern space, so we need to make use - # of `label' feature and the `N' command in order to build a - # pattern space that includes the newline character in it. Here we - # use the `a' letter to name the label we use, followed by N - # command to add a newline to the pattern space, the s command to - # make the pattern replacement using the `g' flag to make it - # global and finally the command `b' to branch label named `a'. - sed -r -i ":a;N;s!${PATTERN[0]}!${REPLACE[0]}!g;ba" ${MANUAL_ENTRIES} - - # Update menu-related cross references. Menu-related cross - # references hardly appear in more than one line, so there is no - # need to complicate much the replacement command. - sed -r -i "s!${PATTERN[1]}!${REPLACE[1]}!" ${MANUAL_ENTRIES} - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_deleteEntry.sh b/Automation/Functions/Help/Texinfo/texinfo_deleteEntry.sh deleted file mode 100755 index b700804..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_deleteEntry.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash -# -# texinfo_deleteEntry.sh -- This function removes a documentation -# manuals, chapters or sections from the working copy. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_deleteEntry { - - # Remove manual, chapter or section based on documentation entry - # provided as non-option argument to `centos-art.sh' script. - if [[ ${MANUAL_SECT[$MANUAL_DOCENTRY_ID]} != '' ]];then - - # When a section is deleted, documentation entry points to a - # section name. In this configuration, documentation entry is - # deleted through subversion in order to register the change. - # Once the documentation entry is deleted, the section menu - # and nodes definition files are updated to keep manual in a - # consistent state. - texinfo_deleteEntrySection - - elif [[ ${MANUAL_CHAP[$MANUAL_DOCENTRY_ID]} != '' ]];then - - # When a chapter is deleted, documentation entry doesn't point - # to a section name but a chapter name. In this configuration, - # it is necessary to build a list of all the section entries - # available inside the chapter before deleting it. Once the - # chapter has been marked for deletion, it is time to update - # chapter definition files and later section definition files - # using the list of section entries previously defined. - # Actualization of section definition files must be done one - # at a time because menu entries related to section - # definitions are updated one at a time. - texinfo_deleteEntryChapter - - elif [[ ${MANUAL_DIRN[$MANUAL_DOCENTRY_ID]} != '' ]];then - - # When a manual is deleted, documentation entry doesnt' point - # to either a section or chapter but a manual name only. In - # this configuration the entire manual directory is marked for - # deletion, and that way processed. - texinfo_deleteEntryManual - - else - cli_printMessage "`gettext "The parameters you provided are not supported."`" --as-error-line - fi - - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_deleteEntryChapter.sh b/Automation/Functions/Help/Texinfo/texinfo_deleteEntryChapter.sh deleted file mode 100755 index 6cc2350..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_deleteEntryChapter.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash -# -# texinfo_deleteEntryChapter.sh -- This function standardizes chapter -# deletion inside the manual structure. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_deleteEntryChapter { - - # Verify existence of documentation entry before deleting it. - # We cannot delete an entry which doesn't exist. - cli_checkFiles "${MANUAL_CHAPTER_DIR}" -d - cli_checkFiles "${MANUAL_CHAPTER_DIR}-menu.${MANUAL_EXTENSION}" -f - cli_checkFiles "${MANUAL_CHAPTER_DIR}-nodes.${MANUAL_EXTENSION}" -f - cli_checkFiles "${MANUAL_CHAPTER_DIR}.${MANUAL_EXTENSION}" -f - - # Define list of chapters that shouldn't be removed. - local SPECIAL_CHAPTERS='/(Licenses|Index)$' - - # Verify list of chapters that shouldn't be removed against the - # current chapter directory being removed. - if [[ $MANUAL_CHAPTER_DIR =~ $SPECIAL_CHAPTERS ]];then - cli_printMessage "`gettext "The chapter specified cannot be removed."`" --as-error-line - fi - - # Build list of section entries inside the chapter. This is - # required to delete cross references from other section entries - # that point to section entries inside the chapter that will be - # deleted. Take care don't include the chapter definition files. - local MANUAL_ENTRIES=$(cli_getFilesList $MANUAL_CHAPTER_DIR \ - --pattern="^/.+\.${MANUAL_EXTENSION}$") - - # Remove chapter directory and related files using version control - # to register the change. - cli_runFnEnvironment vcs --delete ${MANUAL_CHAPTER_DIR} - cli_runFnEnvironment vcs --delete ${MANUAL_CHAPTER_DIR}-menu.${MANUAL_EXTENSION} - cli_runFnEnvironment vcs --delete ${MANUAL_CHAPTER_DIR}-nodes.${MANUAL_EXTENSION} - cli_runFnEnvironment vcs --delete ${MANUAL_CHAPTER_DIR}.${MANUAL_EXTENSION} - - # Update chapter menu and nodes inside manual structure. - texinfo_updateChapterMenu --delete-entry - texinfo_updateChapterNodes - - # Loop through section entries retrieved from chapter, before - # deleting it, in order to remove cross references pointing to - # those section entries. Since the chapter and all its sections - # have been removed, cross references pointing them will point to - # non-existent section entries. This way, all cross references - # pointing to non-existent section entries will be transformed in - # order for documenters to advertise the section entry state. - for MANUAL_ENTRY in $MANUAL_ENTRIES;do - texinfo_deleteCrossReferences ${MANUAL_ENTRY} - done - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_deleteEntryManual.sh b/Automation/Functions/Help/Texinfo/texinfo_deleteEntryManual.sh deleted file mode 100755 index 84d2bad..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_deleteEntryManual.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash -# -# texinfo_deleteEntryManual.sh -- This function standardized manual -# deletion inside the working copy. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_deleteEntryManual { - - # Verify existence of documentation entry before deleting it. We - # cannot delete an entry which doesn't exist. - cli_checkFiles "$MANUAL_ENTRY" -f - - # Remove locale-specific documentation manual directory from the - # working copy. Using subversion to register the change. Be sure - # that related output files are removed too. - cli_runFnEnvironment vcs --quiet --delete ${MANUAL_BASEDIR_L10N} - - # Verify manual base directory. When the locale-specific - # documentation manual is the last one inside the manual base - # directory, remove the manual base directory from the working - # copy. There is no need to have an empty manual base directories - # inside the working copy. - if [[ $(ls -1 $MANUAL_BASEDIR | wc -l) -le 1 ]];then - - # Remove manual base directory. - cli_runFnEnvironment vcs --delete ${MANUAL_BASEDIR} - - # Redefine absolute paths to changed directory. This is - # required in order for `(git|subversion)_commitRepoChanges' - # to be aware that we are deleting MANUAL_BASEDIR, not - # MANUAL_BASEDIR_L10N. - MANUAL_CHANGED_DIRS="${MANUAL_BASEDIR}" - - fi - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_deleteEntrySection.sh b/Automation/Functions/Help/Texinfo/texinfo_deleteEntrySection.sh deleted file mode 100755 index cc96ba4..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_deleteEntrySection.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -# -# texinfo_deleteEntrySection.sh -- This function standardized section -# deletion inside the manual structure. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_deleteEntrySection { - - # Verify documentation entry existence. We cannot remove a - # documentation entry which doesn't exist. - cli_checkFiles ${MANUAL_ENTRY} -f - - # Remove documentation entry using subversion to register the - # change. - cli_runFnEnvironment vcs --delete "${MANUAL_ENTRY}" - - # Update section menu, nodes and cross references. - texinfo_updateStructureSection "${MANUAL_ENTRY}" --delete - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_editEntry.sh b/Automation/Functions/Help/Texinfo/texinfo_editEntry.sh deleted file mode 100755 index 6acce79..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_editEntry.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/bash -# -# texinfo_editEntry.sh -- This function implements the edition flow of -# documentation entries inside the working copy. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_editEntry { - - # Verify section definition inside chapters. - if [[ ! -f $MANUAL_ENTRY ]];then - - # Verify chapter related to documentation entry. Inside - # manuals, all documentation entries are stored directly under - # its chapter directory. There is no more levels deep so it is - # possible to perform a direct chapter verification here. - if [[ ! -a $(dirname $MANUAL_ENTRY).${MANUAL_EXTENSION} ]];then - texinfo_createChapter - fi - - # Print confirmation question. - cli_printMessage "`gettext "The following documentation section doesn't exist:"`" --as-stdout-line - cli_printMessage "$MANUAL_ENTRY" --as-response-line - cli_printMessage "`gettext "Do you want to create it now?"`" --as-yesornorequest-line - - # Print action message. - cli_printMessage "$MANUAL_ENTRY" --as-updating-line - - # Update section menu, nodes and cross references based on - # changes in order for manual structure to remain consistent. - texinfo_updateStructureSection "$MANUAL_ENTRY" - - # Use default text editor to write changes on documentation entry. - $EDITOR $MANUAL_ENTRY - - else - - # Print action message. - cli_printMessage "$MANUAL_ENTRY" --as-updating-line - - # Rebuild section menu definitions before editing the - # documentation entry. This way, if there is any change in the - # section menu definition, it will be visible to you on - # edition. - texinfo_makeSeeAlso "$MANUAL_ENTRY" - - # Use default text editor to write changes on documentation entry. - $EDITOR $MANUAL_ENTRY - - # Rebuild section menu definitions after editing the - # documentation entry. This way, if there is any change or - # expansion to realize in the section menu definition, it be - # applied right now. Don't see a reason for waiting until the - # next edition for expansions to happen. - texinfo_makeSeeAlso "$MANUAL_ENTRY" - - fi - - # Rebuild output files to propagate recent changes, if any. - texinfo_updateOutputFiles - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_getEntry.sh b/Automation/Functions/Help/Texinfo/texinfo_getEntry.sh deleted file mode 100755 index 00b2f97..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_getEntry.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -# -# texinfo_getEntry.sh -- This function builds a documentation entry -# based on location specified as first positional parameter. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_getEntry { - - local MANUAL_ENTRY='' - local MANUAL_SECTION_NAME='' - local MANUAL_SECTION_NAMES="$@" - - # Loop through list of section names. - for MANUAL_SECTION_NAME in $MANUAL_SECTION_NAMES;do - - # Define absolute path to documentation entry. - MANUAL_ENTRY=${MANUAL_BASEDIR_L10N}/${MANUAL_CHAPTER_NAME}/${MANUAL_SECTION_NAME}.${MANUAL_EXTENSION} - - # Output entry's absolute path. - echo ${MANUAL_ENTRY} - - done - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_getEntryIndex.sh b/Automation/Functions/Help/Texinfo/texinfo_getEntryIndex.sh deleted file mode 100755 index cc93ce4..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_getEntryIndex.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -# -# texinfo_getEntryTitle.sh -- This function standardizes the way -# values for chapter and section index definitions are printed out. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_getEntryIndex { - - # Initialize phrase we want to transform based on style provided. - local PHRASE="$1" - - # In the entire phrase provided, capitalize the first word only. - PHRASE=$(echo "${PHRASE}" | tr '[:upper:]' '[:lower:]' \ - | sed -r 's!^([[:alpha:]])!\u\1!') - - # Output transformed phrase. - echo "$PHRASE" - -} - diff --git a/Automation/Functions/Help/Texinfo/texinfo_getEntryNode.sh b/Automation/Functions/Help/Texinfo/texinfo_getEntryNode.sh deleted file mode 100755 index 801061b..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_getEntryNode.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# -# texinfo_getEntryNode.sh -- This function cleans up the action value -# (ACTIONVAL) directory to make a node name from it. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_getEntryNode { - - # Define documentation entry. - local MANUAL_ENTRY="$1" - - # Verify documentation entry. - if [[ $MANUAL_ENTRY == '' ]];then - cli_printMessage "`gettext "The first positional parameter cannot be empty."`" --as-error-line - fi - - # Define node from documentation entry. - local NODE=$(echo "$MANUAL_ENTRY" | sed -r \ - -e "s!^${MANUAL_BASEDIR_L10N}/!!" \ - -e "s/\.${MANUAL_EXTENSION}$//" \ - -e "s!chapter!!" \ - -e 's!(/|-)! !g' \ - -e 's!\<([[:alpha:]]+)\>!\u\1!g' \ - -e 's!^[[:space:]]+!!' \ - -e 's![[:space:]]+$!!') - - echo "$NODE" - -} - diff --git a/Automation/Functions/Help/Texinfo/texinfo_getEntryTitle.sh b/Automation/Functions/Help/Texinfo/texinfo_getEntryTitle.sh deleted file mode 100755 index ce305c3..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_getEntryTitle.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/bash -# -# texinfo_getEntryTitle.sh -- This function standardizes the way entry -# titles for chapters and sections are printed out. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_getEntryTitle { - - # Initialize phrase we want to transform based on style provided. - local PHRASE="$1" - - # Define section style. Through this property you can customize - # the section title in predefined ways. By default, section - # titles are printed with each word capitalized (`cap-each-word'). - # Other values to this option are `cap-first-only' (to capitalize - # just the first word in the title) or `directory' to transform - # each word to a directory path. - local MANUAL_SECTION_STYLE=$(cli_getConfigValue "${MANUAL_CONFIG_FILE}" "main" "manual_section_style") - if [[ ! $MANUAL_SECTION_STYLE =~ '^(cap-each-word|cap-first-only|directory)$' ]];then - MANUAL_SECTION_STYLE='cap-each-word' - fi - - # Verify section style provided and transform the phrase value in - # accordance with it. - case $MANUAL_SECTION_STYLE in - - 'cap-first-only' ) - - # In the entire phrase provided, capitalize the first word - # only. - PHRASE=$(echo "${PHRASE}" | tr '[:upper:]' '[:lower:]' \ - | sed -r 's!^([[:alpha:]])!\u\1!') - ;; - - 'directory' ) - - # In the entire phrase provided, concatenate all words - # with slash (/) character and remark the fact it is a - # directory. - PHRASE=$(echo "${PHRASE}" | sed -r \ - -e 's/(Trunk|Branches|Tags)/\l\1/' \ - -e 's/ /\//g' \ - -e 's/\/([[:alpha:]])/\/\u\1/g') - - PHRASE="@file{$PHRASE}" - ;; - - 'cap-each-word' | * ) - - # In the entire phrase provided, capitalize all words. - PHRASE=$(echo "${PHRASE}" | tr '[:upper:]' '[:lower:]' \ - | sed -r 's!\<([[:alpha:]]+)\>!\u\1!g') - ;; - - esac - - # Output transformed phrase. - echo "$PHRASE" - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_makeSeeAlso.sh b/Automation/Functions/Help/Texinfo/texinfo_makeSeeAlso.sh deleted file mode 100755 index 346527d..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_makeSeeAlso.sh +++ /dev/null @@ -1,149 +0,0 @@ -#!/bin/bash -# -# texinfo_makeSeeAlso.sh -- This function creates a list of links with -# section entries one level ahead from the current section entry being -# processed. Desition of what of these texinfo definitions to use is -# set inside the section entry itself, through the following -# construction: -# -# @c -- <[centos-art(SeeAlso,TYPE) -# @c -- ]> -# -# In this construction, the TYPE variable can be either `itemize', -# `enumerate' or `menu'. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_makeSeeAlso { - - # Initialize variables. - local CHILD_ENTRIES='' - local CHILD_ENTRY='' - local ENTRY_PATTERN='' - local LIST_DEF='' - local LIST_ENTRIES='' - local LIST_TYPE='' - local LIST_TYPE_PATTERN='' - local MANUAL_ENTRY='' - local TMARK='' - local TMARK_PATTERN='' - local TMARKS='' - - # Define absolute path to section entry. - MANUAL_ENTRY="$1" - - # Verify section entry. When section entries are deleted, there is - # no menu definition to set. - if [[ ! -f $MANUAL_ENTRY ]];then - return - fi - - # Define `SeeAlso' translation marker regular expression pattern. - TMARK_PATTERN="^@c -- <\[${CLI_NAME}\(SeeAlso(,(itemize|enumerate|menu))?\)$" - - # Retrieve `SeeAlso' translation marker definition lines. Be sure - # to retrieve unique definitions only. If the same definition is - # present more than once, it will be expanded in one pass. There's - # no need to go through different passes in order to expand - # repeated translation marker definition. - TMARKS=$(egrep "${TMARK_PATTERN}" $MANUAL_ENTRY | sort | uniq) - - # Remove spaces from translation marker definition lines in order - # to process them correctly. Otherwise the definition line would - # be broken on each space character and then that wouldn't be the - # definition line we initially conceived. - TMARKS=$(echo "$TMARKS" | sed -r 's/ /\\040/g') - - # Define pattern used to build list of child sections. A child - # section shares the same path information of its parent without - # file extension. For example, if you have the `identity', - # `identity-images' and `identity-images-themes' section entries, - # `identity-images' is a child entry of `identity' likewise - # `identity-images-themes' is a child entry of `identity-images'. - ENTRY_PATTERN=$(echo "$MANUAL_ENTRY" | sed -r "s/\.${MANUAL_EXTENSION}$//") - - # Define list of child entries we'll use as reference to build the - # menu nodes. Reverse the output here to produce the correct value - # based on menu nodes definition set further. - CHILD_ENTRIES=$(cli_getFilesList $(dirname ${MANUAL_ENTRY}) \ - --pattern="^${ENTRY_PATTERN}-[[:alnum:]]+\.${MANUAL_EXTENSION}$" | sort -r | uniq ) - - # Loop through translation marker definition lines. - for TMARK in $TMARKS;do - - # Define list type based on translation marker definition. - # Remember to revert back the space character transformation - # we previously did, in order for the translation marker - # regular expression pattern to match. - LIST_TYPE=$(echo "$TMARK" | sed -r -e 's/\\040/ /g' -e "s/${TMARK_PATTERN}/\2/") - - # Define list type default value. This is, the list type used - # when no list type is specified in the translation marker - # construction properties field. - if [[ $LIST_TYPE == '' ]];then - LIST_TYPE="itemize" - fi - - # Define list properties (type included). - LIST_PROP=$(echo "$TMARK" | sed -r -e 's/\\040/ /g' -e "s/${TMARK_PATTERN}/\1/") - - # Define `SeeAlso' translation marker regular expression - # pattern that matches the translation marker definition. - # Notice that we cannot use TMARK_PATTERN here because it - # includes a selection list of all possible translation - # markers that can provided and here we need to precisely set - # the one being currently processed, not those whose could be - # processed. - LIST_TYPE_PATTERN="^@c -- <\[${CLI_NAME}\(SeeAlso${LIST_PROP}\)$" - - # Redefine list's entry based on translation marker definition. - if [[ $LIST_TYPE =~ '^menu$' ]];then - for CHILD_ENTRY in $CHILD_ENTRIES;do - LIST_ENTRIES="* $(texinfo_getEntryNode "$CHILD_ENTRY")::\n${LIST_ENTRIES}" - done - elif [[ $LIST_TYPE =~ '^(itemize|enumerate)$' ]];then - for CHILD_ENTRY in $CHILD_ENTRIES;do - LIST_ENTRIES="@item @ref{$(texinfo_getEntryNode "$CHILD_ENTRY")}\n${LIST_ENTRIES}" - done - else - # When an translation marker isn't recognize, go on with - # the next one in the list. - continue - fi - - # Define menu using menu nodes. - LIST_DEF="@c -- <[${CLI_NAME}(SeeAlso${LIST_PROP})\n@${LIST_TYPE}\n${LIST_ENTRIES}@end ${LIST_TYPE}\n@c -- ]>" - - # Expand list definition using translation marker and list - # definition itself. Be sure that no expansion be done when - # the closing tag of translation marker isn't specified. - # Otherwise, there might be lost of content. - sed -r -i "/${LIST_TYPE_PATTERN}/{:a;N;/\n@c -- ]>$/!ba;s/.*/${LIST_DEF}/;}" $MANUAL_ENTRY - - # Clean up both list definition and list entries. Otherwise - # undesired concatenations happen. - LIST_DEF='' - LIST_ENTRIES='' - LIST_TYPE='' - - done - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_renameCrossReferences.sh b/Automation/Functions/Help/Texinfo/texinfo_renameCrossReferences.sh deleted file mode 100755 index 597ae59..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_renameCrossReferences.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash -# -# texinfo_renameCrossReferences.sh -- This function renames menu, -# nodes and cross references related to chapters and sections that -# have been renamed previously. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_renameCrossReferences { - - local -a PATTERN - local -a REPLACE - - # Build source and target node definitions. - local NODE_SRC="$(texinfo_getEntryNode "$MANUAL_ENTRY_SRC")" - local NODE_DST="$(texinfo_getEntryNode "$MANUAL_ENTRY_DST")" - - # Define regular expression pattern and its replacement for node - # definitions that have been previously removed. - PATTERN[0]="--- @strong\{`gettext "Removed"`\}\((pxref|xref|ref):\<${NODE_SRC}\>(.*)\) ---" - REPLACE[0]="\@\1{${NODE_DST}\2}" - - # Define regular expression pattern and its replacement for menu - # definitions that have been previously removed. - PATTERN[1]="^@comment --- `gettext "Removed"`\(\* \<${NODE_SRC}\>(.*)\) ---$" - REPLACE[1]="* ${NODE_DST}\1" - - # Define list of entries to process. This is, all the texinfo - # source files the documentation manual is made of. - local MANUAL_ENTRIES=$(cli_getFilesList ${MANUAL_BASEDIR_L10N} \ - --pattern="^.+\.${MANUAL_EXTENSION}$" \ - | egrep -v "(${MANUAL_NAME}|chapter)-(menu|nodes|index)") - - # Update node cross references. The node-related cross reference - # definition, long ones specially, could require more than one - # line to be set. By default, GNU sed does not matches newline - # characters in the pattern space, so we need to make use of - # `label' feature and the `N' command in order to build a pattern - # space that includes the newline character in it. Here we use the - # `a' letter to name the label we use, followed by N command to - # add a newline to the pattern space, the s command to make the - # pattern replacement using the `g' flag to make it global and - # finally the command `b' to branch label named `a'. - # - # Inside the pattern space, the `\<' and `\>' are used to restrict - # the match pattern to a word boundary. The word boundary - # restriction applied here is required to avoid undesired - # replacements when we replace singular words with their plurals. - # For example, if we need to change the node `Manual' to its - # plural (i.e., `Manuals'), and no boundary restriction is used in - # the pattern space to do that, we might end up having nodes like - # `Manualsssss' which probably doesn't exist. This is because this - # sed command might be applied to the same file more than once; - # and each time it is applied, a new `Manuals' replaces the - # previous `Manuals' replacement to form `Manualss', `Manualsss', - # and so on for each interaction. Using word boundaries - # restrictions prevent such issue from happening. - sed -r -i ":a;N;s!${PATTERN[0]}!${REPLACE[0]}!g;ba" ${MANUAL_ENTRIES} - - # Update menu cross references. Menu cross reference definitions - # hardly appear in more than one line, so there is no need to - # complicate the replacement command. - sed -r -i "s!${PATTERN[1]}!${REPLACE[1]}!" ${MANUAL_ENTRIES} - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_renameEntry.sh b/Automation/Functions/Help/Texinfo/texinfo_renameEntry.sh deleted file mode 100755 index a626922..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_renameEntry.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash -# -# texinfo_renameEntry.sh -- This function standardizes renaming tasks -# related to manual, chapters and sections inside the working copy. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_renameEntry { - - # Initialize source and target locations. - local MANUAL_ENTRY_SRC='' - local MANUAL_ENTRY_DST='' - - # Define both source and target documentation entries. To build - # the source and target documentation entries we take into - # consideration the manual's main definition file, the chapter's - # main definition file and non-option arguments passed to - # centos-art.sh script through the command-line. - if [[ ${MANUAL_SECT[${MANUAL_DOCENTRY_ID}]} != '' ]];then - - # When a section is renamed, the section source location is - # duplicated into the section target location and later - # removed from the working copy. Once the section source - # location has been renamed, the section menu, nodes and cross - # references are updated to keep consistency inside the - # manual. - texinfo_renameEntrySection - - elif [[ ${MANUAL_CHAP[$MANUAL_DOCENTRY_ID]} != '' ]] \ - && [[ ${MANUAL_CHAP[(($MANUAL_DOCENTRY_ID + 1))]} != '' ]];then - - # When a chapter is renamed, the chapter source location is - # duplicated into the chapter source location and later - # removed from the working copy. Once the chapter source - # location has been renamed, the chapter and section menu, - # nodes and cross references are updated to keep consistency - # inside the manual. - texinfo_renameEntryChapter - - elif [[ ${MANUAL_DIRN[$MANUAL_DOCENTRY_ID]} != '' ]] \ - && [[ ${MANUAL_DIRN[(($MANUAL_DOCENTRY_ID + 1))]} != '' ]] ;then - - # When a manual is renamed, a new manual structure is created - # in the manual target location and all chapters and sections - # are duplicated from manual source location to manual target - # location. Once the source manual has been renamed, chapter - # and section menu, nodes and cross references are updated to - # keep consistency inside the manual. - texinfo_renameEntryManual - - else - cli_printMessage "`gettext "The parameters you provided are not supported."`" --as-error-line - fi - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_renameEntryChapter.sh b/Automation/Functions/Help/Texinfo/texinfo_renameEntryChapter.sh deleted file mode 100755 index 18cf697..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_renameEntryChapter.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -# -# texinfo_renameEntryChapter.sh -- This function standardizes renaming -# tasks related to manual chapters inside documentation manuals -# written in texinfo format. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_renameEntryChapter { - - # Copy section source entry to target location. - texinfo_copyEntryChapter - - # Delete section source entry. - texinfo_deleteEntryChapter - - # Rename menu, nodes and cross references related entries. - texinfo_renameCrossReferences - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_renameEntryManual.sh b/Automation/Functions/Help/Texinfo/texinfo_renameEntryManual.sh deleted file mode 100755 index ce9d8a1..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_renameEntryManual.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash -# -# texinfo_renameEntryManual.sh -- This function standardizes renaming -# tasks related to documenation manuals written in texinfo format -# inside the working copy. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_renameEntryManual { - - # Copy section source entry to target location. - texinfo_copyEntryManual - - # Delete section source entry. - texinfo_deleteEntryManual - - # Redefine absolute paths to changed directories. This is - # required in order for `cli_synchronizeRepoChanges' to be aware - # of manual source and target locations we've just renamed. - MANUAL_CHANGED_DIRS="${MANUAL_BASEDIR} $(echo $MANUAL_BASEDIR \ - | sed -r "s!${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]}!${MANUAL_DIRN[((${MANUAL_DOCENTRY_ID} + 1))]}!")" - - # From this time on, the manual information set so far is no - # longer useful. Redefine it to start using the new manual - # information instead. - - # Redefine manual name using manual name passed to `centos-art.sh' - # script as second non-option argument. - MANUAL_NAME=${MANUAL_SLFN[((${MANUAL_DOCENTRY_ID} + 1))]} - - # Redefine absolute path to manual directory using manual name - # passed to `centos-art.sh' script as second non-option argument. - MANUAL_BASEDIR="$(echo $MANUAL_BASEDIR \ - | sed -r "s!${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]}!${MANUAL_DIRN[((${MANUAL_DOCENTRY_ID} + 1))]}!")" - - # Redefine absolute path to manual directory using manual name - # passed to `centos-art.sh' script as second non-option argument. - MANUAL_BASEDIR_L10N="${MANUAL_BASEDIR}/${MANUAL_L10N}" - - # Redefine absolute path to base file using manual name passed to - # `centos-art.sh' script as second non-option argument. - MANUAL_BASEFILE="${MANUAL_BASEDIR_L10N}/${MANUAL_NAME}" - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_renameEntrySection.sh b/Automation/Functions/Help/Texinfo/texinfo_renameEntrySection.sh deleted file mode 100755 index 771929a..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_renameEntrySection.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -# -# texinfo_renameEntrySection.sh -- This function standardizes renaming -# tasks related to chapter sections inside documentation manuals -# written in texinfo format. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_renameEntrySection { - - # Copy section source entry to target location. - texinfo_copyEntrySection - - # Delete section source entry. - texinfo_deleteEntrySection - - # Rename menu, nodes and cross references related entries. - texinfo_renameCrossReferences - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_restoreCrossReferences.sh b/Automation/Functions/Help/Texinfo/texinfo_restoreCrossReferences.sh deleted file mode 100755 index e7389c0..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_restoreCrossReferences.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/bash -# -# texinfo_restoreCrossReferences.sh -- This function looks inside -# texinfo source files, from section level on, and restores any cross -# reference related to a documentation entry. This function is used in -# those cases where documentation entries are created/recreated to -# documentation structure. It is a verification that looks for -# matching documentation entries previously defined as removed by -# texinfo_deleteCrossReferences function. The -# texinfo_restoreCrossReferences function relays in the removed -# message format produced by texinfo_deleteCrossReferences -# function, in order to return them back into the link format. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_restoreCrossReferences { - - local -a PATTERN - local -a REPLACE - - # Define documentation entry. - local MANUAL_ENTRY="$1" - - # Verify documentation entry. If documentation entry is empty, - # stop script execution with an error message. - if [[ $MANUAL_ENTRY == '' ]];then - cli_printMessage "`gettext "The first positional parameter cannot be empty."`" --as-error-line - fi - - # Build the node string using entry location. - local NODE="$(texinfo_getEntryNode "$MANUAL_ENTRY")" - - # Define regular expression patterns to match removed message - # format produced by message_removeCrossReferences function. - PATTERN[0]="--- @strong\{`gettext "Removed"`\}\((pxref|xref|ref):(${NODE})\) ---" - PATTERN[1]="^@comment --- `gettext "Removed"`\((\* ${NODE}:(.*)?:(.*)?)\) ---$" - - # Define replacement string to turn removed message back to cross - # reference link. - REPLACE[0]='\@\1{\2}' - REPLACE[1]='\1' - - # Define list of entries to process. - local MANUAL_ENTRIES=$(cli_getFilesList ${MANUAL_BASEDIR_L10N} \ - --pattern="^.+\.${MANUAL_EXTENSION}$") - - # Update node-related cross references. The node-related cross - # reference definition, long ones specially, could require more - # than one line to be set. By default, GNU sed does not matches - # newline characters in the pattern space, so we need to make use - # of `label' feature and the `N' command in order to build a - # pattern space that includes the newline character in it. Here we - # use the `a' letter to name the label we use, followed by N - # command to add a newline to the pattern space, the s command to - # make the pattern replacement using the `g' flag to make it - # global and finally the command `b' to branch label named `a'. - sed -r -i ":a;N;s!${PATTERN[0]}!${REPLACE[0]}!g;ba" ${MANUAL_ENTRIES} - - # Update menu-related cross references. Menu-related cross - # references hardly appear in more than one line, so there is no - # need to complicate the replacement command. - sed -r -i "s!${PATTERN[1]}!${REPLACE[1]}!" ${MANUAL_ENTRIES} - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_searchIndex.sh b/Automation/Functions/Help/Texinfo/texinfo_searchIndex.sh deleted file mode 100755 index 9e62307..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_searchIndex.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -# -# texinfo_searchIndex.sh -- This function does an index search inside the -# info document. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_searchIndex { - - # Verify manual output files and, if they don't exist, create - # them. - if [[ ! -f ${MANUAL_BASEFILE}.info.bz2 ]];then - texinfo_updateOutputFiles - fi - - # Print separator line. - cli_printMessage '-' --as-separator-line - - # Print action message. - cli_printMessage "${MANUAL_BASEFILE}.info.bz2" --as-reading-line - - # Execute info command to perform an index-search. - /usr/bin/info --index-search="$FLAG_SEARCH" --file=${MANUAL_BASEFILE}.info.bz2 - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_searchNode.sh b/Automation/Functions/Help/Texinfo/texinfo_searchNode.sh deleted file mode 100755 index a22749a..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_searchNode.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash -# -# texinfo_searchNode.sh -- This function converts the documentation -# entry provided to `centos-art.sh' script command-line into a node -# and tries to read it from the manual's `.info' output file. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_searchNode { - - # Verify documentation entry and, if it doesn't exist, prompt out - # its creation. - if [[ ! -f "$MANUAL_ENTRY" ]];then - texinfo_editEntry - fi - - # Verify manual output files and, if they don't exist, create - # them. - if [[ ! -f ${MANUAL_OUTPUT_BASEFILE}.info.bz2 ]];then - texinfo_updateOutputFiles - fi - - # Print separator line. - cli_printMessage '-' --as-separator-line - - # Print action message. - cli_printMessage "${MANUAL_OUTPUT_BASEFILE}.info.bz2" --as-reading-line - - # Define manual node that will be read. - local MANUAL_NODE="$(texinfo_getEntryNode "$MANUAL_ENTRY")" - - # Verify manual node that will be read. When the manual name is - # the only value passed as documentation entry, then use the `Top' - # node as manual node to be read. - if [[ $MANUAL_NODE =~ $(texinfo_getEntryNode "$MANUAL_NAME") ]];then - MANUAL_NODE='Top' - fi - - # Use info reader to read the manual node. - info --node="${MANUAL_NODE}" --file="${MANUAL_OUTPUT_BASEFILE}.info.bz2" - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_updateChapterMenu.sh b/Automation/Functions/Help/Texinfo/texinfo_updateChapterMenu.sh deleted file mode 100755 index b9d5433..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_updateChapterMenu.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/bash -# -# texinfo_updateChapterMenu.sh -- This function updates chapter menu. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_updateChapterMenu { - - local ACTION=$1 - local MENUCHAPTERS='' - - # Print action name. - cli_printMessage "${MANUAL_BASEFILE}-menu.${MANUAL_EXTENSION}" --as-creating-line - - # Build menu of chapters. The Index node is not included as other - # nodes are. The Index node is defined inside the master texinfo - # file (repository.texinfo) as an included file. To create the final - # .info file correctly, the Index line in the menu should remain, - # even no other node exist. - if [[ -f ${MANUAL_BASEFILE}-menu.${MANUAL_EXTENSION} ]];then - MENUCHAPTERS=$(cat ${MANUAL_BASEFILE}-menu.${MANUAL_EXTENSION} \ - | egrep -v "^@(end )?menu$" \ - | egrep -v '^\* (Licenses|Index)::$') - fi - - # Re-defined menu of chapters based on action. - case $ACTION in - - --delete-entry ) - # Remove chapter from menu. - MENUCHAPTERS=$(echo "${MENUCHAPTERS}" \ - | egrep -v '^\* '"${MANUAL_CHAPTER_NAME}"'::[[:print:]]*$') - ;; - - --add-entry | * ) - # Update chapter menu using texinfo format. Be sure the - # chapter node itself is not included here, that would - # duplicate it inside the menu definition file which end - # up being a definition error. Take care the way you quote - # egrep's pattern, prevent to end up using the syntax - # `$"..."' which has security risks. - MENUCHAPTERS="$(echo "${MENUCHAPTERS}" \ - | egrep -v '\* '"${MANUAL_CHAPTER_NAME}"'::[[:print:]]*$') - * ${MANUAL_CHAPTER_NAME}::" - ;; - esac - - # Remove opening spaces/tabs and empty line from the menu of - # chapters. Empty lines may occur the first time the menu of - # chapters is created. - MENUCHAPTERS=$(echo "${MENUCHAPTERS}" | sed -r 's!^[[:space:]]+!!' \ - | egrep -v '^[[:space:]]*$') - - # Organize menu of chapters alphabetically and verify that no - # duplicated line be included on the list. Notice that organizing - # menu this way suppresses the idea of putting the last chapter - # created at the end of the list. - #MENUCHAPTERS=$(echo "${MENUCHAPTERS}" | sort | uniq) - - # Give format to final menu output. - MENUCHAPTERS="@menu - ${MENUCHAPTERS} - * Licenses:: - * Index:: - @end menu" - - # Remove opening space/tabs from menu's final definition. - MENUCHAPTERS=$(echo "${MENUCHAPTERS}" | sed -r 's!^[[:space:]]+!!' \ - | egrep -v '^[[:space:]]*$') - - # Dump organized menu of chapters into file. - echo "${MENUCHAPTERS}" > ${MANUAL_BASEFILE}-menu.${MANUAL_EXTENSION} - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_updateChapterNodes.sh b/Automation/Functions/Help/Texinfo/texinfo_updateChapterNodes.sh deleted file mode 100755 index f82b0b4..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_updateChapterNodes.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash -# -# texinfo_updateChapterNodes.sh -- This function updates nodes of -# chapters based on menu of chapters. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_updateChapterNodes { - - # Print action name. - cli_printMessage "${MANUAL_BASEFILE}-nodes.${MANUAL_EXTENSION}" --as-creating-line - - # Build chapter nodes using entries from chapter menu as - # reference. Don't include `Licenses' or `Index' chapters here. - # These chapters are part of our manual's main definition file and - # shouldn't be handled as regular chapters. - local CHAPTERNODES=$(cat ${MANUAL_BASEFILE}-menu.${MANUAL_EXTENSION} \ - | egrep -v '^@(end )?menu$' | egrep -v '^\* (Licenses|Index)::$'\ - | sed -r 's!^\* !!' | sed -r 's!::[[:print:]]*$!!g' \ - | sed -r 's! !_!g') - - # Build list of inclusions from chapter nodes. - local FILENODE=$(\ - for CHAPTERNODE in ${CHAPTERNODES};do - INCL=$(echo ${CHAPTERNODE} \ - | sed -r "s!(${CHAPTERNODE})!\1.${MANUAL_EXTENSION}!") - # Output inclusion line using texinfo format. - echo "@include $INCL" - done) - - # Dump organized nodes of chapters into file. - echo "$FILENODE" > ${MANUAL_BASEFILE}-nodes.${MANUAL_EXTENSION} - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_updateLicenseLink.sh b/Automation/Functions/Help/Texinfo/texinfo_updateLicenseLink.sh deleted file mode 100755 index 273e6b0..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_updateLicenseLink.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -# -# texinfo_updateLicenseLink.sh -- This function updates the link -# information related to License directory used by Texinfo -# documentation manuals. There isn't a need to duplicate the License -# information in each documentation manual. In fact it is important -# not to have it duplicated so we can centralize such information for -# all documentation manuals. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_updateLicenseLink { - - # Define directory where license templates are stored in. - local DIR=${TCAR_WORKDIR}/Documentation/Models/Texinfo/Default/${CLI_LANG_LC} - - # Define files related to license templates. - local FILES=$(find ${DIR} -name 'Licenses*') - - for FILE in $FILES;do - - # Remove path from license templates. - FILE=$(basename ${FILE}) - - # Remove license files from manual's specific models. All - # these files are symbolic links. If they aren't, stop the - # script execution with an error message. In this case you - # need to fix your directory structure first (e.g., by - # fetching a more up-to-date version of it from central - # repository). - if [[ -h ${MANUAL_BASEDIR_L10N}/${FILE} ]];then - rm ${MANUAL_BASEDIR_L10N}/${FILE} - else - cli_printMessage "${MANUAL_BASEDIR_L10N} `gettext "has an old directory structure."`" --as-error-line - fi - - # Create link from manual's default models to manual's - # specific models. - ln -s ${DIR}/${FILE} ${MANUAL_BASEDIR_L10N}/${FILE} - - done - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_updateOutputFileDocbook.sh b/Automation/Functions/Help/Texinfo/texinfo_updateOutputFileDocbook.sh deleted file mode 100755 index 2937ad6..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_updateOutputFileDocbook.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# -# texinfo_updateOutputFileDocbook.sh -- This function exports -# documentation manual to DocBook format. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_updateOutputFileDocbook { - - # Print action message. - cli_printMessage "${MANUAL_OUTPUT_BASEFILE}.docbook" --as-creating-line - - # Update xml output format. - /usr/bin/makeinfo --docbook --output=${MANUAL_OUTPUT_BASEFILE}.docbook \ - ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} --no-warn - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_updateOutputFileInfo.sh b/Automation/Functions/Help/Texinfo/texinfo_updateOutputFileInfo.sh deleted file mode 100755 index 9a462fe..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_updateOutputFileInfo.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -# -# texinfo_updateOutputFileInfo.sh -- This function exports -# documentation manual to info format. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_updateOutputFileInfo { - - # Output action message. - cli_printMessage "${MANUAL_OUTPUT_BASEFILE}.info.bz2" --as-creating-line - - # Update info file. - /usr/bin/makeinfo --output=${MANUAL_OUTPUT_BASEFILE}.info \ - --enable-encoding \ - ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} - - # Compress info file. - if [[ $? -eq 0 ]];then - bzip2 -f ${MANUAL_OUTPUT_BASEFILE}.info - fi - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_updateOutputFilePdf.sh b/Automation/Functions/Help/Texinfo/texinfo_updateOutputFilePdf.sh deleted file mode 100755 index c93c6f5..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_updateOutputFilePdf.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -# -# texinfo_updateOutputFilePdf.sh -- This function exports documentation -# manual to PDF format. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_updateOutputFilePdf { - - # Verify texi2pdf package existence. If this package isn't - # installed in the system, stop script execution with an error - # message. texi2pdf isn't a package by itself but a program of - # texinfo-tex package. So check the correct package. - cli_checkFiles texinfo-tex --is-installed - - # Output action message. - cli_printMessage "${MANUAL_OUTPUT_BASEFILE}.pdf" --as-creating-line - - # Update plaintext output directory. - /usr/bin/texi2pdf --quiet \ - ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} --output=${MANUAL_OUTPUT_BASEFILE}.pdf - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_updateOutputFilePlaintext.sh b/Automation/Functions/Help/Texinfo/texinfo_updateOutputFilePlaintext.sh deleted file mode 100755 index 4d753b8..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_updateOutputFilePlaintext.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -# -# texinfo_updateOutputFilePlaintext.sh -- This function exports -# documentation manual to plain-text format. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_updateOutputFilePlaintext { - - # Output action message. - cli_printMessage "${MANUAL_OUTPUT_BASEFILE}.txt.bz2" --as-creating-line - - # Update plaintext output directory. - /usr/bin/makeinfo --plaintext \ - ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} --output=${MANUAL_OUTPUT_BASEFILE}.txt - - # Compress plaintext output file. - if [[ -f ${MANUAL_OUTPUT_BASEFILE}.txt ]];then - bzip2 ${MANUAL_OUTPUT_BASEFILE}.txt --force - fi - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_updateOutputFileXhtml.sh b/Automation/Functions/Help/Texinfo/texinfo_updateOutputFileXhtml.sh deleted file mode 100755 index 05acbf3..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_updateOutputFileXhtml.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/bin/bash -# -# texinfo_updateOutputFileXhtml.sh -- This function exports -# documentation manual to HTML format. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_updateOutputFileXhtml { - - # Verify texi2html package existence. If this package isn't - # installed in the system, stop script execution with an error - # message. - cli_checkFiles texi2html --is-installed - - # Output action message. - cli_printMessage "${MANUAL_OUTPUT_BASEFILE}.xhtml.tar.bz2" --as-creating-line - - # Verify initialization files used by texi2html. - cli_checkFiles -e ${MANUAL_TEMPLATE}/manual-init.pl - cli_checkFiles -e ${MANUAL_TEMPLATE_L10N}/manual-init.pl - - # Verify transformation files used to modify texi2html output. - cli_checkFiles -e ${MANUAL_TEMPLATE}/manual.sed - cli_checkFiles -e ${MANUAL_TEMPLATE_L10N}/manual.sed - - # Clean up directory structure where xhtml files will be stored. - # We don't want to have unused files inside it. - if [[ -d ${MANUAL_OUTPUT_BASEFILE}-xhtml ]];then - rm -r ${MANUAL_OUTPUT_BASEFILE}-xhtml - fi - - # Prepare directory structure where xhtml files will be stored in. - mkdir -p ${MANUAL_OUTPUT_BASEFILE}-xhtml - - # Add manual base directory path into directory stack to make it - # the current working directory. This is done to reduce the path - # information packaged inside `repository.xhtml.tar.bz2' file. - pushd ${MANUAL_OUTPUT_BASEFILE}-xhtml > /dev/null - - # Update xhtml files. Use texi2html to export from texinfo file - # format to xhtml using The CentOS Web default visual style. - texi2html --lang=${CLI_LANG_LL} \ - --init-file=${MANUAL_TEMPLATE}/manual-init.pl \ - --init-file=${MANUAL_TEMPLATE_L10N}/manual-init.pl \ - -I ${TCAR_WORKDIR} \ - --output=${MANUAL_OUTPUT_BASEFILE}-xhtml \ - ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} - - # Create `css' and `images' directories. In order to save disk - # space, these directories are linked (symbolically) to their - # respective locations inside the working copy. - ln -s ${TCAR_WORKDIR}/Identity/Webenv/Themes/Default/Docbook/1.69.1/Css Css - ln -s ${TCAR_WORKDIR}/Identity/Images/Webenv Images - - # Remove directory where xhtml files are stored from directory - # stack. The xhtml files have been already created. - popd > /dev/null - - # Apply xhtml transformations. This transformation cannot be built - # inside the initialization script (repository-init.pl). For example, - # Would it be a possible way to produce different quotation HTML - # outputs from the same texinfo quotation definition? Instead, - # once the HTML code is produced we can take the quotation HTML - # definition plus the first letters inside it and transform the - # structure to a completely different thing that can be handle - # through classed inside CSS definitions. - sed -r -i \ - -f ${MANUAL_TEMPLATE}/manual.sed \ - -f ${MANUAL_TEMPLATE_L10N}/manual.sed \ - ${MANUAL_OUTPUT_BASEFILE}-xhtml/*.xhtml - - # Compress directory structure where xhtml files are stored in. - # This compressed version is the one we put under version control. - # The directory used to build the compressed version is left - # unversion for the matter of human revision. - tar -cjf ${MANUAL_OUTPUT_BASEFILE}.xhtml.tar.bz2 ${MANUAL_OUTPUT_BASEFILE}-xhtml > /dev/null 2>&1 - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_updateOutputFileXml.sh b/Automation/Functions/Help/Texinfo/texinfo_updateOutputFileXml.sh deleted file mode 100755 index 4a60c3f..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_updateOutputFileXml.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# -# texinfo_updateOutputFileXml.sh -- This function exports documentation -# manual to XML format. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_updateOutputFileXml { - - # Print action message. - cli_printMessage "${MANUAL_OUTPUT_BASEFILE}.xml" --as-creating-line - - # Update xml output format. - /usr/bin/makeinfo --xml \ - ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} --output=${MANUAL_OUTPUT_BASEFILE}.xml \ - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_updateOutputFiles.sh b/Automation/Functions/Help/Texinfo/texinfo_updateOutputFiles.sh deleted file mode 100755 index ed1eedc..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_updateOutputFiles.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash -# -# texinfo_updateOutputFiles.sh -- This function exports documentation -# manual to different output formats. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_updateOutputFiles { - - # Verify manual base file. We can update manual outputs only if - # its base file exists. For example, we cannot update manual - # outputs if the manual has been deleted previously. - if [[ ! -a ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} ]];then - return - fi - - # Verify output directory. - if [[ ! -d $(dirname $MANUAL_OUTPUT_BASEFILE) ]];then - mkdir -p $(dirname $MANUAL_OUTPUT_BASEFILE) - fi - - # Move script execution to manuals base directory in order for - # makeinfo to produce content correctly. This is the location - # where the documentation's main definition file is stored in. - # Related content outside this location is accessible through - # symbolic links. - pushd ${MANUAL_BASEDIR_L10N} > /dev/null - - # Verify existence of link to Licenses information. - texinfo_updateLicenseLink - - # Keep the order in which these actions are performed. Begin with - # actions that use the makeinfo file to realize the export. Later, - # continue with action that need other tools to realize the export - # (e.g., texi2html to produce XHTML and texi2pdf to produce PDF - # outputs). - texinfo_updateOutputFileInfo - texinfo_updateOutputFileXml - texinfo_updateOutputFileDocbook - texinfo_updateOutputFilePlaintext - texinfo_updateOutputFileXhtml - texinfo_updateOutputFilePdf - - # Remove the working copy root directory from directory stack. - popd > /dev/null - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_updateSectionMenu.sh b/Automation/Functions/Help/Texinfo/texinfo_updateSectionMenu.sh deleted file mode 100755 index 03c9315..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_updateSectionMenu.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/bash -# -# texinfo_updateSectionMenu.sh -- This function updates the section's -# menu definition file of a chapter. If this function is called with -# the '--delete-entry' string as first argument, the menu line related -# to the entry being processed is removed. Otherwise, if this function -# is called with the '--add-entry' string as first argument, the menu -# line related to the entry being processed is added to menu's bottom. -# If no argument is passed to this function, the '--add-entry' action -# is assumed. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_updateSectionMenu { - - # Specify which action to do with documentation entry inside the - # chapter menu. - local ACTION="$1" - - # Define section order. Through this property you can customize - # the section order inside the manual. Possible arguments to this - # option are `ordered', `reversed', `created'. From these three - # values `created' is used by default (i.e., new menu entries are - # added to menu's bottom as last entry.). Notice that, once - # you've sorted the menu using `ordered' or `reversed' values, it - # is hard to sort the list back to former creation orders. Go - # sorted or not sorted at all. - local MANUAL_SECTION_ORDER=$(cli_getConfigValue "${MANUAL_CONFIG_FILE}" "main" "manual_section_order") - if [[ ! $MANUAL_SECTION_ORDER =~ '^(created|ordered|reversed)$' ]];then - MANUAL_SECTION_ORDER='created' - fi - - # Build node information used inside chapter menu. - local MENUNODE=$(texinfo_getEntryNode "$MANUAL_ENTRY") - - # Define menu entry using texinfo style and node information as - # reference. - local MENULINE="* ${MENUNODE}::" - - # Retrieve list of menu entries from chapter menu and exclude - # `@menu', `@end menu' and empty lines from output. - local MENU=$(cat ${MENUFILE} \ - | egrep -v '^[[:space:]]*$' | egrep -v '^@(end )?menu') - - # Re-defined chapter menu entries based on action provided to this - # function as first positional parameter. - case $ACTION in - - --delete-entry ) - # Remove menu entry from chapter menu. - MENU="$(echo "$MENU" | egrep -v "$MENULINE")" - ;; - - --add-entry | * ) - # Add menu entry to chapter menu list as last entry. - MENU="$(echo "$MENU" | egrep -v "$MENULINE" ) - ${MENULINE}" - ;; - - esac - - # Remove opening spaces/tabs and empty lines from final menu - # entries. - MENU=$(echo "$MENU" | sed -r 's!^[[:space:]]+!!g' \ - | egrep -v '^[[:space:]]*$') - - # Sort menu entries based on section order property. - case $MANUAL_SECTION_ORDER in - - 'ordered' ) - MENU="$(echo "$MENU" | sort )" - ;; - - 'reversed' ) - MENU="$(echo "$MENU" | sort -r )" - ;; - - esac - - # Rebuild list of chapter menu entries including '@menu' and '@end - # menu' lines back into chapter menu. - MENU="@menu - $MENU - @end menu" - - # Remove opening spaces/tabs and empty lines from final menu - # structure. - MENU=$(echo "$MENU" | sed -r 's!^[[:space:]]+!!g' \ - | egrep -v '^[[:space:]]*$') - - # Dump chapter menu entries back into chapter's menu definition - # file. - echo "$MENU" > ${MENUFILE} - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_updateSectionNodes.sh b/Automation/Functions/Help/Texinfo/texinfo_updateSectionNodes.sh deleted file mode 100755 index 58d4c30..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_updateSectionNodes.sh +++ /dev/null @@ -1,145 +0,0 @@ -#!/bin/bash -# -# texinfo_updateSectionNodes.sh -- This function updates section's -# nodes definition files using section's menu definition file both -# inside the same chapter. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_updateSectionNodes { - - # Define node file. - local NODEFILE=$(echo $MENUFILE | sed -r "s,-menu,-nodes,") - - # Build list of chapter nodes using entries from chapter menu as - # reference. - local NODES=$(cat ${MENUFILE} \ - | sed -r 's!^\* !!' | sed -r 's!:{1,2}.*$!!g' \ - | egrep -v '^@(end )?menu$' | sed -r 's! !:!g') - - # Build chapter nodes based on chapter menu. - for NODE in $NODES;do - - local NODE=$(echo "${NODE}" | sed -r 's!:! !g') - local INCL=$(echo "${NODE}" | sed -r -e 's! !/!' -e 's! !-!g' -e's!/(.+)!/\L\1!').${MANUAL_EXTENSION} - local SECT=$(texinfo_getEntryTitle "$NODE") - local CIND=$(texinfo_getEntryIndex "$NODE") - - # Initialize absolute path to final texinfo template. - local TEMPLATE='' - - # Create texinfo section file using templates, only if the - # section file doesn't exist and hasn't been marked for - # deletion. Otherwise, when the files have been marked for - # deletion, they will be created again from texinfo template - # to working copy and that might create confusion. - if [[ ! -f ${MANUAL_BASEDIR_L10N}/$INCL ]] \ - && [[ $(cli_runFnEnvironment vcs --status ${MANUAL_BASEDIR_L10N}/$INCL) != 'D' ]];then - - # Retrieve configuration lines from configuration file. Be - # sure no line beginning with `#' or space remain in the - # line. Otherwise, it would be difficult to loop through - # configuration lines. - local CONFLINE='' - local CONFLINES=$(cli_getConfigLines "${MANUAL_CONFIG_FILE}" "templates" "*") - - # Initialize both left hand side and right hand side - # configuration values. - local CONFLHS='' - local CONFRHS='' - - # Define what section template to apply using - # documentation entry absolute path and values provided by - # configuration line. Be sure to break the loop in the - # first match. - for CONFLINE in $CONFLINES;do - - CONFLHS=$(echo $CONFLINE \ - | gawk 'BEGIN{FS="="}; { print $1 }' \ - | sed -r 's![[:space:]]*!!g') - - CONFRHS=$(echo $CONFLINE \ - | gawk 'BEGIN{FS="="}; { print $2 }' \ - | sed -r -e 's![[:space:]]*!!g' -e 's!^"(.+)"$!\1!') - - if [[ ${MANUAL_BASEDIR_L10N}/${INCL} =~ $CONFRHS ]];then - TEMPLATE="${MANUAL_TEMPLATE_L10N}/${CONFLHS}" - break - fi - - done - - # Verify existence of texinfo template file. If no - # template is found, stop script execution with an error - # message. We cannot continue without it. - cli_checkFiles -e ${TEMPLATE} - - # Create documentation entry using texinfo template as - # reference. - cli_runFnEnvironment vcs --copy --quiet ${TEMPLATE} ${MANUAL_BASEDIR_L10N}/$INCL - - fi - - # Expand common translation markers in documentation entry. - cli_expandTMarkers "${MANUAL_BASEDIR_L10N}/$INCL" - - # Replace node, section and concept index definitions already - # defined with node, section and concept index translation - # markers. Otherwise, incorrect sectioning may happen. Take - # care with index definitions, more than one index definition - # might be found in the section file but only the first - # concept index entry (i.e., `cindex') will be updated, the - # rest will remain as they are. - sed -i -r \ - -e '/^@node/c@node =NODE=' \ - -e '/^@section/c@section =SECT=' \ - -e '0,/^@cindex/c@cindex =CIND=' \ - "${MANUAL_BASEDIR_L10N}/$INCL" - - # Before expanding node, section and concept index, be sure - # that all slash characters (`/') be escaped. Otherwise, they - # might be interpreted as separators and that isn't - # desirable in anyway. - NODE=$(echo "$NODE" | sed -r 's/\//\\\//g') - SECT=$(echo "$SECT" | sed -r 's/\//\\\//g') - CIND=$(echo "$CIND" | sed -r 's/\//\\\//g') - - # Expand node, section and concept index translation - # markers in documentation entry. - sed -i -r \ - -e "s/=NODE=/${NODE}/g" \ - -e "s/=SECT=/${SECT}/g" \ - -e "s/=CIND=/${CIND}/g" \ - "${MANUAL_BASEDIR_L10N}/$INCL" - - # Verify existence of Chapter-nodes template file. If no - # Chapter-nodes template is found, stop script execution with - # an error message. We cannot continue without it. - cli_checkFiles -e ${MANUAL_TEMPLATE_L10N}/Chapters-nodes.${MANUAL_EXTENSION} - - # Expand chapter node inclusion definition. - cat ${MANUAL_TEMPLATE_L10N}/Chapters-nodes.${MANUAL_EXTENSION} \ - | sed -r "s!=INCL=!${INCL}!g" - - # Dump chapter node definition into manual structure. - done > ${NODEFILE} - -} diff --git a/Automation/Functions/Help/Texinfo/texinfo_updateStructureSection.sh b/Automation/Functions/Help/Texinfo/texinfo_updateStructureSection.sh deleted file mode 100755 index b9bd1d6..0000000 --- a/Automation/Functions/Help/Texinfo/texinfo_updateStructureSection.sh +++ /dev/null @@ -1,140 +0,0 @@ -#!/bin/bash -# -# texinfo_updateStructureSection.sh -- This function looks for all -# section entries (i.e., files holding section definitions) inside the -# manual's base directory and updates menu, nodes and cross references -# definitions for them all, one at a time. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function texinfo_updateStructureSection { - - local PATTERN="${1}" - - # Define regular expression pattern used to build list of section - # entries when pattern points to manual's file name or it is not - # provided at all. - if [[ $PATTERN =~ "${MANUAL_NAME}\.${MANUAL_EXTENSION}$" ]] \ - || [[ $PATTERN == '' ]]; then - PATTERN="/.+\.${MANUAL_EXTENSION}$" - fi - - local MANUAL_ENTRY='' - local MANUAL_ENTRIES='' - local ACTIONNAM_SECMENU='' - local ACTIONNAM_CROSREF='' - - # Define action to perform on menu, nodes and cross references - # definitions. - case "$2" in - - --delete ) - - # Remove menu and node definitions for sections inside - # manual, in order to reflect the changes. - ACTIONNAM_SECMENU='texinfo_updateSectionMenu --delete-entry' - - # Remove cross reference definitions inside manual - # structure. - ACTIONNAM_CROSREF='texinfo_deleteCrossReferences' - ;; - - --update | * ) - - # Update menu and node definitions for sections inside - # manual, in order to reflect the changes. - ACTIONNAM_SECMENU='texinfo_updateSectionMenu --add-entry' - - # Restore cross reference definitions inside manual - # structure. If a documentation entry has been removed by - # mistake and that mistake is later fixed by adding the - # removed documentation entry back into the manual - # structure, it is necessary to rebuild the missing cross - # reference information inside the manual structure in - # order to reactivate the removed cross references, as - # well. - ACTIONNAM_CROSREF='texinfo_restoreCrossReferences' - ;; - - esac - - # Define list of target entries using find's regular expression - # pattern as reference. Notice that, when we update section - # definition files, the files already exist in the working copy so - # the pattern can be its absolute path without any problem. If the - # pattern is built correctly, it will match the location and so be - # returned to build the list of entries to process. Notice also - # that, when updating, it is possible to use a regular expression - # to match more than one location and build the list of entries - # based on such matching. In this last configuration, let you to - # update menu, nodes and cross references to many section - # definitions (i.e., all those section definition file that match - # the pattern you specified). - MANUAL_ENTRIES=$(cli_getFilesList ${MANUAL_BASEDIR_L10N} \ - --pattern="${PATTERN}" --mindepth="2" --maxdepth="2") - - # Verify list of target entries. Assuming is is empty, define - # list of target documentation entries using pattern as reference - # instead. When we delete a section entry from the working copy, - # using find to retrieve its path isn't possible because the - # section definition file is removed before executing find and by - # consequence no match is found. This issue provokes no section - # entry to be removed from menu, nodes and cross references. In - # order to solve this, use the pattern value as list of target - # entries. Notice that, in this case, the pattern value must be - # the absolute path to that documentation entry which doesn't - # exist and we want to update menu, nodes and cross references - # information for. - if [[ $MANUAL_ENTRIES == '' ]] && [[ $PATTERN =~ '^/[[:alnum:]./_-]+$' ]];then - MANUAL_ENTRIES=${PATTERN} - fi - - # Verify list of target entries. Assuming it is still empty, there - # is nothing else to do here but printing an error message - # describing the fact that no section entry was found to process. - if [[ $MANUAL_ENTRIES == '' ]];then - cli_printMessage "`gettext "There wasn't any section for processing found."`" --as-error-line - fi - - # Loop through target documentation entries in order to update the - # documentation structure (e.g., it is not enough with copying - # documentation entry files, it is also needed to update menu, - # nodes and related cross-references). - for MANUAL_ENTRY in ${MANUAL_ENTRIES};do - - # Define menu file based on manual entry. We use the menu file - # as reference to build the nodes files and update the menu - # file itself based on available section files. - local MENUFILE=$(dirname ${MANUAL_ENTRY} \ - | sed -r 's,/$,,')-menu.${MANUAL_EXTENSION} - - # Don't print action name here. Instead, make it integral part - # of documentation entry creation process. - #cli_printMessage "${MANUAL_ENTRY}" --as-stdout-line - - ${ACTIONNAM_SECMENU} - texinfo_updateSectionNodes - texinfo_makeSeeAlso "${MANUAL_ENTRY}" - ${ACTIONNAM_CROSREF} "${MANUAL_ENTRY}" - - done - -} diff --git a/Automation/Functions/Help/help.sh b/Automation/Functions/Help/help.sh deleted file mode 100755 index 1d7df06..0000000 --- a/Automation/Functions/Help/help.sh +++ /dev/null @@ -1,213 +0,0 @@ -#!/bin/bash -# -# help.sh -- This function initializes the interface used by -# centos-art.sh script to perform documentation tasks through -# different documentation formats. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function help { - - # Initialize action name with an empty value. - local ACTIONNAM='' - - # Initialize search option (`--search'). This option is used to - # look for documentation inside documentation formats. - local FLAG_SEARCH="" - - # Initialize manual's language. - local MANUAL_L10N=${CLI_LANG_LC} - - # Initialize manuals' top-level directory. This is the place where - # source files for documentation manuals will be stored in. - local MANUAL_TLDIR="${TCAR_WORKDIR}/Documentation/Models" - - # Initialize documentation format. This information defines the - # kind of source files we work with inside the documentation - # manual as well as the kind of actions required by them to - # perform actions related to document management (e.g., creation, - # edition, deletion, copying, renaming, etc.). By default texinfo - # format is used. Other formats can be specified in the - # command-line using the `--format' option. - local FLAG_FORMAT='texinfo' - - # Initialize specific function export id. This value is redefined - # later once we know which is the documentation format. - local EXPORTID='' - - # Initialize documentation entries arrays. Arrays defined here - # contain all the information needed to process documentation - # entries (e.g., manual, part, chapter and section). - local -a MANUAL_SLFN - local -a MANUAL_DIRN - local -a MANUAL_PART - local -a MANUAL_CHAP - local -a MANUAL_SECT - - # Initialize documentation entries counter. - local MANUAL_DOCENTRY_COUNT=0 - local MANUAL_DOCENTRY_ID=0 - - # Interpret option arguments passed through the command-line. - help_getOptions - - # Redefine arrays related to documentation entries using - # non-option arguments passed through the command-line. At this - # point all options have been removed from ARGUMENTS and - # non-option arguments remain. Evaluate ARGUMENTS to retrieve the - # information related documentation entries from there. - help_getEntries - - # Execute format-specific documentation tasks for each - # documentation entry specified in the command-line, individually. - # Notice that we've stored all documentation entries passed as - # non-option arguments in array variables in order to process them - # now, one by one. This is particularly useful when we need to - # reach items in the array beyond the current iteration cycle. For - # example, when we perform actions that require source and target - # locations (e.g., copying and renaming): we use the current value - # as source location and the second value in the array as target - # location; both defined from the first iteration cycle. - while [[ $MANUAL_DOCENTRY_ID -lt $MANUAL_DOCENTRY_COUNT ]];do - - # Define name used by manual's main definition file. - MANUAL_NAME=${MANUAL_SLFN[${MANUAL_DOCENTRY_ID}]} - - # Define extension used by documentation manuals. The - # extension used must be the same passed in the format option. - MANUAL_EXTENSION=${FLAG_FORMAT} - - # Define absolute path to directory holding language-specific - # models. - MANUAL_BASEDIR="${MANUAL_TLDIR}/$(cli_getRepoName \ - ${MANUAL_EXTENSION} -d)/${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]}" - - # Define absolute path to directory holding language-specific - # source files. - MANUAL_BASEDIR_L10N="${MANUAL_BASEDIR}/${MANUAL_L10N}" - - # Define absolute path to changed directories inside the - # manual. For example, when a section entry is edited, copied - # or renamed inside the same manual there is only one - # absolute path to look for changes, the one holding the - # section entry. However, when an entire manual is renamed, - # there might be two different locations to look changes for, - # the source location deleted and the target location added. - MANUAL_CHANGED_DIRS="${MANUAL_BASEDIR_L10N}" - - # Define absolute path to base file. This is the main file - # name (without extension) we use as reference to build output - # files in different formats (.info, .pdf, .xml, etc.). - MANUAL_BASEFILE="${MANUAL_BASEDIR_L10N}/${MANUAL_NAME}" - - # Redefine function export id based on documentation format. - EXPORTID="${CLI_FUNCDIRNAM}/$(cli_getRepoName ${MANUAL_EXTENSION} -d)/${MANUAL_EXTENSION}" - - # Define manual base file used for output. - MANUAL_OUTPUT_BASEFILE=$(echo $MANUAL_BASEFILE | sed -r 's!Models/!Manuals/!') - - # Define manual's part name. - MANUAL_PART_NAME=${MANUAL_PART[${MANUAL_DOCENTRY_ID}]} - - # Define absolute path to manual's part directory. - MANUAL_PART_DIR="${MANUAL_BASEDIR_L10N}/${MANUAL_PART_NAME}" - - # Define manual's chapter name. - MANUAL_CHAPTER_NAME=${MANUAL_CHAP[${MANUAL_DOCENTRY_ID}]} - - # Define absolute path to chapter's directory. This is the - # place where chapter-specific files are stored in. Be sure no - # extra slash be present in the value (e.g., when the part - # name isn't provided). - MANUAL_CHAPTER_DIR="$(echo ${MANUAL_PART_DIR}/${MANUAL_CHAPTER_NAME} \ - | sed -r 's!/{2,}!/!g' | sed -r 's!/$!!' )" - - # Define section name. - MANUAL_SECTION_NAME=${MANUAL_SECT[${MANUAL_DOCENTRY_ID}]} - - # Define absolute path to manual's configuration file. This - # is the file that controls the way template files are applied - # to documentation entries once they have been created as well - # as the style and order used for printing sections. - MANUAL_CONFIG_FILE="${MANUAL_BASEFILE}.conf" - - # Notice that, because we are processing non-option arguments - # one by one, there is no need to synchronize changes or - # initialize functionalities to the same manual time after - # time (assuming all documentation entries passed as - # non-option arguments refer the same manual directory name). - # That would be only necessary when documentation entries - # refer to different manual directory names that could be - # written in different documentation formats. - if [[ ${MANUAL_DOCENTRY_ID} -eq 0 \ - || ( ( ${MANUAL_DOCENTRY_ID} -gt 0 ) && ( \ - ${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]} != ${MANUAL_DIRN[((${MANUAL_DOCENTRY_ID} - 1))]} ) ) ]];then - - # Synchronize changes between repository and working copy. - # At this point, changes in the repository are merged in - # the working copy and changes in the working copy - # committed up to repository. - if [[ -d ${MANUAL_CHANGED_DIRS} ]];then - cli_synchronizeRepoChanges "${MANUAL_CHANGED_DIRS}" - fi - - # Initialize documentation format functionalities. At - # this point we load all functionalities required into - # `centos-art.sh''s execution environment and make them - # available, this way, to perform format-specific - # documentation tasks. - cli_exportFunctions "${EXPORTID}" - - fi - - # Execute format-specific documentation tasks. - ${MANUAL_EXTENSION} - - # Unset the exported functions before go on with the next - # documentation entry provided as non-option argument to - # `centos-art.sh' script. Different documentation entries may - # be written in different documentation formats. Each - # documentation format is loaded in order to perform their - # related documentation tasks. Assuming more that one - # documentation entry be passed as non-option argument to - # `centos-art.sh' script and they are written in different - # formats, we might end up loading documentation format - # functionalities that aren't used in the current - # documentation entry being processed. In that sake, unset - # documentation back-end functionalities when the next - # documentation entry refers to a manual directory different - # to that one being currently processed. - if [[ ${MANUAL_DOCENTRY_ID} -gt 0 \ - && ${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]} != ${MANUAL_DIRN[((${MANUAL_DOCENTRY_ID} + 1))]} ]];then - cli_unsetFunctions "${EXPORTID}" - fi - - # Increment documentation entry counter id. - MANUAL_DOCENTRY_ID=$(($MANUAL_DOCENTRY_ID + 1)) - - done - - # Synchronize changes between repository and working copy. At this - # point, changes in the repository are merged in the working copy - # and changes in the working copy committed up to repository. - cli_synchronizeRepoChanges "${MANUAL_CHANGED_DIRS}" - -} diff --git a/Automation/Functions/Help/help_getEntries.sh b/Automation/Functions/Help/help_getEntries.sh deleted file mode 100755 index 56e1a92..0000000 --- a/Automation/Functions/Help/help_getEntries.sh +++ /dev/null @@ -1,125 +0,0 @@ -#!/bin/bash -# -# help_getEntries.sh -- This function interpretes non-option -# arguments passed to `help' functionality through the command-line -# and redefines array variables related to documentation entries. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function help_getEntries { - - # Initialize manual's documentation entry as an empty value local - # to this function. - local MANUAL_DOCENTRY='' - - # Redefine positional parameters using ARGUMENTS. At this point, - # option arguments have been removed from ARGUMENTS variable and - # only non-option arguments remain in it. - eval set -- "$ARGUMENTS" - - # Retrive documentation entries passed to `centos-art.sh' script - # as non-option arguments and store them in array variables in - # order to describe their parts (e.g., manual name, chapter name - # and section name) that way. Documentation entries passed as - # non-opiton arguments must be written either in - # `MANUAL:PART:CHAPTER:SECTION' or `path/to/dir' formats in order - # to be processed correctly here. Empty spaces are not permitted. - # To separate words, use the minus sign (e.g., hello-world) or - # cammel case (e.g., HelloWorld). - for MANUAL_DOCENTRY in $@;do - - if [[ ${MANUAL_DOCENTRY} =~ '^[[:alpha:]][[:alnum:]-]+:([[:alnum:]-]*:){2}[[:alnum:]/]*' ]];then - - # When `MANUAL:PART:CHAPTER:SECTION' is used as format to - # documentation entry, you can specify the manual, chapter - # and section where documentation actions will take place - # on. - - # Manual self name. - MANUAL_SLFN[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ - $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN { FS=":" } { print $1 }') -f \ - | tr '[:upper:]' '[:lower:]') - - # Manual self directory name. - MANUAL_DIRN[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ - $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN { FS=":" } { print $1 }') -d ) - - # Manual part name. - MANUAL_PART[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ - $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN { FS=":" } { print $2 }') -d ) - - # Manual chapter name. - MANUAL_CHAP[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ - $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN { FS=":" } { print $3 }') -d ) - - # Manual section name. - MANUAL_SECT[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ - $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN { FS=":" } { print $4 }' | tr '/' '-') -f ) - - elif [[ ${MANUAL_DOCENTRY} =~ "^(trunk|branches|tags)?(/)?($(ls ${TCAR_WORKDIR} \ - | tr '[[:space:]]' '|' | sed 's/|$//'))" ]];then - - # When we use the `path/to/dir' as format to reach - # documentation entries, you cannot specify the manual - # chapter or section where documentation actions will take - # place on. Instead, they are predefined for you here. Use - # this format to quickly document directories inside your - # working copy. - # - # When we use the `path/to/dir' format to reach - # documentation entries, there is a distinction between - # Subversion and Git version control system we need to be - # aware of. This is the directory structure layout used - # in the repository. In Subversion, we use a trunk/, - # branches/, tags/ layout as first level in the repository - # directory structure but, in Git, we don't need such - # special layout in the repository's first directory - # level. The script must be able to understand both - # directory structures. - - # Manual's self name. - MANUAL_SLFN[${MANUAL_DOCENTRY_COUNT}]='tcar-fs' - - # Manual's self directory name. - MANUAL_DIRN[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ - ${MANUAL_SLFN[${MANUAL_DOCENTRY_COUNT}]} -d) - - # Manual's chapter name. - MANUAL_CHAP[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ - $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN { FS="/" }; { if ( NF >= 1 ) print $1 }' ) -d ) - - # Manual's section name. - MANUAL_SECT[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ - $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN { FS="/" }; { if ( NF >= 2 ) print $0 }' \ - | cut -d/ -f2- | tr '/' '-') -f ) - - else - - cli_printMessage "`gettext "The documentation entry provided isn't supported."`" --as-error-line - - fi - - # Increment counting of non-option arguments. - MANUAL_DOCENTRY_COUNT=$(($MANUAL_DOCENTRY_COUNT + 1)) - - done - -} diff --git a/Automation/Functions/Help/help_getOptions.sh b/Automation/Functions/Help/help_getOptions.sh deleted file mode 100755 index 0ac28ec..0000000 --- a/Automation/Functions/Help/help_getOptions.sh +++ /dev/null @@ -1,138 +0,0 @@ -#!/bin/bash -# -# help_getOptions.sh -- This function interpretes option arguments -# passed to `help' functionality through the command-line and defines -# action names accordingly. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function help_getOptions { - - # Define short options we want to support. - local ARGSS="h,q" - - # Define long options we want to support. - local ARGSL="help,quiet,answer-yes,read,search:,format:,edit,update-output,update-structure,copy,delete,rename,synchronize" - - # Redefine ARGUMENTS using getopt(1) command parser. - cli_parseArguments - - # Reset positional parameters using output from (getopt) argument - # parser. - eval set -- "$ARGUMENTS" - - # Define action to take for each option passed. - while true; do - case "$1" in - - -h | --help ) - cli_runFnEnvironment help --read --format="texinfo" "tcar-fs::scripts:bash-functions-help" - shift 1 - exit - ;; - - -q | --quiet ) - FLAG_QUIET="true" - shift 1 - ;; - - --answer-yes ) - FLAG_ANSWER="true" - shift 1 - ;; - - --synchronize ) - FLAG_SYNCHRONIZE="true" - shift 1 - ;; - - --search ) - ACTIONNAM="searchIndex" - FLAG_SEARCH="$2" - shift 2 - ;; - - --format ) - FLAG_FORMAT=$(cli_getRepoName "$2" -f) - # Verify supported documentation manual formats. This - # is required in order to prevent building paths to - # non-existent documentation structures. - if [[ ! $FLAG_FORMAT =~ '^(texinfo)$' ]];then - cli_printMessage "`gettext "The documentation format provided is not supported."`" --as-error-line - fi - shift 2 - ;; - - --read ) - ACTIONNAM="searchNode" - shift 1 - ;; - - --edit ) - ACTIONNAM="editEntry" - shift 1 - ;; - - --copy ) - ACTIONNAM="copyEntry" - shift 1 - ;; - - --delete ) - ACTIONNAM="deleteEntry" - shift 1 - ;; - - --rename ) - ACTIONNAM="renameEntry" - shift 1 - ;; - - --update-output ) - ACTIONNAM="updateOutputFiles" - shift 1 - ;; - - --update-structure ) - ACTIONNAM="updateStructureSection" - shift 1 - ;; - - -- ) - # Remove the `--' argument from the list of arguments - # in order for processing non-option arguments - # correctly. At this point all option arguments have - # been processed already but the `--' argument still - # remains to mark ending of option arguments and - # beginning of non-option arguments. The `--' argument - # needs to be removed here in order to avoid - # centos-art.sh script to process it as a path inside - # the repository, which obviously is not. - shift 1 - break - ;; - esac - done - - # Redefine ARGUMENTS variable using current positional parameters. - cli_parseArgumentsReDef "$@" - -} diff --git a/Automation/Functions/Locale/locale.sh b/Automation/Functions/Locale/locale.sh deleted file mode 100755 index 58e2375..0000000 --- a/Automation/Functions/Locale/locale.sh +++ /dev/null @@ -1,101 +0,0 @@ -#!/bin/bash -# -# locale.sh -- This function provides internationalization features -# for centos-art.sh script through GNU gettext standard processes. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function locale { - - local ACTIONNAMS='' - local ACTIONNAM='' - local ACTIONVAL='' - - # Initialize machine object flag (`--dont-create-mo'). This flag - # controls whether the centos-art.sh script does create/update - # machine object (MO) files from related portable object (PO) - # files or not. By default, MO files are created. - local FLAG_DONT_CREATE_MO='false' - - # Define localization (l10n) base directory. This is the place - # where all translation messages are organized in. Translation - # messages are organized herein using the same layout of the - # components they represent under the `Identity', - # `Documentation/Manuals' or `Scripts' directory structures. The - # localization base directory must be used as source location for - # control version system operations (e.g., status, update, commit, - # etc.). Otherwise, it would be difficult to add directory - # structures that have several levels down from the localization - # base directory up to the repository (e.g., - # subversion-1.4.2-4.el5_3.1.i386.rpm doesn't support recursive - # creation of directories which parent directories doesn't - # exist.). - local L10N_BASEDIR="${TCAR_WORKDIR}/Locales" - - # Verify current locale information to avoid English messages from - # being localized to themselves. The English language is used as - # reference to write translatable strings inside the source files. - if [[ ${CLI_LANG_LC} =~ '^en' ]];then - cli_printMessage "`gettext "The English language cannot be localized to itself."`" --as-error-line - fi - - # Interpret arguments and options passed through command-line. - locale_getOptions - - # Redefine positional parameters using ARGUMENTS. At this point, - # option arguments have been removed from ARGUMENTS variable and - # only non-option arguments remain in it. - eval set -- "${ARGUMENTS}" - - # Loop through non-option arguments passed to centos-art.sh script - # through its command-line. - for ACTIONVAL in "$@";do - - # Don't call locale_isLocalizable function here. Remember that - # this function (i.e., locale) is called from other functions - # using the cli_runFnEnvironment function to determine whether - # a location can accept or not localized messages. If you put - # the locale_isLocalizable function here, you would be - # duplicating its execution. - - # Sanitate non-option arguments to be sure they match the - # directory conventions established by centos-art.sh script - # against source directory locations in the working copy. - ACTIONVAL=$(cli_checkRepoDirSource ${ACTIONVAL}) - - # Verify non-option arguments passed to centos-art.sh - # command-line. It should point to an existent directory under - # version control inside the working copy. Otherwise, if it - # doesn't point to a directory under version control, finish - # the script execution with an error message. - cli_checkFiles ${ACTIONVAL} -d --is-versioned - - # Execute localization actions provided to centos-art.sh - # script through its command-line. Notice that localization - # actions will be executed in the same order they were - # provided in the command-line. - for ACTIONNAM in ${ACTIONNAMS};do - ${ACTIONNAM} - done - - done - -} diff --git a/Automation/Functions/Locale/locale_combineLicenseMessages.sh b/Automation/Functions/Locale/locale_combineLicenseMessages.sh deleted file mode 100755 index 2e9868d..0000000 --- a/Automation/Functions/Locale/locale_combineLicenseMessages.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -# -# locale_combineLicenseMessages.sh -- This function combines template -# messages with license messages. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function locale_combineLicenseMessages { - - if [[ $# -lt 1 ]];then - cli_printMessage "`gettext "One argument is required."`" --as-error-message - fi - - local TRANSLATION_INSTANCE=$1 - local TRANSLATION_TEMPLATE=$2 - - local DOCBOOK_LOCALES=$(echo $DOCBOOK_MODELS \ - | sed -r "s!${TCAR_WORKDIR}/!${TCAR_WORKDIR}/Locales/!") - - # Define list of all files you want to combine. - local FILES="${DOCBOOK_LOCALES}/${CLI_LANG_LC}/messages.po \ - ${DOCBOOK_LOCALES}/${CLI_LANG_LC}/messages.po \ - ${TRANSLATION_TEMPLATE}" - - # Be sure the files we want to combine do exist. - cli_checkFiles -e ${FILES} - - # Combine files. - msgcat --output=${TRANSLATION_INSTANCE} \ - --width=70 --no-location --use-first ${FILES} - -} diff --git a/Automation/Functions/Locale/locale_deleteMessages.sh b/Automation/Functions/Locale/locale_deleteMessages.sh deleted file mode 100755 index 6956257..0000000 --- a/Automation/Functions/Locale/locale_deleteMessages.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -# -# locale_deleteMessages.sh -- This function deletes the source files' -# localization directory from the working copy in conjunction with all -# portable objects and machine objects inside it. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function locale_deleteMessages { - - # Print separator line. - cli_printMessage '-' --as-separator-line - - # Print action message. - cli_printMessage "$L10N_WORKDIR" --as-deleting-line - - # Verify existence of localization working directory. We cannot - # remove translation files that don't exist. - cli_checkFiles -e "$L10N_WORKDIR" - - # Delete localization working directory using subversion quietly. - ${SVN} del "$L10N_WORKDIR" --quiet - -} diff --git a/Automation/Functions/Locale/locale_editMessages.sh b/Automation/Functions/Locale/locale_editMessages.sh deleted file mode 100755 index 5b942ee..0000000 --- a/Automation/Functions/Locale/locale_editMessages.sh +++ /dev/null @@ -1,97 +0,0 @@ -#!/bin/bash -# -# locale_editMessages.sh -- This function edits portable objects (.po) -# using default text editor. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function locale_editMessages { - - # Verify directory passed as non-option argument to be sure it - # supports localization. - locale_isLocalizable "${ACTIONVAL}" - - local PO_FILE='' - local PO_FILES='' - - # Define location where translation files will be stored in - # without language information in it. The language information is - # put later, when we build the list of files. - local L10N_WORKDIR=$(cli_getLocalizationDir "${ACTIONVAL}" "--no-lang") - - # Prepare working directory to receive translation files. Don't do - # this here. It is already done as part the update actions, but we - # need it here for those cases when no update action is run and - # one execute the edit option. - locale_prepareWorkingDirectory ${L10N_WORKDIR} - - # Define list of PO files to process based on paths provided as - # non-option arguments through centos-art.sh script command-line. - if [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/(Documentation/Models/(Docbook|Svg)|Identity/Models)/.*$" ]];then - - # Do not create MO files for XML-based files. - FLAG_DONT_CREATE_MO='true' - - fi - - # Define list of PO files we want to work with. Don't forget to - # include the language information here. - PO_FILES=$(cli_getFilesList ${L10N_WORKDIR} --type="f" \ - --pattern=".+/${FLAG_FILTER}/${CLI_LANG_LC}/messages\.po$") - - # Verify list of PO files. - if [[ $PO_FILES = "" ]];then - cli_printMessage "`gettext "The path provided hasn't translations yet."`" --as-error-line - else - cli_printMessage '-' --as-separator-line - fi - - # Synchronize changes between repository and working copy. At this - # point, changes in the repository are merged in the working copy - # and changes in the working copy committed up to repository. - cli_synchronizeRepoChanges "${PO_FILES}" - - # Loop through list of PO files to process in order to edit them - # one by one using user's default text editor. - for PO_FILE in ${PO_FILES};do - - # Print the file we are editing. - cli_printMessage "${PO_FILE}" --as-updating-line - - # Use default text editor to edit the PO file. - eval ${EDITOR} ${PO_FILE} - - done - - # At this point some changes might be realized inside the PO file, - # so we need to update the related MO file based on recently - # updated PO files here in order for `centos-art.sh' script to - # print out the most up to date revision of localized messages. - # Notice that this is required only if we were localizing shell - # scripts. - locale_updateMessageBinary - - # Synchronize changes between repository and working copy. At this - # point, changes in the repository are merged in the working copy - # and changes in the working copy committed up to repository. - cli_synchronizeRepoChanges "${PO_FILES}" - -} diff --git a/Automation/Functions/Locale/locale_getCountryName.sh b/Automation/Functions/Locale/locale_getCountryName.sh deleted file mode 100755 index 874ae24..0000000 --- a/Automation/Functions/Locale/locale_getCountryName.sh +++ /dev/null @@ -1,754 +0,0 @@ -#!/bin/bash -# -# locale_getLanguageName.sh -- This function takes the environment -# country code as reference and outputs the related country name. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function locale_getCountryName { - - local COUNTRYNAME="`gettext "Unknown"`" - - case ${CLI_LANG_CC} in - - 'AD' ) - COUNTRYNAME="`gettext "Andorra"`" - ;; - 'AE' ) - COUNTRYNAME="`gettext "United Arab Emirates"`" - ;; - 'AF' ) - COUNTRYNAME="`gettext "Afghanistan"`" - ;; - 'AG' ) - COUNTRYNAME="`gettext "Antigua and Barbuda"`" - ;; - 'AI' ) - COUNTRYNAME="`gettext "Anguilla"`" - ;; - 'AL' ) - COUNTRYNAME="`gettext "Albania"`" - ;; - 'AM' ) - COUNTRYNAME="`gettext "Armenia"`" - ;; - 'AN' ) - COUNTRYNAME="`gettext "Netherlands Antilles"`" - ;; - 'AO' ) - COUNTRYNAME="`gettext "Angola"`" - ;; - 'AQ' ) - COUNTRYNAME="`gettext "Antarctica"`" - ;; - 'AR' ) - COUNTRYNAME="`gettext "Argentina"`" - ;; - 'AS' ) - COUNTRYNAME="`gettext "Samoa (American)"`" - ;; - 'AT' ) - COUNTRYNAME="`gettext "Austria"`" - ;; - 'AU' ) - COUNTRYNAME="`gettext "Australia"`" - ;; - 'AW' ) - COUNTRYNAME="`gettext "Aruba"`" - ;; - 'AZ' ) - COUNTRYNAME="`gettext "Azerbaijan"`" - ;; - 'BA' ) - COUNTRYNAME="`gettext "Bosnia and Herzegovina"`" - ;; - 'BB' ) - COUNTRYNAME="`gettext "Barbados"`" - ;; - 'BD' ) - COUNTRYNAME="`gettext "Bangladesh"`" - ;; - 'BE' ) - COUNTRYNAME="`gettext "Belgium"`" - ;; - 'BF' ) - COUNTRYNAME="`gettext "Burkina Faso"`" - ;; - 'BG' ) - COUNTRYNAME="`gettext "Bulgaria"`" - ;; - 'BH' ) - COUNTRYNAME="`gettext "Bahrain"`" - ;; - 'BI' ) - COUNTRYNAME="`gettext "Burundi"`" - ;; - 'BJ' ) - COUNTRYNAME="`gettext "Benin"`" - ;; - 'BM' ) - COUNTRYNAME="`gettext "Bermuda"`" - ;; - 'BN' ) - COUNTRYNAME="`gettext "Brunei"`" - ;; - 'BO' ) - COUNTRYNAME="`gettext "Bolivia"`" - ;; - 'BR' ) - COUNTRYNAME="`gettext "Brazil"`" - ;; - 'BS' ) - COUNTRYNAME="`gettext "Bahamas"`" - ;; - 'BT' ) - COUNTRYNAME="`gettext "Bhutan"`" - ;; - 'BV' ) - COUNTRYNAME="`gettext "Bouvet Island"`" - ;; - 'BW' ) - COUNTRYNAME="`gettext "Botswana"`" - ;; - 'BY' ) - COUNTRYNAME="`gettext "Belarus"`" - ;; - 'BZ' ) - COUNTRYNAME="`gettext "Belize"`" - ;; - 'CA' ) - COUNTRYNAME="`gettext "Canada"`" - ;; - 'CC' ) - COUNTRYNAME="`gettext "Cocos (Keeling) Islands"`" - ;; - 'CD' ) - COUNTRYNAME="`gettext "Congo (Dem. Rep.)"`" - ;; - 'CF' ) - COUNTRYNAME="`gettext "Central African Rep."`" - ;; - 'CG' ) - COUNTRYNAME="`gettext "Congo (Rep.)"`" - ;; - 'CH' ) - COUNTRYNAME="`gettext "Switzerland"`" - ;; - 'CI' ) - COUNTRYNAME="`gettext "Co^te d'Ivoire"`" - ;; - 'CK' ) - COUNTRYNAME="`gettext "Cook Islands"`" - ;; - 'CL' ) - COUNTRYNAME="`gettext "Chile"`" - ;; - 'CM' ) - COUNTRYNAME="`gettext "Cameroon"`" - ;; - 'CN' ) - COUNTRYNAME="`gettext "China"`" - ;; - 'CO' ) - COUNTRYNAME="`gettext "Colombia"`" - ;; - 'CR' ) - COUNTRYNAME="`gettext "Costa Rica"`" - ;; - 'CS' ) - COUNTRYNAME="`gettext "Serbia and Montenegro"`" - ;; - 'CU' ) - COUNTRYNAME="`gettext "Cuba"`" - ;; - 'CV' ) - COUNTRYNAME="`gettext "Cape Verde"`" - ;; - 'CX' ) - COUNTRYNAME="`gettext "Christmas Island"`" - ;; - 'CY' ) - COUNTRYNAME="`gettext "Cyprus"`" - ;; - 'CZ' ) - COUNTRYNAME="`gettext "Czech Republic"`" - ;; - 'DE' ) - COUNTRYNAME="`gettext "Germany"`" - ;; - 'DJ' ) - COUNTRYNAME="`gettext "Djibouti"`" - ;; - 'DK' ) - COUNTRYNAME="`gettext "Denmark"`" - ;; - 'DM' ) - COUNTRYNAME="`gettext "Dominica"`" - ;; - 'DO' ) - COUNTRYNAME="`gettext "Dominican Republic"`" - ;; - 'DZ' ) - COUNTRYNAME="`gettext "Algeria"`" - ;; - 'EC' ) - COUNTRYNAME="`gettext "Ecuador"`" - ;; - 'EE' ) - COUNTRYNAME="`gettext "Estonia"`" - ;; - 'EG' ) - COUNTRYNAME="`gettext "Egypt"`" - ;; - 'EH' ) - COUNTRYNAME="`gettext "Western Sahara"`" - ;; - 'ER' ) - COUNTRYNAME="`gettext "Eritrea"`" - ;; - 'ES' ) - COUNTRYNAME="`gettext "Spain"`" - ;; - 'ET' ) - COUNTRYNAME="`gettext "Ethiopia"`" - ;; - 'FI' ) - COUNTRYNAME="`gettext "Finland"`" - ;; - 'FJ' ) - COUNTRYNAME="`gettext "Fiji"`" - ;; - 'FK' ) - COUNTRYNAME="`gettext "Falkland Islands"`" - ;; - 'FM' ) - COUNTRYNAME="`gettext "Micronesia"`" - ;; - 'FO' ) - COUNTRYNAME="`gettext "Faeroe Islands"`" - ;; - 'FR' ) - COUNTRYNAME="`gettext "France"`" - ;; - 'GA' ) - COUNTRYNAME="`gettext "Gabon"`" - ;; - 'GB' ) - COUNTRYNAME="`gettext "Britain (UK)"`" - ;; - 'GD' ) - COUNTRYNAME="`gettext "Grenada"`" - ;; - 'GE' ) - COUNTRYNAME="`gettext "Georgia"`" - ;; - 'GF' ) - COUNTRYNAME="`gettext "French Guiana"`" - ;; - 'GH' ) - COUNTRYNAME="`gettext "Ghana"`" - ;; - 'GI' ) - COUNTRYNAME="`gettext "Gibraltar"`" - ;; - 'GL' ) - COUNTRYNAME="`gettext "Greenland"`" - ;; - 'GM' ) - COUNTRYNAME="`gettext "Gambia"`" - ;; - 'GN' ) - COUNTRYNAME="`gettext "Guinea"`" - ;; - 'GP' ) - COUNTRYNAME="`gettext "Guadeloupe"`" - ;; - 'GQ' ) - COUNTRYNAME="`gettext "Equatorial Guinea"`" - ;; - 'GR' ) - COUNTRYNAME="`gettext "Greece"`" - ;; - 'GS' ) - COUNTRYNAME="`gettext "South Georgia and the South Sandwich Islands"`" - ;; - 'GT' ) - COUNTRYNAME="`gettext "Guatemala"`" - ;; - 'GU' ) - COUNTRYNAME="`gettext "Guam"`" - ;; - 'GW' ) - COUNTRYNAME="`gettext "Guinea-Bissau"`" - ;; - 'GY' ) - COUNTRYNAME="`gettext "Guyana"`" - ;; - 'HK' ) - COUNTRYNAME="`gettext "Hong Kong"`" - ;; - 'HM' ) - COUNTRYNAME="`gettext "Heard Island and McDonald Islands"`" - ;; - 'HN' ) - COUNTRYNAME="`gettext "Honduras"`" - ;; - 'HR' ) - COUNTRYNAME="`gettext "Croatia"`" - ;; - 'HT' ) - COUNTRYNAME="`gettext "Haiti"`" - ;; - 'HU' ) - COUNTRYNAME="`gettext "Hungary"`" - ;; - 'ID' ) - COUNTRYNAME="`gettext "Indonesia"`" - ;; - 'IE' ) - COUNTRYNAME="`gettext "Ireland"`" - ;; - 'IL' ) - COUNTRYNAME="`gettext "Israel"`" - ;; - 'IN' ) - COUNTRYNAME="`gettext "India"`" - ;; - 'IO' ) - COUNTRYNAME="`gettext "British Indian Ocean Territory"`" - ;; - 'IQ' ) - COUNTRYNAME="`gettext "Iraq"`" - ;; - 'IR' ) - COUNTRYNAME="`gettext "Iran"`" - ;; - 'IS' ) - COUNTRYNAME="`gettext "Iceland"`" - ;; - 'IT' ) - COUNTRYNAME="`gettext "Italy"`" - ;; - 'JM' ) - COUNTRYNAME="`gettext "Jamaica"`" - ;; - 'JO' ) - COUNTRYNAME="`gettext "Jordan"`" - ;; - 'JP' ) - COUNTRYNAME="`gettext "Japan"`" - ;; - 'KE' ) - COUNTRYNAME="`gettext "Kenya"`" - ;; - 'KG' ) - COUNTRYNAME="`gettext "Kyrgyzstan"`" - ;; - 'KH' ) - COUNTRYNAME="`gettext "Cambodia"`" - ;; - 'KI' ) - COUNTRYNAME="`gettext "Kiribati"`" - ;; - 'KM' ) - COUNTRYNAME="`gettext "Comoros"`" - ;; - 'KN' ) - COUNTRYNAME="`gettext "St Kitts and Nevis"`" - ;; - 'KP' ) - COUNTRYNAME="`gettext "Korea (North)"`" - ;; - 'KR' ) - COUNTRYNAME="`gettext "Korea (South)"`" - ;; - 'KW' ) - COUNTRYNAME="`gettext "Kuwait"`" - ;; - 'KY' ) - COUNTRYNAME="`gettext "Cayman Islands"`" - ;; - 'KZ' ) - COUNTRYNAME="`gettext "Kazakhstan"`" - ;; - 'LA' ) - COUNTRYNAME="`gettext "Laos"`" - ;; - 'LB' ) - COUNTRYNAME="`gettext "Lebanon"`" - ;; - 'LC' ) - COUNTRYNAME="`gettext "St Lucia"`" - ;; - 'LI' ) - COUNTRYNAME="`gettext "Liechtenstein"`" - ;; - 'LK' ) - COUNTRYNAME="`gettext "Sri Lanka"`" - ;; - 'LR' ) - COUNTRYNAME="`gettext "Liberia"`" - ;; - 'LS' ) - COUNTRYNAME="`gettext "Lesotho"`" - ;; - 'LT' ) - COUNTRYNAME="`gettext "Lithuania"`" - ;; - 'LU' ) - COUNTRYNAME="`gettext "Luxembourg"`" - ;; - 'LV' ) - COUNTRYNAME="`gettext "Latvia"`" - ;; - 'LY' ) - COUNTRYNAME="`gettext "Libya"`" - ;; - 'MA' ) - COUNTRYNAME="`gettext "Morocco"`" - ;; - 'MC' ) - COUNTRYNAME="`gettext "Monaco"`" - ;; - 'MD' ) - COUNTRYNAME="`gettext "Moldova"`" - ;; - 'MG' ) - COUNTRYNAME="`gettext "Madagascar"`" - ;; - 'MH' ) - COUNTRYNAME="`gettext "Marshall Islands"`" - ;; - 'MK' ) - COUNTRYNAME="`gettext "Macedonia"`" - ;; - 'ML' ) - COUNTRYNAME="`gettext "Mali"`" - ;; - 'MM' ) - COUNTRYNAME="`gettext "Myanmar (Burma)"`" - ;; - 'MN' ) - COUNTRYNAME="`gettext "Mongolia"`" - ;; - 'MO' ) - COUNTRYNAME="`gettext "Macao"`" - ;; - 'MP' ) - COUNTRYNAME="`gettext "Northern Mariana Islands"`" - ;; - 'MQ' ) - COUNTRYNAME="`gettext "Martinique"`" - ;; - 'MR' ) - COUNTRYNAME="`gettext "Mauritania"`" - ;; - 'MS' ) - COUNTRYNAME="`gettext "Montserrat"`" - ;; - 'MT' ) - COUNTRYNAME="`gettext "Malta"`" - ;; - 'MU' ) - COUNTRYNAME="`gettext "Mauritius"`" - ;; - 'MV' ) - COUNTRYNAME="`gettext "Maldives"`" - ;; - 'MW' ) - COUNTRYNAME="`gettext "Malawi"`" - ;; - 'MX' ) - COUNTRYNAME="`gettext "Mexico"`" - ;; - 'MY' ) - COUNTRYNAME="`gettext "Malaysia"`" - ;; - 'MZ' ) - COUNTRYNAME="`gettext "Mozambique"`" - ;; - 'NA' ) - COUNTRYNAME="`gettext "Namibia"`" - ;; - 'NC' ) - COUNTRYNAME="`gettext "New Caledonia"`" - ;; - 'NE' ) - COUNTRYNAME="`gettext "Niger"`" - ;; - 'NF' ) - COUNTRYNAME="`gettext "Norfolk Island"`" - ;; - 'NG' ) - COUNTRYNAME="`gettext "Nigeria"`" - ;; - 'NI' ) - COUNTRYNAME="`gettext "Nicaragua"`" - ;; - 'NL' ) - COUNTRYNAME="`gettext "Netherlands"`" - ;; - 'NO' ) - COUNTRYNAME="`gettext "Norway"`" - ;; - 'NP' ) - COUNTRYNAME="`gettext "Nepal"`" - ;; - 'NR' ) - COUNTRYNAME="`gettext "Nauru"`" - ;; - 'NU' ) - COUNTRYNAME="`gettext "Niue"`" - ;; - 'NZ' ) - COUNTRYNAME="`gettext "New Zealand"`" - ;; - 'OM' ) - COUNTRYNAME="`gettext "Oman"`" - ;; - 'PA' ) - COUNTRYNAME="`gettext "Panama"`" - ;; - 'PE' ) - COUNTRYNAME="`gettext "Peru"`" - ;; - 'PF' ) - COUNTRYNAME="`gettext "French Polynesia"`" - ;; - 'PG' ) - COUNTRYNAME="`gettext "Papua New Guinea"`" - ;; - 'PH' ) - COUNTRYNAME="`gettext "Philippines"`" - ;; - 'PK' ) - COUNTRYNAME="`gettext "Pakistan"`" - ;; - 'PL' ) - COUNTRYNAME="`gettext "Poland"`" - ;; - 'PM' ) - COUNTRYNAME="`gettext "St Pierre and Miquelon"`" - ;; - 'PN' ) - COUNTRYNAME="`gettext "Pitcairn"`" - ;; - 'PR' ) - COUNTRYNAME="`gettext "Puerto Rico"`" - ;; - 'PS' ) - COUNTRYNAME="`gettext "Palestine"`" - ;; - 'PT' ) - COUNTRYNAME="`gettext "Portugal"`" - ;; - 'PW' ) - COUNTRYNAME="`gettext "Palau"`" - ;; - 'PY' ) - COUNTRYNAME="`gettext "Paraguay"`" - ;; - 'QA' ) - COUNTRYNAME="`gettext "Qatar"`" - ;; - 'RE' ) - COUNTRYNAME="`gettext "Reunion"`" - ;; - 'RO' ) - COUNTRYNAME="`gettext "Romania"`" - ;; - 'RU' ) - COUNTRYNAME="`gettext "Russia"`" - ;; - 'RW' ) - COUNTRYNAME="`gettext "Rwanda"`" - ;; - 'SA' ) - COUNTRYNAME="`gettext "Saudi Arabia"`" - ;; - 'SB' ) - COUNTRYNAME="`gettext "Solomon Islands"`" - ;; - 'SC' ) - COUNTRYNAME="`gettext "Seychelles"`" - ;; - 'SD' ) - COUNTRYNAME="`gettext "Sudan"`" - ;; - 'SE' ) - COUNTRYNAME="`gettext "Sweden"`" - ;; - 'SG' ) - COUNTRYNAME="`gettext "Singapore"`" - ;; - 'SH' ) - COUNTRYNAME="`gettext "St Helena"`" - ;; - 'SI' ) - COUNTRYNAME="`gettext "Slovenia"`" - ;; - 'SJ' ) - COUNTRYNAME="`gettext "Svalbard and Jan Mayen"`" - ;; - 'SK' ) - COUNTRYNAME="`gettext "Slovakia"`" - ;; - 'SL' ) - COUNTRYNAME="`gettext "Sierra Leone"`" - ;; - 'SM' ) - COUNTRYNAME="`gettext "San Marino"`" - ;; - 'SN' ) - COUNTRYNAME="`gettext "Senegal"`" - ;; - 'SO' ) - COUNTRYNAME="`gettext "Somalia"`" - ;; - 'SR' ) - COUNTRYNAME="`gettext "Suriname"`" - ;; - 'ST' ) - COUNTRYNAME="`gettext "Sao Tome and Principe"`" - ;; - 'SV' ) - COUNTRYNAME="`gettext "El Salvador"`" - ;; - 'SY' ) - COUNTRYNAME="`gettext "Syria"`" - ;; - 'SZ' ) - COUNTRYNAME="`gettext "Swaziland"`" - ;; - 'TC' ) - COUNTRYNAME="`gettext "Turks and Caicos Islands"`" - ;; - 'TD' ) - COUNTRYNAME="`gettext "Chad"`" - ;; - 'TF' ) - COUNTRYNAME="`gettext "French Southern and Antarctic Lands"`" - ;; - 'TG' ) - COUNTRYNAME="`gettext "Togo"`" - ;; - 'TH' ) - COUNTRYNAME="`gettext "Thailand"`" - ;; - 'TJ' ) - COUNTRYNAME="`gettext "Tajikistan"`" - ;; - 'TK' ) - COUNTRYNAME="`gettext "Tokelau"`" - ;; - 'TL' ) - COUNTRYNAME="`gettext "Timor-Leste"`" - ;; - 'TM' ) - COUNTRYNAME="`gettext "Turkmenistan"`" - ;; - 'TN' ) - COUNTRYNAME="`gettext "Tunisia"`" - ;; - 'TO' ) - COUNTRYNAME="`gettext "Tonga"`" - ;; - 'TR' ) - COUNTRYNAME="`gettext "Turkey"`" - ;; - 'TT' ) - COUNTRYNAME="`gettext "Trinidad and Tobago"`" - ;; - 'TV' ) - COUNTRYNAME="`gettext "Tuvalu"`" - ;; - 'TW' ) - COUNTRYNAME="`gettext "Taiwan"`" - ;; - 'TZ' ) - COUNTRYNAME="`gettext "Tanzania"`" - ;; - 'UA' ) - COUNTRYNAME="`gettext "Ukraine"`" - ;; - 'UG' ) - COUNTRYNAME="`gettext "Uganda"`" - ;; - 'UM' ) - COUNTRYNAME="`gettext "US minor outlying islands"`" - ;; - 'US' ) - COUNTRYNAME="`gettext "United States"`" - ;; - 'UY' ) - COUNTRYNAME="`gettext "Uruguay"`" - ;; - 'UZ' ) - COUNTRYNAME="`gettext "Uzbekistan"`" - ;; - 'VA' ) - COUNTRYNAME="`gettext "Vatican City"`" - ;; - 'VC' ) - COUNTRYNAME="`gettext "St Vincent"`" - ;; - 'VE' ) - COUNTRYNAME="`gettext "Venezuela"`" - ;; - 'VG' ) - COUNTRYNAME="`gettext "Virgin Islands (UK)"`" - ;; - 'VI' ) - COUNTRYNAME="`gettext "Virgin Islands (US)"`" - ;; - 'VN' ) - COUNTRYNAME="`gettext "Vietnam"`" - ;; - 'VU' ) - COUNTRYNAME="`gettext "Vanuatu"`" - ;; - 'WF' ) - COUNTRYNAME="`gettext "Wallis and Futuna"`" - ;; - 'WS' ) - COUNTRYNAME="`gettext "Samoa (Western)"`" - ;; - 'YE' ) - COUNTRYNAME="`gettext "Yemen"`" - ;; - 'YT' ) - COUNTRYNAME="`gettext "Mayotte"`" - ;; - 'ZA' ) - COUNTRYNAME="`gettext "South Africa"`" - ;; - 'ZM' ) - COUNTRYNAME="`gettext "Zambia"`" - ;; - 'ZW' ) - COUNTRYNAME="`gettext "Zimbabwe"`" - ;; - - esac - - echo $COUNTRYNAME - -} diff --git a/Automation/Functions/Locale/locale_getLanguageName.sh b/Automation/Functions/Locale/locale_getLanguageName.sh deleted file mode 100755 index 9872fab..0000000 --- a/Automation/Functions/Locale/locale_getLanguageName.sh +++ /dev/null @@ -1,776 +0,0 @@ -#!/bin/bash -# -# locale_getLanguageName.sh -- This function takes the environment -# language code as reference and outputs the related language name. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function locale_getLanguageName { - - local LANGNAME="`gettext "Unknown"`" - - case ${CLI_LANG_LL} in - - 'aa' ) - LANGNAME="`gettext "Afar"`" - ;; - - 'ab' ) - LANGNAME="`gettext "Abkhazian"`" - ;; - - 'ae' ) - LANGNAME="`gettext "Avestan"`" - ;; - - 'af' ) - LANGNAME="`gettext "Afrikaans"`" - ;; - - 'ak' ) - LANGNAME="`gettext "Akan"`" - ;; - - 'am' ) - LANGNAME="`gettext "Amharic"`" - ;; - - 'an' ) - LANGNAME="`gettext "Aragonese"`" - ;; - - 'ar' ) - LANGNAME="`gettext "Arabic"`" - ;; - - 'as' ) - LANGNAME="`gettext "Assamese"`" - ;; - - 'av' ) - LANGNAME="`gettext "Avaric"`" - ;; - - 'ay' ) - LANGNAME="`gettext "Aymara"`" - ;; - - 'az' ) - LANGNAME="`gettext "Azerbaijani"`" - ;; - - 'ba' ) - LANGNAME="`gettext "Bashkir"`" - ;; - - 'be' ) - LANGNAME="`gettext "Byelorussian"`" - ;; - - 'bg' ) - LANGNAME="`gettext "Bulgarian"`" - ;; - - 'bh' ) - LANGNAME="`gettext "Bihari"`" - ;; - - 'bi' ) - LANGNAME="`gettext "Bislama"`" - ;; - - 'bm' ) - LANGNAME="`gettext "Bambara"`" - ;; - - 'bn' ) - LANGNAME="`gettext "Bengali"`" - ;; - - 'bo' ) - LANGNAME="`gettext "Tibetan"`" - ;; - - 'br' ) - LANGNAME="`gettext "Breton"`" - ;; - - 'bs' ) - LANGNAME="`gettext "Bosnian"`" - ;; - - 'ca' ) - LANGNAME="`gettext "Catalan"`" - ;; - - 'ce' ) - LANGNAME="`gettext "Chechen"`" - ;; - - 'ch' ) - LANGNAME="`gettext "Chamorro"`" - ;; - - 'co' ) - LANGNAME="`gettext "Corsican"`" - ;; - - 'cr' ) - LANGNAME="`gettext "Cree"`" - ;; - - 'cs' ) - LANGNAME="`gettext "Czech"`" - ;; - - 'cu' ) - LANGNAME="`gettext "Church Slavic"`" - ;; - - 'cv' ) - LANGNAME="`gettext "Chuvash"`" - ;; - - 'cy' ) - LANGNAME="`gettext "Welsh"`" - ;; - - 'da' ) - LANGNAME="`gettext "Danish"`" - ;; - - 'de' ) - LANGNAME="`gettext "German"`" - ;; - - 'dv' ) - LANGNAME="`gettext "Divehi"`" - ;; - - 'dz' ) - LANGNAME="`gettext "Dzongkha"`" - ;; - - 'ee' ) - LANGNAME="`gettext "E'we"`" - ;; - - 'el' ) - LANGNAME="`gettext "Greek"`" - ;; - - 'en' ) - LANGNAME="`gettext "English"`" - ;; - - 'eo' ) - LANGNAME="`gettext "Esperanto"`" - ;; - - 'es' ) - LANGNAME="`gettext "Spanish"`" - ;; - - 'et' ) - LANGNAME="`gettext "Estonian"`" - ;; - - 'eu' ) - LANGNAME="`gettext "Basque"`" - ;; - 'fa' ) - LANGNAME="`gettext "Persian"`" - ;; - - 'ff' ) - LANGNAME="`gettext "Fulah"`" - ;; - - 'fi' ) - LANGNAME="`gettext "Finnish"`" - ;; - - 'fj' ) - LANGNAME="`gettext "Fijian"`" - ;; - - 'fo' ) - LANGNAME="`gettext "Faroese"`" - ;; - - 'fr' ) - LANGNAME="`gettext "French"`" - ;; - - 'fy' ) - LANGNAME="`gettext "Frisian"`" - ;; - - 'ga' ) - LANGNAME="`gettext "Irish"`" - ;; - - 'gd' ) - LANGNAME="`gettext "Scots"`" - ;; - - 'gl' ) - LANGNAME="`gettext "Gallegan"`" - ;; - - 'gn' ) - LANGNAME="`gettext "Guarani"`" - ;; - - 'gu' ) - LANGNAME="`gettext "Gujarati"`" - ;; - - 'gv' ) - LANGNAME="`gettext "Manx"`" - ;; - - 'ha' ) - LANGNAME="`gettext "Hausa"`" - ;; - - 'he' ) - LANGNAME="`gettext "Hebrew"`" - ;; - - 'hi' ) - LANGNAME="`gettext "Hindi"`" - ;; - - 'ho' ) - LANGNAME="`gettext "Hiri Motu"`" - ;; - - 'hr' ) - LANGNAME="`gettext "Croatian"`" - ;; - - 'ht' ) - LANGNAME="`gettext "Haitian"`" - ;; - - 'hu' ) - LANGNAME="`gettext "Hungarian"`" - ;; - - 'hy' ) - LANGNAME="`gettext "Armenian"`" - ;; - - 'hz' ) - LANGNAME="`gettext "Herero"`" - ;; - - 'ia' ) - LANGNAME="`gettext "Interlingua"`" - ;; - - 'id' ) - LANGNAME="`gettext "Indonesian"`" - ;; - - 'ie' ) - LANGNAME="`gettext "Interlingue"`" - ;; - - 'ig' ) - LANGNAME="`gettext "Igbo"`" - ;; - - 'ii' ) - LANGNAME="`gettext "Sichuan Yi"`" - ;; - - 'ik' ) - LANGNAME="`gettext "Inupiak"`" - ;; - - 'io' ) - LANGNAME="`gettext "Ido"`" - ;; - - 'is' ) - LANGNAME="`gettext "Icelandic"`" - ;; - - 'it' ) - LANGNAME="`gettext "Italian"`" - ;; - - 'iu' ) - LANGNAME="`gettext "Inuktitut"`" - ;; - - 'ja' ) - LANGNAME="`gettext "Japanese"`" - ;; - - 'jv' ) - LANGNAME="`gettext "Javanese"`" - ;; - - 'ka' ) - LANGNAME="`gettext "Georgian"`" - ;; - - 'kg' ) - LANGNAME="`gettext "Kongo"`" - ;; - - 'ki' ) - LANGNAME="`gettext "Kikuyu"`" - ;; - - 'kj' ) - LANGNAME="`gettext "Kuanyama"`" - ;; - - 'kk' ) - LANGNAME="`gettext "Kazakh"`" - ;; - - 'kl' ) - LANGNAME="`gettext "Kalaallisut"`" - ;; - - 'km' ) - LANGNAME="`gettext "Khmer"`" - ;; - - 'kn' ) - LANGNAME="`gettext "Kannada"`" - ;; - - 'ko' ) - LANGNAME="`gettext "Korean"`" - ;; - - 'kr' ) - LANGNAME="`gettext "Kanuri"`" - ;; - - 'ks' ) - LANGNAME="`gettext "Kashmiri"`" - ;; - - 'ku' ) - LANGNAME="`gettext "Kurdish"`" - ;; - - 'kv' ) - LANGNAME="`gettext "Komi"`" - ;; - - 'kw' ) - LANGNAME="`gettext "Cornish"`" - ;; - - 'ky' ) - LANGNAME="`gettext "Kirghiz"`" - ;; - - 'la' ) - LANGNAME="`gettext "Latin"`" - ;; - - 'lb' ) - LANGNAME="`gettext "Letzeburgesch"`" - ;; - - 'lg' ) - LANGNAME="`gettext "Ganda"`" - ;; - - 'li' ) - LANGNAME="`gettext "Limburgish"`" - ;; - - 'ln' ) - LANGNAME="`gettext "Lingala"`" - ;; - - 'lo' ) - LANGNAME="`gettext "Lao"`" - ;; - - 'lt' ) - LANGNAME="`gettext "Lithuanian"`" - ;; - - 'lu' ) - LANGNAME="`gettext "Luba-Katanga"`" - ;; - - 'lv' ) - LANGNAME="`gettext "Latvian"`" - ;; - - 'mg' ) - LANGNAME="`gettext "Malagasy"`" - ;; - - 'mh' ) - LANGNAME="`gettext "Marshall"`" - ;; - - 'mi' ) - LANGNAME="`gettext "Maori"`" - ;; - - 'mk' ) - LANGNAME="`gettext "Macedonian"`" - ;; - - 'ml' ) - LANGNAME="`gettext "Malayalam"`" - ;; - - 'mn' ) - LANGNAME="`gettext "Mongolian"`" - ;; - - 'mo' ) - LANGNAME="`gettext "Moldavian"`" - ;; - - 'mr' ) - LANGNAME="`gettext "Marathi"`" - ;; - - 'ms' ) - LANGNAME="`gettext "Malay"`" - ;; - - 'mt' ) - LANGNAME="`gettext "Maltese"`" - ;; - - 'my' ) - LANGNAME="`gettext "Burmese"`" - ;; - - 'na' ) - LANGNAME="`gettext "Nauru"`" - ;; - - 'nb' ) - LANGNAME="`gettext "Norwegian Bokmaal"`" - ;; - - 'nd' ) - LANGNAME="`gettext "Ndebele, North"`" - ;; - - 'ne' ) - LANGNAME="`gettext "Nepali"`" - ;; - - 'ng' ) - LANGNAME="`gettext "Ndonga"`" - ;; - - 'nl' ) - LANGNAME="`gettext "Dutch"`" - ;; - - 'nn' ) - LANGNAME="`gettext "Norwegian Nynorsk"`" - ;; - - 'no' ) - LANGNAME="`gettext "Norwegian"`" - ;; - - 'nr' ) - LANGNAME="`gettext "Ndebele, South"`" - ;; - - 'nv' ) - LANGNAME="`gettext "Navajo"`" - ;; - - 'ny' ) - LANGNAME="`gettext "Chichewa"`" - ;; - - 'oc' ) - LANGNAME="`gettext "Occitan"`" - ;; - - 'oj' ) - LANGNAME="`gettext "Ojibwa"`" - ;; - - 'om' ) - LANGNAME="`gettext "(Afan) Oromo"`" - ;; - - 'or' ) - LANGNAME="`gettext "Oriya"`" - ;; - - 'os' ) - LANGNAME="`gettext "Ossetian; Ossetic"`" - ;; - - 'pa' ) - LANGNAME="`gettext "Panjabi; Punjabi"`" - ;; - - 'pi' ) - LANGNAME="`gettext "Pali"`" - ;; - - 'pl' ) - LANGNAME="`gettext "Polish"`" - ;; - - 'ps' ) - LANGNAME="`gettext "Pashto, Pushto"`" - ;; - - 'pt' ) - LANGNAME="`gettext "Portuguese"`" - ;; - - 'qu' ) - LANGNAME="`gettext "Quechua"`" - ;; - - 'rm' ) - LANGNAME="`gettext "Rhaeto-Romance"`" - ;; - - 'rn' ) - LANGNAME="`gettext "Rundi"`" - ;; - - 'ro' ) - LANGNAME="`gettext "Romanian"`" - ;; - - 'ru' ) - LANGNAME="`gettext "Russian"`" - ;; - - 'rw' ) - LANGNAME="`gettext "Kinyarwanda"`" - ;; - - 'sa' ) - LANGNAME="`gettext "Sanskrit"`" - ;; - - 'sc' ) - LANGNAME="`gettext "Sardinian"`" - ;; - - 'sd' ) - LANGNAME="`gettext "Sindhi"`" - ;; - - 'se' ) - LANGNAME="`gettext "Northern Sami"`" - ;; - - 'sg' ) - LANGNAME="`gettext "Sango; Sangro"`" - ;; - - 'si' ) - LANGNAME="`gettext "Sinhalese"`" - ;; - - 'sk' ) - LANGNAME="`gettext "Slovak"`" - ;; - - 'sl' ) - LANGNAME="`gettext "Slovenian"`" - ;; - - 'sm' ) - LANGNAME="`gettext "Samoan"`" - ;; - - 'sn' ) - LANGNAME="`gettext "Shona"`" - ;; - - 'so' ) - LANGNAME="`gettext "Somali"`" - ;; - - 'sq' ) - LANGNAME="`gettext "Albanian"`" - ;; - - 'sr' ) - LANGNAME="`gettext "Serbian"`" - ;; - - 'ss' ) - LANGNAME="`gettext "Swati; Siswati"`" - ;; - - 'st' ) - LANGNAME="`gettext "Sesotho; Sotho, Southern"`" - ;; - - 'su' ) - LANGNAME="`gettext "Sundanese"`" - ;; - - 'sv' ) - LANGNAME="`gettext "Swedish"`" - ;; - - 'sw' ) - LANGNAME="`gettext "Swahili"`" - ;; - - 'ta' ) - LANGNAME="`gettext "Tamil"`" - ;; - - 'te' ) - LANGNAME="`gettext "Telugu"`" - ;; - - 'tg' ) - LANGNAME="`gettext "Tajik"`" - ;; - - 'th' ) - LANGNAME="`gettext "Thai"`" - ;; - - 'ti' ) - LANGNAME="`gettext "Tigrinya"`" - ;; - - 'tk' ) - LANGNAME="`gettext "Turkmen"`" - ;; - - 'tl' ) - LANGNAME="`gettext "Tagalog"`" - ;; - - 'tn' ) - LANGNAME="`gettext "Tswana; Setswana"`" - ;; - - 'to' ) - LANGNAME="`gettext "Tonga (?)"`" - ;; - - 'tr' ) - LANGNAME="`gettext "Turkish"`" - ;; - - 'ts' ) - LANGNAME="`gettext "Tsonga"`" - ;; - - - 'tt' ) - LANGNAME="`gettext "Tatar"`" - ;; - - 'tw' ) - LANGNAME="`gettext "Twi"`" - ;; - - 'ty' ) - LANGNAME="`gettext "Tahitian"`" - ;; - - 'ug' ) - LANGNAME="`gettext "Uighur"`" - ;; - - 'uk' ) - LANGNAME="`gettext "Ukrainian"`" - ;; - - 'ur' ) - LANGNAME="`gettext "Urdu"`" - ;; - - 'uz' ) - LANGNAME="`gettext "Uzbek"`" - ;; - - 've' ) - LANGNAME="`gettext "Venda"`" - ;; - - 'vi' ) - LANGNAME="`gettext "Vietnamese"`" - ;; - - 'vo' ) - LANGNAME="`gettext "Volapuk; Volapuk"`" - ;; - - 'wa' ) - LANGNAME="`gettext "Walloon"`" - ;; - - 'wo' ) - LANGNAME="`gettext "Wolof"`" - ;; - - 'xh' ) - LANGNAME="`gettext "Xhosa"`" - ;; - - 'yi' ) - LANGNAME="`gettext "Yiddish (formerly ji)"`" - ;; - - 'yo' ) - LANGNAME="`gettext "Yoruba"`" - ;; - - 'za' ) - LANGNAME="`gettext "Zhuang"`" - ;; - - 'zh' ) - LANGNAME="`gettext "Chinese"`" - ;; - - 'zu' ) - LANGNAME="`gettext "Zulu"`" - ;; - - esac - - echo ${LANGNAME} - -} diff --git a/Automation/Functions/Locale/locale_getOptions.sh b/Automation/Functions/Locale/locale_getOptions.sh deleted file mode 100755 index c844614..0000000 --- a/Automation/Functions/Locale/locale_getOptions.sh +++ /dev/null @@ -1,122 +0,0 @@ -#!/bin/bash -# -# locale_getOptions.sh -- This function interprets option parameters -# passed to `locale' functionality and defines action names -# accordingly. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function locale_getOptions { - - # Define short options we want to support. - local ARGSS="h,q" - - # Define long options we want to support. - local ARGSL="help,quiet,filter:,answer-yes,update,edit,delete,dont-create-mo,is-localizable,synchronize" - - # Redefine ARGUMENTS using getopt(1) command parser. - cli_parseArguments - - # Reset positional parameters using output from (getopt) argument - # parser. - eval set -- "${ARGUMENTS}" - - # Look for options passed through command-line. - while true; do - case "$1" in - - -h | --help ) - cli_runFnEnvironment help --read --format="texinfo" "tcar-fs::scripts:bash-functions-locale" - shift 1 - exit - ;; - - -q | --quiet ) - FLAG_QUIET="true" - shift 1 - ;; - - --filter ) - FLAG_FILTER="$2" - shift 2 - ;; - - --answer-yes ) - FLAG_ANSWER="true" - shift 1 - ;; - - --update ) - ACTIONNAMS="$ACTIONNAMS locale_updateMessages" - shift 1 - ;; - - --edit ) - ACTIONNAMS="$ACTIONNAMS locale_editMessages" - shift 1 - ;; - - --delete ) - ACTIONNAMS="$ACTIONNAMS locale_deleteMessages" - shift 1 - ;; - - --is-localizable ) - ACTIONNAMS="$ACTIONNAMS locale_isLocalizable" - shift 1 - ;; - - --dont-create-mo ) - FLAG_DONT_CREATE_MO="true" - shift 1 - ;; - - --synchronize ) - FLAG_SYNCHRONIZE="true" - shift 1 - ;; - - -- ) - # Remove the `--' argument from the list of arguments - # in order for processing non-option arguments - # correctly. At this point all option arguments have - # been processed already but the `--' argument still - # remains to mark ending of option arguments and - # beginning of non-option arguments. The `--' argument - # needs to be removed here in order to avoid - # centos-art.sh script to process it as a path inside - # the repository, which obviously is not. - shift 1 - break - ;; - esac - done - - # Verify action names. When no action name is specified, print an - # error message explaining an action is required at least. - if [[ $ACTIONNAMS == '' ]];then - cli_printMessage "`gettext "You need to provide one action at least."`" --as-error-line - fi - - # Redefine ARGUMENTS variable using current positional parameters. - cli_parseArgumentsReDef "$@" - -} diff --git a/Automation/Functions/Locale/locale_isLocalizable.sh b/Automation/Functions/Locale/locale_isLocalizable.sh deleted file mode 100755 index f59bbe3..0000000 --- a/Automation/Functions/Locale/locale_isLocalizable.sh +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/bash -# -# locale_isLocalizable.sh -- This function determines whether a file -# or directory can have translation messages or not. This is the way -# we standardize what locations can and cannot be localized inside the -# repository. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function locale_isLocalizable { - - local DIR='' - local -a DIRS - - # Initialize location will use as reference to determine whether - # it can have translation messages or not. - local LOCATION="$1" - - # Initialize answer value. By default all paths do not accept - # localization. - local L10N_ACCEPTED='no' - - # When no variable is passed to this function, use the action - # value instead. - if [[ $LOCATION == '' ]];then - LOCATION=${ACTIONVAL} - fi - - # Redefine location to be sure we'll always evaluate a directory, - # as reference location. - if [[ -f $LOCATION ]];then - LOCATION=$(dirname $LOCATION) - fi - - # Verify location existence. If it doesn't exist we cannot go on. - cli_checkFiles -e $LOCATION - - # Initialize possible messages this function would print out. - local -a MESSAGES - - # Define regular expression list of all directories inside the - # repository that can have translation. Try to keep regular - # expressions as simple as possible, so they can be understood by - # sed program. - DIRS[++((${#DIRS[*]}))]="${TCAR_WORKDIR}/Identity/Models/Themes/[[:alnum:]-]+/Distro/$(\ - cli_getPathComponent --release-pattern)/(Anaconda|Concept|Posters|Media)" - DIRS[++((${#DIRS[*]}))]="${TCAR_WORKDIR}/Documentation/Models/Docbook/[[:alnum:]-]+" - DIRS[++((${#DIRS[*]}))]="${TCAR_WORKDIR}/Documentation/Models/Svg/[[:alnum:]-]+" - DIRS[++((${#DIRS[*]}))]="${TCAR_WORKDIR}/Scripts/Bash" - - # Verify location passed as first argument against the list of - # directories that can have translation messages. By default, the - # location passed as first argument is considered as a location - # that cannot have translation messages until a positive answer - # says otherwise. - for DIR in ${DIRS[@]};do - - # Define the path part which is not present in the - # localizable directories. - local PATHDIFF=$(echo ${LOCATION} | sed -r "s,${DIR}/,,") - - # Define the path part that is present in the localizable - # directories. - local PATHSAME=$(echo ${LOCATION} | sed -r "s,/${PATHDIFF},,") - - # Initiate verification between location provided and - # localizable directories. - if [[ $LOCATION =~ "^$DIR$" ]];then - - # At this point the location provided is exactly the same - # that matches the localizable directories. There is - # nothing else to do here but return the script flow to - # this function caller. - L10N_ACCEPTED='yes' - break - - elif [[ ${PATHSAME} =~ "^${DIR}" ]] && [[ -d ${LOCATION} ]];then - - # At this point the location provided is a directory in - # the repository which doesn't match any localizable - # directory in the list, but it could be rendered if the - # --filter option is provided with the appropriate path - # argument. Print a suggestion about it. - cli_printMessage "${PATHSAME} --filter=\"$PATHDIFF\"" --as-suggestion-line - break - - fi - - done - - # At this point, we are safe to say that the path provided isn't - # allow to have any localization for it. So, finish the script - # execution with an error message. - if [[ $L10N_ACCEPTED == 'no' ]];then - cli_printMessage "`gettext "The path provided doesn't support localization."`" --as-error-line - fi - -} diff --git a/Automation/Functions/Locale/locale_prepareWorkingDirectory.sh b/Automation/Functions/Locale/locale_prepareWorkingDirectory.sh deleted file mode 100755 index 0eaae6a..0000000 --- a/Automation/Functions/Locale/locale_prepareWorkingDirectory.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -# -# locale_prepareWorkingDirectory.sh -- This function prepares the -# working directory where translation files should be stored. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function locale_prepareWorkingDirectory { - - local L10N_WORKDIR=$1 - - if [[ ! -d ${L10N_WORKDIR} ]];then - - # Create localization working directory making parent - # directories as needed. Subversion doesn't create directories - # recursively, so we use the system's `mkdir' command and then - # subversion to register the changes. - mkdir -p ${L10N_WORKDIR} - - # Commit changes from working copy to central repository only. - # At this point, changes in the repository are not merged in - # the working copy, but chages in the working copy do are - # committed up to central repository. - cli_synchronizeRepoChanges "${L10N_BASEDIR}" - - elif [[ $L10N_WORKDIR == '' ]];then - - cli_printMessage "`gettext "The localization directory isn't defined."`" --as-error-line - - fi - -} diff --git a/Automation/Functions/Locale/locale_updateMessageBinary.sh b/Automation/Functions/Locale/locale_updateMessageBinary.sh deleted file mode 100755 index 426eb5d..0000000 --- a/Automation/Functions/Locale/locale_updateMessageBinary.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/bash -# -# locale_updateMessageBinary.sh -- This function creates/updates -# machine objects (.mo) from portable objects (.po). -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function locale_updateMessageBinary { - - # Verify machine object creation flag. - if [[ ${FLAG_DONT_CREATE_MO} == 'true' ]];then - return - fi - - # Define absolute path to final portable object. This is the file - # that contains all the individual function translation messages - # and is used to build the machine object (.mo) file. - local PO_FILE=${L10N_WORKDIR}/${TEXTDOMAIN}.po - - # Define list of portable objects to work with. This list must be - # built using the portable objects inside the working copy as - # reference not the information in the central repository - # (IMPORTANT: all of them must be included in this list, so - # FLAG_FILTER mustn't be applied here). Thus, when we are - # selective about the functionalities we want to use, it is - # possible to have translation messages only for those - # functionalities we did download into the working copy and no - # others. There is no need to have translation messages for - # functionalities we didn't download. - local PO_FILES=$(cli_getFilesList ${L10N_WORKDIR} --type='f' --pattern="^.+/messages.po$") - - # Define absolute path to machine object directory. - local MO_DIR="${L10N_WORKDIR}/LC_MESSAGES" - - # Define absolute path to machine object file. - local MO_FILE="${MO_DIR}/${TEXTDOMAIN}.mo" - - # Print action message. - cli_printMessage "${PO_FILE}" --as-creating-line - - # Combine all the function individual portable objects into just - # one portable object. Be sure to use just the first translation - # found, otherwise the automated flow will be broken for you to - # decide which one of two or more variants should remain in the - # portable object. - msgcat ${PO_FILES} --use-first --output-file=${PO_FILE} - - # Print action message. - cli_printMessage "${MO_FILE}" --as-creating-line - - # Verify absolute path to machine object directory, if it doesn't - # exist create it. - if [[ ! -d ${MO_DIR} ]];then - mkdir -p ${MO_DIR} - fi - - # Create machine object from portable object. - msgfmt --check ${PO_FILE} --output-file=${MO_FILE} - -} diff --git a/Automation/Functions/Locale/locale_updateMessageMetadata.sh b/Automation/Functions/Locale/locale_updateMessageMetadata.sh deleted file mode 100755 index a986483..0000000 --- a/Automation/Functions/Locale/locale_updateMessageMetadata.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/bin/bash -# -# locale_updateMessageMetadata.sh -- This function sanitates .pot and -# .po files to use common translation markers inside top comment. -# Later, replacement of common translation markers is applied to set -# the final information. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function locale_updateMessageMetadata { - - local COUNT=0 - local -a SRC - local -a DST - - # Retrive absolute path of portable object we'll work with. - local FILE="$1" - - # Check existence of file before work with it. - cli_checkFiles -e "${FILE}" - - # Define pattern lines. The pattern lines are put inside portable - # objects through xgettext and xml2po commands. In the case of - # Last-Translators, be sure to remplace it only when it is empty - # or refer the Documentation SIG only. This way translators' names - # will survive metadata updates. We don't want they have to type - # their name each time they edit a file. - SRC[0]="\"Project-Id-Version:" - SRC[1]="\"Report-Msgid-Bugs-To:" - SRC[2]="\"Last-Translator: (Documentation SIG)?" - SRC[3]="\"Language-Team:" - SRC[4]="\"PO-Revision-Date:" - - # Define replacement lines for pattern line. - DST[0]="\"Project-Id-Version: ${CLI_NAME}-${CLI_VERSION}\\\n\"" - DST[1]="\"Report-Msgid-Bugs-To: Documentation SIG <$(cli_printMailingList --docs)>\\\n\"" - DST[2]="\"Last-Translator: Documentation SIG\\\n\"" - DST[3]="\"Language-Team: $(locale_getLanguageName)\\\n\"" - DST[4]="\"PO-Revision-Date: $(date "+%F %H:%M%z")\\\n\"" - - # Change pattern lines with their replacement lines. - while [[ $COUNT -lt ${#SRC[*]} ]];do - sed -i -r "/${SRC[$COUNT]}/c${DST[$COUNT]}" ${FILE} - COUNT=$(($COUNT + 1)) - done - - # When the .pot file is created using xml2po the - # `Report-Msgid-Bugs-To:' metadata field isn't created like it - # does when xgettext is used. So, in order to have such metadata - # field in all .pot files, verify its existence and add it if it - # doesn't exist. - egrep "^\"${SRC[1]}" $FILE > /dev/null - if [[ $? -ne 0 ]];then - sed -i -r "/^\"${SRC[0]}/a${DST[1]}" $FILE - fi - - # Replace package information using gettext domain information. - sed -i -r "s/PACKAGE/${CLI_NAME}-${CLI_VERSION}/g" ${FILE} - - # Remove absolute path to the working copy so it doesn't appear on - # comments related to locations. Remember that people can download - # their working copies in different locations and we don't want to - # version those changes each time a translation message be - # updated. To be consistent about this, show path information from - # first level on. Don't show the variable part of the path. - sed -i -r "s,${TCAR_WORKDIR}/,,g" ${FILE} - - # Unset array variables to avoid undesired concatenations. - unset SRC - unset DST - -} diff --git a/Automation/Functions/Locale/locale_updateMessagePObjects.sh b/Automation/Functions/Locale/locale_updateMessagePObjects.sh deleted file mode 100755 index d2e9aa0..0000000 --- a/Automation/Functions/Locale/locale_updateMessagePObjects.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash -# -# locale_updateMessagePObjects.sh -- This function initializes the -# portable object when it doesn't exist. When the portable object does -# exist, it is updated instead. In both cases, the portable object -# template is used as source to merge changes inside the portable -# object. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function locale_updateMessagePObjects { - - local FILE="$1" - - # Verify the portable object template. The portable object - # template is used to create the portable object. We cannot - # continue without it. - cli_checkFiles -e "${FILE}.pot" - - # Print action message. - cli_printMessage "${FILE}.po" --as-creating-line - - # Verify existence of portable object. The portable object is the - # file translators edit in order to make translation works. - if [[ -f ${FILE}.po ]];then - - # Update portable object merging both portable object and - # portable object template. - msgmerge --output="${FILE}.po" "${FILE}.po" "${FILE}.pot" --quiet - - else - - # Initiate portable object using portable object template. - # Do not print msginit sterr output, use centos-art action - # message instead. - msginit -i ${FILE}.pot -o ${FILE}.po --width=70 \ - --no-translator > /dev/null 2>&1 - - fi - - # Sanitate metadata inside the PO file. - locale_updateMessageMetadata "${FILE}.po" - -} diff --git a/Automation/Functions/Locale/locale_updateMessageShell.sh b/Automation/Functions/Locale/locale_updateMessageShell.sh deleted file mode 100755 index ad7614f..0000000 --- a/Automation/Functions/Locale/locale_updateMessageShell.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/bash -# -# locale_updateMessageShell.sh -- This function parses shell scripts -# source files under action value and retrives translatable strings in -# order to creates/updates both the portable object template (.pot) -# and the portable object (.po) related. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function locale_updateMessageShell { - - # Print separator line. - cli_printMessage '-' --as-separator-line - - # Define regular expression to match extensions of shell scripts - # we use inside the repository. - local EXTENSION='sh' - - # Define list of absolute paths to function directories. - local FNDIRS=$(cli_getFilesList ${ACTIONVAL}/Functions \ - --maxdepth=1 --mindepth=1 --type='d' --pattern="${ACTIONVAL}/${FLAG_FILTER}") - - for FNDIR in $FNDIRS;do - - # Define absolute path to directory used as reference to store - # portable objects. - local L10N_WORKDIR=$(cli_getLocalizationDir "${FNDIR}") - - # Prepare working directory to receive translation files. - locale_prepareWorkingDirectory ${L10N_WORKDIR} - - # Define absolute path to file used as reference to create - # portable objects. - local MESSAGES="${L10N_WORKDIR}/messages" - - # Print action message. - cli_printMessage "${MESSAGES}.pot" --as-updating-line - - # Build list of files to process. When you build the pattern, - # be sure the value passed through `--filter' will be exactly - # evaluated with the extension as prefix. Otherwise it would - # be difficult to match files that share the same characters - # in their file names (e.g., it would be difficult to match - # only `hello.sh' if `hello-world.sh' also exists in the same - # location). - local FILES=$(cli_getFilesList ${FNDIR} --pattern="^.+\.${EXTENSION}$") - - # Retrieve translatable strings from shell script files and - # create the portable object template (.pot) from them. - xgettext --output=${MESSAGES}.pot \ - --copyright-holder="$(cli_printCopyrightInfo --holder)" \ - --width=70 --sort-by-file ${FILES} - - # Sanitate metadata inside the POT file. - locale_updateMessageMetadata "${MESSAGES}.pot" - - # Verify, initialize or update portable objects from portable - # object templates. - locale_updateMessagePObjects "${MESSAGES}" - - done - - # At this point some changes might be realized inside the PO file, - # so we need to update the related MO file based on recently - # updated PO files here in order for `centos-art.sh' script to - # print out the most up to date revision of localized messages. - # Notice that this is required only if we were localizaing shell - # scripts. - locale_updateMessageBinary - -} diff --git a/Automation/Functions/Locale/locale_updateMessageXml.sh b/Automation/Functions/Locale/locale_updateMessageXml.sh deleted file mode 100755 index cf7bfde..0000000 --- a/Automation/Functions/Locale/locale_updateMessageXml.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash -# -# locale_updateMessageXml.sh -- This function parses XML-based files -# (e.g., Scalable Vector Graphics and Docbook files), retrieves -# translatable strings and creates/update gettext portable objects. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function locale_updateMessageXml { - - # Define what kind of XML file we are generating translation - # messages for. This is relevant because scalable vector graphics - # (SVG) files are not using entity expansion while DocBook files - # do. - if [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/Documentation/Models/Docbook/[[:alnum:]-]+$" ]];then - - locale_updateMessageXmlDocbook - - # Combine template messages and licenses messages so when - # template be merged into the final portable object the - # translations be there. If we cannot treat licenses as - # independent documents (e.g., through XInclude), then lets - # keep translation messages as synchronized as possible. - - elif [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/Identity/Models/.+$" ]] \ - || [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/Documentation/Models/Svg/.+$" ]];then - - locale_updateMessageXmlSvg - - else - - cli_printMessage "`gettext "The path provided doesn't support localization."`" --as-error-line - - fi - -} diff --git a/Automation/Functions/Locale/locale_updateMessageXmlDocbook.sh b/Automation/Functions/Locale/locale_updateMessageXmlDocbook.sh deleted file mode 100755 index 04448e2..0000000 --- a/Automation/Functions/Locale/locale_updateMessageXmlDocbook.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash -# -# locale_updateMessageXmlDocbook.sh -- This function retrieves -# translation messages from Docbook files and creates related portable -# object template for them. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function locale_updateMessageXmlDocbook { - - # Define location where translation files will be stored in. - local L10N_WORKDIR=$(cli_getLocalizationDir ${ACTIONVAL}) - - # Define regular expression to match extensions of shell scripts - # we use inside the repository. - local EXTENSION='docbook' - - # Define absolute paths to Docbook main file. - local TEMPLATE=$(cli_getFilesList ${ACTIONVAL} \ - --maxdepth=1 --mindepth=1 --type='f' \ - --pattern=".+/$(cli_getRepoName ${ACTIONVAL} -f)\.${EXTENSION}$") - - # Process Docbook template files based on whether it is empty or - # not. When it is empty, it is because there is not a Docbook main - # file in the location provided to centos-art.sh script - # command-line. In this case, we try to create one POT file to all - # docbook files inside the location provided but without expanding - # entities. When Docbook template file is not empty, expand - # entities and create the POT file from a Docbook main file - # instance, with all entities expanded. - if [[ -z ${TEMPLATE} ]];then - locale_updateMessageXmlDocbookNoEntities - else - locale_updateMessageXmlDocbookWithEntities - fi - -} diff --git a/Automation/Functions/Locale/locale_updateMessageXmlDocbookNoEntities.sh b/Automation/Functions/Locale/locale_updateMessageXmlDocbookNoEntities.sh deleted file mode 100755 index 67d6f75..0000000 --- a/Automation/Functions/Locale/locale_updateMessageXmlDocbookNoEntities.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash -# -# locale_updateMessageXmlDocbookNoEntities.sh -- This function creates -# an instance of one or more Docbook files without expanding entities -# inside it, retrieves all translatable strings from main file -# instance, and creates the related portable object template POT for -# them. This is useful to localize Docbook files that aren't direct -# part of a documentation manual but included at rendition time (e.g., -# Docbook files holding license information). -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function locale_updateMessageXmlDocbookNoEntities { - - # In case no path to Docbook main file is not found, go deeper - # into the documentation models directory structure looking for - # files that do match the name of the directory who hold it, and - # use that file as template to initiate localization process. The - # way to reach these files have to be through --filter options - # because we want to respect the restrictions imposed by - # locale_isLocalizable function inside the repository. - # CAUTION: entity expansion the files found this way will be # ignored. - local TEMPLATES=$(cli_getFilesList ${ACTIONVAL} --type='f' \ - --pattern=".+/${FLAG_FILTER}.+\.${EXTENSION}$") - - # Verify number of template files found and define what kind of - # processing they are going to have. In case more than one - # template file be found and because entity expansion will be - # ignored in such case, the whole process of creating the PO file - # for all these templates is also different (simpler) from that we - # use with entity expansion. - - for TEMPLATE in ${TEMPLATES};do - - # Redefine path related to localization work directory. - local L10N_WORKDIR=$(cli_getLocalizationDir "$TEMPLATE") - - # Define location of the file used to create both portable - # object templates (.pot) and portable objects (.po) files. - local MESSAGES="${L10N_WORKDIR}/messages" - - # Print action message. - cli_printMessage "${MESSAGES}.pot" --as-updating-line - - # Extract translatable strings from docbook files and merge - # them down into related messages file. - xml2po -a -l ${CLI_LANG_LL} -o ${MESSAGES}.pot ${TEMPLATE} - - # Verify, initialize or merge portable objects from portable - # object templates. - locale_updateMessagePObjects "${MESSAGES}" - - done - -} diff --git a/Automation/Functions/Locale/locale_updateMessageXmlDocbookWithEntities.sh b/Automation/Functions/Locale/locale_updateMessageXmlDocbookWithEntities.sh deleted file mode 100755 index 352e5b9..0000000 --- a/Automation/Functions/Locale/locale_updateMessageXmlDocbookWithEntities.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash -# -# locale_updateMessageXmlDocbookWithEntities.sh -- This function -# creates an instance of Docbook main file, expands entities inside -# it, retrieves all translatable strings from main file instance, and -# creates the related portable object template POT for them. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function locale_updateMessageXmlDocbookWithEntities { - - # Define location of the file used to create both portable object - # templates (.pot) and portable objects (.po) files. - local MESSAGES="${L10N_WORKDIR}/messages" - - # Print action message. - cli_printMessage "${MESSAGES}.pot" --as-updating-line - - # Define file name used as template instance. Here is where we - # expand translation markers and entities before retrieving - # translation messages. - local INSTANCE=$(cli_getTemporalFile "$(basename ${TEMPLATE})") - - # Create the non-translated instance of design model. - cp ${TEMPLATE} ${INSTANCE} - - # Expand common contents inside instance. - cli_exportFunctions "Render/Docbook/docbook_setExpansionLicenses" - docbook_setExpansionLicenses ${INSTANCE} - - # When translated instances are rendered, system entities (e.g., - # `%entity-name;') don't appear in the translated instance (it - # seems that xml2po removes them) and this provokes DocBook - # validation to fail. So in order to pass the validation - # successfully and automate the whole creation of system entities, - # don't let this duty ion users'. Instead, make centos-art.sh - # script responsible of it. - cli_exportFunctions "Render/Docbook/docbook_setExpansionSystemEntities" - docbook_setExpansionSystemEntities ${INSTANCE} - - # Create portable object template from instance. Validate - # translated instance before processing it. This step is very - # important in order to detect document's malformations and warn - # you about it, so you can correct them. - xmllint --valid --noent ${INSTANCE} | xml2po -a -l ${CLI_LANG_LC} - \ - | msgcat --output=${MESSAGES}.pot \ - --width=70 --no-location - - - # Expand translation markers inside file. - cli_expandTMarkers ${INSTANCE} - - # Verify, initialize or merge portable objects from portable - # object templates. - locale_updateMessagePObjects "${MESSAGES}" - -} diff --git a/Automation/Functions/Locale/locale_updateMessageXmlSvg.sh b/Automation/Functions/Locale/locale_updateMessageXmlSvg.sh deleted file mode 100755 index d41bec1..0000000 --- a/Automation/Functions/Locale/locale_updateMessageXmlSvg.sh +++ /dev/null @@ -1,101 +0,0 @@ -#!/bin/bash -# -# locale_updateMessageXmlSvg.sh -- This function parses XML-based -# files (e.g., scalable vector graphics), retrieves translatable -# strings and creates/update gettext portable objects. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function locale_updateMessageXmlSvg { - - # Inside `Identity/Models' and Documentation/Models/Svg/, design - # models can be compressed or uncompressed. Because of this we - # cannot process all the design models in one unique way. Instead, - # we need to treat them individually based on their file type. - - local DIR='' - local DIRS='' - - # Define regular expression to match extensions of shell scripts - # we use inside the repository. - local EXTENSION='(svgz|svg)' - - # Build list of directories in which we want to look files for. - local DIRS=$(cli_getFilesList ${ACTIONVAL} \ - --pattern="${ACTIONVAL}/${FLAG_FILTER}") - - # Process list of directories, one by one. - for DIR in $DIRS;do - - # Reset information related to temporal files. - local TEMPFILE='' - local TEMPFILES='' - - # Redefine localization working directory using the current - # directory. The localization working directory is the place - # where POT and PO files are stored inside the working copy. - local L10N_WORKDIR=$(cli_getLocalizationDir "${DIR}") - - # Prepare working directory to receive translation files. - locale_prepareWorkingDirectory ${L10N_WORKDIR} - - # Redefine final location of messages.po file, based on - # current directory. - MESSAGES=${L10N_WORKDIR}/messages - - # Build list of files we want to work with. - FILES=$(cli_getFilesList ${DIR} --pattern="${DIR}/.+\.${EXTENSION}") - - for FILE in $FILES;do - - # Redefine temporal file based on file been processed. - TEMPFILE=$(cli_getTemporalFile $(basename ${FILE})) - - # Update the command used to read content of XML files. - if [[ $(file -b -i $FILE) =~ '^application/x-gzip$' ]];then - - # Create uncompressed copy of file. - /bin/zcat $FILE > $TEMPFILE - - else - - # Create uncompressed copy of file. - /bin/cat $FILE > $TEMPFILE - - fi - - # Concatenate temporal files into a list so we can process - # them later through xml2po, all at once. - TEMPFILES="${TEMPFILE} ${TEMPFILES}" - - done - - # Create the portable object template. - cat $TEMPFILES | xml2po -a -l ${CLI_LANG_LC} - \ - | msgcat --output=${MESSAGES}.pot --width=70 --no-location - - - # Verify, initialize or merge portable objects from portable - # object templates. - locale_updateMessagePObjects "${MESSAGES}" - - done - -} diff --git a/Automation/Functions/Locale/locale_updateMessages.sh b/Automation/Functions/Locale/locale_updateMessages.sh deleted file mode 100755 index 32fd78d..0000000 --- a/Automation/Functions/Locale/locale_updateMessages.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/bash -# -# locale_updateMessages.sh -- This function extracts translatable -# strings from both XML-based files (using xml2po) and shell scripts -# (using xgettext). Translatable strings are initially stored in -# portable objects templates (.pot) which are later merged into -# portable objects (.po) in order to be optionally converted as -# machine objects (.mo). -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function locale_updateMessages { - - # Verify directory passed as non-option argument to be sure it - # supports localization. - locale_isLocalizable "${ACTIONVAL}" - - # Prepare working directory to receive translation files. Don't - # do this here. This location can be redefine later based on - # deeper directory structures not provided as arguments to - # centos-art.sh script. For example, if you execute the following - # command: - # - # centos-art locale Documentation/Models/Svg/Brands --update - # - # it should produce the following directory structure: - # - # Locales/Documentation/Models/Svg/Brands/Logos/${LANG}/ - # Locales/Documentation/Models/Svg/Brands/Symbols/${LANG}/ - # Locales/Documentation/Models/Svg/Brands/Types/${LANG}/ - # - # and not the next one: - # - # Locales/Documentation/Models/Svg/Brands/${LANG}/ - # - # So, don't prepare working directory to receive translation files - # here. Instead, do it just before POT files creation. - - # Evaluate action value to determine whether to use xml2po to - # extract translatable strings from XML-based files or to use - # xgettext to extract translatable strings from shell script - # files. - if [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/(Documentation/Models/(Docbook|Svg)|Identity/Models)/.*$" ]];then - - # Update translatable strings inside the portable object - # template related to XML-based files (e.g., scalable vector - # graphics). - locale_updateMessageXml - - elif [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/Scripts/Bash$" ]];then - - # Update translatable strings inside the portable object - # template related to shell scripts (e.g., the centos-art.sh - # script). - locale_updateMessageShell - - else - cli_printMessage "`gettext "The path provided doesn't support localization."`" --as-error-line - fi - -} diff --git a/Automation/Functions/Prepare/Config/bash_profile.conf b/Automation/Functions/Prepare/Config/bash_profile.conf deleted file mode 100755 index b7fbb7a..0000000 --- a/Automation/Functions/Prepare/Config/bash_profile.conf +++ /dev/null @@ -1,20 +0,0 @@ -# .bash_profile - -# Get the aliases and functions -if [ -f ~/.bashrc ]; then - . ~/.bashrc -fi - -# User specific environment and startup programs - -PATH=$PATH:$HOME/bin -export PATH - -EDITOR=/usr/bin/vim -export EDITOR - -TCAR_WORKDIR= -export TCAR_WORKDIR - -TCAR_BRAND= -export TCAR_BRAND diff --git a/Automation/Functions/Prepare/Config/vim.conf b/Automation/Functions/Prepare/Config/vim.conf deleted file mode 100755 index e54c201..0000000 --- a/Automation/Functions/Prepare/Config/vim.conf +++ /dev/null @@ -1,9 +0,0 @@ -set nu -set textwidth=70 -set autoindent -set tabstop=4 -set softtabstop=4 -set shiftwidth=4 -set expandtab -set tags=./tags,tags -set spell diff --git a/Automation/Functions/Prepare/prepare.sh b/Automation/Functions/Prepare/prepare.sh deleted file mode 100755 index f9d8fc2..0000000 --- a/Automation/Functions/Prepare/prepare.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash -# -# prepare.sh (initialization) -- This function creates the base -# execution environment required to standardize final configuration -# stuff needed by your workstation, once the working copy of The -# CentOS Artwork Repository has been downloaded in it. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function prepare { - - local ACTIONNAM='' - local ACTIONNAMS='' - - # Define absolute path to directory holding prepare's - # configuration files. - local PREPARE_CONFIG_DIR=${CLI_FUNCDIR}/${CLI_FUNCDIRNAM}/Config - - # Interpret arguments and options passed through command-line. - prepare_getOptions - - # Redefine positional parameters using ARGUMENTS. At this point, - # option arguments have been removed from ARGUMENTS variable and - # only non-option arguments remain in it. - eval set -- "$ARGUMENTS" - - # Execute action names based on whether they were provided or not. - if [[ $ACTIONNAMS == '' ]];then - - # When action names are not provided, define action names that - # will take place, explicitly. - prepare_updateEnvironment - prepare_updatePackages - prepare_updateLocales - prepare_updateLinks - prepare_updateImages - prepare_updateManuals - - else - - # When action names are provided, loop through them and - # execute them one by one. - for ACTIONNAM in $ACTIONNAMS;do - ${ACTIONNAM} $@ - done - - fi - -} diff --git a/Automation/Functions/Prepare/prepare_getEnvars.sh b/Automation/Functions/Prepare/prepare_getEnvars.sh deleted file mode 100755 index 345bd34..0000000 --- a/Automation/Functions/Prepare/prepare_getEnvars.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash -# -# prepare_getEnvars.sh -- This function outputs a brief description of -# relevant environment variables used by `centos-art.sh' script. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function prepare_getEnvars { - - local -a VARS - local -a INFO - local COUNT=0 - - # Define name of environment variables used by centos-art.sh - # script. - VARS[0]='EDITOR' - VARS[1]='TZ' - VARS[2]='TEXTDOMAIN' - VARS[3]='TEXTDOMAINDIR' - VARS[4]='LANG' - - # Define description of environment variables. - INFO[0]="`gettext "Default text editor"`" - INFO[1]="`gettext "Default time zone representation"`" - INFO[2]="`gettext "Default domain used to retrieve translated messages"`" - INFO[3]="`gettext "Default directory used to retrive translated messages"`" - INFO[4]="`gettext "Default locale information"`" - - until [[ $COUNT -eq ${#VARS[*]} ]];do - - # Let user to reduce output using regular expression as - # reference. - if [[ ${VARS[$COUNT]} =~ $FLAG_FILTER ]];then - - # Output list of environment variables using indirect - # expansion (what a beautiful feature!) to output variable - # value. - cli_printMessage "${INFO[$COUNT]}:" - cli_printMessage "${VARS[$COUNT]}=${!VARS[$COUNT]}" --as-response-line - - fi - - # Increment counter. - COUNT=$(($COUNT + 1)) - - done - -} diff --git a/Automation/Functions/Prepare/prepare_getLinkName.sh b/Automation/Functions/Prepare/prepare_getLinkName.sh deleted file mode 100755 index e14dbbf..0000000 --- a/Automation/Functions/Prepare/prepare_getLinkName.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash -# -# prepare_getLinkName.sh -- This function standardizes link name -# construction. For the construction sake, two arguments are required, -# one to now the file's base directory, and another holding the file's -# absolute path. With this information, the base directory is removed -# from file's absolute path and the remaining path is transformed into -# a file name where each slash is converted into minus sign. -# -# For example, if the following information is provided: -# -# ARG1: /home/centos/artwork/Identity/Brushes -# ARG2: /home/centos/artwork/Identity/Brushes/Corporate/symbol.gbr -# -# the result will be: `corporate-symbol.gbr'. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function prepare_getLinkName { - - local LINK_BASEDIR='' - local LINK_ABSPATH='' - local LINK_CHARSEP='' - - # Define absolute path to link's base directory. - LINK_BASEDIR="$1" - - # Define absolute path to link's file. - LINK_ABSPATH="$2" - - # Define character used as word separator on file name. - LINK_CHARSEP='-' - - # Output link name. - echo "$LINK_ABSPATH" | sed -r "s!^${LINK_BASEDIR}/!!" \ - | tr '[:upper:]' '[:lower:]' | sed -r "s!/!${LINK_CHARSEP}!g" - -} diff --git a/Automation/Functions/Prepare/prepare_getOptions.sh b/Automation/Functions/Prepare/prepare_getOptions.sh deleted file mode 100755 index 7fc5c50..0000000 --- a/Automation/Functions/Prepare/prepare_getOptions.sh +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/bash -# -# prepare_getOptions.sh -- This function parses command options -# provided to `centos-art.sh' script when the first argument in the -# command-line is the `prepare' word. To parse options, this function -# makes use of getopt program. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function prepare_getOptions { - - # Define short options we want to support. - local ARGSS="h,q" - - # Define long options we want to support. - local ARGSL="help,quiet,answer-yes,packages,locales,links,images,manuals,directories,set-environment,see-environment,synchronize" - - # Redefine ARGUMENTS using getopt(1) command parser. - cli_parseArguments - - # Reset positional parameters using output from (getopt) argument - # parser. - eval set -- "$ARGUMENTS" - - # Look for options passed through command-line. - while true; do - case "$1" in - - -h | --help ) - cli_runFnEnvironment help --read --format="texinfo" "tcar-fs::scripts:bash-functions-prepare" - shift 1 - exit - ;; - - -q | --quiet ) - FLAG_QUIET="true" - shift 1 - ;; - - --answer-yes ) - FLAG_ANSWER="true" - shift 1 - ;; - - --set-environment ) - ACTIONNAMS="${ACTIONNAMS} prepare_updateEnvironment" - shift 1 - ;; - - --see-environment ) - ACTIONNAMS="${ACTIONNAMS} prepare_seeEnvironment" - shift 1 - ;; - - --packages ) - ACTIONNAMS="${ACTIONNAMS} prepare_updatePackages" - shift 1 - ;; - - --locales ) - ACTIONNAMS="${ACTIONNAMS} prepare_updateLocales" - shift 1 - ;; - - --links ) - ACTIONNAMS="${ACTIONNAMS} prepare_updateLinks" - shift 1 - ;; - - --images ) - ACTIONNAMS="${ACTIONNAMS} prepare_updateImages" - shift 1 - ;; - - --manuals ) - ACTIONNAMS="${ACTIONNAMS} prepare_updateManuals" - shift 1 - ;; - - --directories ) - ACTIONNAMS="${ACTIONNAMS} prepare_updateDirectoryStructure" - shift 1 - ;; - - --synchronize ) - FLAG_SYNCHRONIZE="true" - shift 1 - ;; - - -- ) - # Remove the `--' argument from the list of arguments - # in order for processing non-option arguments - # correctly. At this point all option arguments have - # been processed already but the `--' argument still - # remains to mark ending of option arguments and - # beginning of non-option arguments. The `--' argument - # needs to be removed here in order to avoid - # centos-art.sh script to process it as a path inside - # the repository, which obviously is not. - shift 1 - break - ;; - - esac - done - - # Redefine ARGUMENTS variable using current positional parameters. - cli_parseArgumentsReDef "$@" - -} diff --git a/Automation/Functions/Prepare/prepare_seeEnvironment.sh b/Automation/Functions/Prepare/prepare_seeEnvironment.sh deleted file mode 100755 index b0d98cf..0000000 --- a/Automation/Functions/Prepare/prepare_seeEnvironment.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/bash -# -# prepare_seeEnvironment.sh -- This function outputs a brief description of -# relevant environment variables used by `centos-art.sh' script. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function prepare_seeEnvironment { - - local -a VARS - local -a INFO - local COUNT=0 - - # Define name of environment variables used by centos-art.sh - # script. - VARS[0]='EDITOR' - VARS[1]='TZ' - VARS[2]='TEXTDOMAIN' - VARS[3]='TEXTDOMAINDIR' - VARS[4]='LANG' - VARS[5]='TCAR_WORKDIR' - - # Define description of environment variables. - INFO[0]="`gettext "Default text editor"`" - INFO[1]="`gettext "Default time zone representation"`" - INFO[2]="`gettext "Default domain used to retrieve translated messages"`" - INFO[3]="`gettext "Default directory used to retrive translated messages"`" - INFO[4]="`gettext "Default locale information"`" - INFO[5]="`gettext "Default path to your working copy"`" - - until [[ $COUNT -eq ${#VARS[*]} ]];do - - # Let user to reduce output using regular expression as - # reference. - if [[ ${VARS[$COUNT]} =~ $FLAG_FILTER ]];then - - # Output list of environment variables using indirect - # expansion (what a beautiful feature!) to output variable - # value. - cli_printMessage "${INFO[$COUNT]}:" - cli_printMessage "${VARS[$COUNT]}=${!VARS[$COUNT]}" --as-response-line - - fi - - # Increment counter. - COUNT=$(($COUNT + 1)) - - done - -} diff --git a/Automation/Functions/Prepare/prepare_updateDirectoryStructure.sh b/Automation/Functions/Prepare/prepare_updateDirectoryStructure.sh deleted file mode 100755 index b7c8f7f..0000000 --- a/Automation/Functions/Prepare/prepare_updateDirectoryStructure.sh +++ /dev/null @@ -1,111 +0,0 @@ -#!/bin/bash -# -# prepare_updateDirectoryStructure.sh -- This function standardizes -# the relation between source directory structures and target -# directory structures inside the repository. This function takes -# source and target paths as arguments, analyses them and builds the -# target directory structure based on source directory structure. This -# function must be executed before executing production functions like -# render. -# -# In order for this verification to work, all source directory -# structures provided must be organized using one directory level more -# than its related target directory. The purpose of this directory is -# content categorization. For example, consider the following path: -# -# ---------------++++++++++++++++++++++++ -# ${SOURCE_PATH}/${CATEGORY}/${COMPONENT} -# ---------------++++++++++++++++++++++++ -# ++++++++++++++++++++++++++++++++++------------ -# ${TARGET_PATH}/${NAME}/${VERSION}/${COMPONENT} -# ++++++++++++++++++++++++++++++++++------------ -# -# So we end with the following path: -# -# ${TARGET_PATH}/${CATEGORY}/${COMPONENT} -# -# In this path, ${CATEGORY} makes reference to a categorization -# directory used to describe source components related to target -# components. However, in the target side, such ${CATEGORY} directory -# is not needed and should be removed from it in order to get the -# final target path, which is: -# -# ${TARGET_PATH}/${COMPONENT} -# -# ${CATEGORY} is always a one-level directory, but ${COMPONENT} might -# have several levels deep. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function prepare_updateDirectoryStructure { - - # Define absolute path to design models' directory structure. This - # directory contains the directory structure you want to verify - # inside target path. - local SOURCE_PATH=$(cli_checkRepoDirSource "${1}") - - # Verify existence source path, just to be sure it was passed and - # it is a valid directory. - cli_checkFiles ${SOURCE_PATH} -d - - # Define absolute path to directory inside the repository where - # you want to replicate the source path directory structure. - local TARGET_PATH=$(cli_checkRepoDirSource "${2}") - - # NOTE: It is possible that target path doesn't exist. So verify - # the relation between target and source path. If there is a - # source path for the target, create an empty directory as target, - # using the related source directory as reference. - - # Define list of directories inside source path. - local SOURCE_DIRS=$(cli_getFilesList ${SOURCE_PATH} \ - --pattern='.+/[[:alpha:]]+$' --type=d) - - # Iterate through directories inside source path and verify - # whether or not they exist in the target path. If they don't - # exist create them. - for SOURCE_DIR in ${SOURCE_DIRS};do - - local SOURCE_DIR_BASENAME=$(echo ${SOURCE_DIR} \ - | sed -r "s,${SOURCE_PATH}/,,") - - local TARGET_DIR=${TARGET_PATH}/${SOURCE_DIR_BASENAME} - - if [[ ${SOURCE_DIR} == ${SOURCE_DIR_BASENAME} ]];then - continue - fi - - # Keep this for debugging ;) - #echo '---' - #echo $SOURCE_DIR_BASENAME; - #echo $SOURCE_DIR; - #echo $TARGET_DIR; - #echo $TARGET_PATH; - #echo '---' - #continue - - if [[ ! -d ${TARGET_DIR} ]];then - mkdir -p ${TARGET_DIR} - fi - - done - -} diff --git a/Automation/Functions/Prepare/prepare_updateEnvironment.sh b/Automation/Functions/Prepare/prepare_updateEnvironment.sh deleted file mode 100755 index 9128015..0000000 --- a/Automation/Functions/Prepare/prepare_updateEnvironment.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/bash -# -# prepare_updateEnvironment.sh -- This function updates the -# `~/.bash_profile' file to provide default configuration values to -# centos-art.sh script. Those values which aren't set by this function -# are already set in the `bash_profile.conf' template file we use as -# reference to create the `~/.bash_profile' file. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function prepare_updateEnvironment { - - # Verify that centos-art.sh script is run using an absolute path. - # We use this information to determine the exact working copy - # location to use, later when `bash_profile' file is created. - if [[ ! $0 =~ "^${HOME}/.+/${CLI_NAME}.sh$" ]];then - cli_printMessage "`gettext "To set environment variables you should run centos-art.sh using its abosolute path."`" --as-error-line - fi - - local PROFILE=bash_profile - local SOURCE=${PREPARE_CONFIG_DIR}/${PROFILE}.conf - local TARGET=${HOME}/.${PROFILE} - - # Determine the repository absolute path using the script absolute - # path the script has been executed from. Be careful when you use - # the centos-art command. It points to ~/bin directory which is - # not (and must not be) the repository working copy absolute path. - if [[ $TCAR_WORKDIR =~ "^${HOME}/bin" ]];then - cli_printMessage "`eval_gettext "The repository working directory cannot be $HOME/bin"`" --as-error-line - else - local TCAR_WORKDIR=$(dirname "$0" | sed "s,/${TCAR_BASHSCRIPTS},,") - fi - - # Determine which is the brand information that will be used as - # repository brand information. By default we are using `centos' - # and shouldn't be change to anything else, at least if you - # pretend to produce content for The CentOS Project. - local TCAR_BRAND='centos' - - # Print action message. - cli_printMessage "${TARGET}" --as-updating-line - - # Copy default configuration file to its final destination. Note - # that we are not making a link here in order for different users - # to be able of using different values in their own environments. - cp -f $SOURCE $TARGET - - # Update bash_profile file with default values. - sed -i -r \ - -e "s,^(TCAR_WORKDIR=).*,\1${TCAR_WORKDIR}," \ - -e "s,^(TCAR_BRAND=).*,\1${TCAR_BRAND}," \ - ${TARGET} - -} diff --git a/Automation/Functions/Prepare/prepare_updateImages.sh b/Automation/Functions/Prepare/prepare_updateImages.sh deleted file mode 100755 index 6b5b030..0000000 --- a/Automation/Functions/Prepare/prepare_updateImages.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash -# -# prepare_updateImages.sh -- This option initializes image files inside -# the working copy. When you provide this option, the centos-art.sh -# scripts renders image files from all design models available in the -# working copy. This step is required in order to satisfy dependencies -# from different components inside the working copy. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function prepare_updateImages { - - # Define list of directories that need to be rendered. - local DIRS=$(cli_getFilesList \ - ${TCAR_WORKDIR}/Identity/Images --maxdepth="1" \ - --mindepth="1" --type="d" --pattern=".+/[[:alnum:]]+") - - # CAUTION: The order in which the image components are rendered is - # very important. For example, in order for theme images to hold - # the branding information the `Identity/Images/Brands' directory - # must be rendered before the `Identity/Images/Themes' directory. - # The reason of this is that brand images are not draw inside - # theme design models themselves, but combined with theme images - # using the ImageMagick tool suite once both have been rendered. - - # Update list of directories to be sure that brands will always be - # rendered as first image component. Here we remove the brand - # component from the list and add it explicitly on top of all - # other directories in the list. - DIRS="${TCAR_WORKDIR}/Identity/Images/Brands - $(echo "$DIRS" | grep -v 'Identity/Images/Brands')" - - # Render image components using the list of directories. - cli_runFnEnvironment render ${DIRS} --with-brands - -} diff --git a/Automation/Functions/Prepare/prepare_updateLinks.sh b/Automation/Functions/Prepare/prepare_updateLinks.sh deleted file mode 100755 index 70a18fb..0000000 --- a/Automation/Functions/Prepare/prepare_updateLinks.sh +++ /dev/null @@ -1,183 +0,0 @@ -#!/bin/bash -# -# prepare_updateLinks.sh -- This option creates/updates the symbolic links -# information required in your workstation to connect it with the -# files inside the working copy of The CentOS Artwork Repository. When -# you provide this option, the centos-art.sh put itself into your -# system's execution path and make common brushes, patterns, palettes -# and fonts available inside applications like GIMP, so you can make -# use of them without loosing version control over them. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function prepare_updateLinks { - - local -a LINKS_SRC - local -a LINKS_DST - local USERFILES='' - local PALETTE='' - local BRUSH='' - local PATTERN='' - local FONT='' - local FILE='' - local COUNT=0 - - # Define user's directories. Here is where configuration links are - # created in the local workstation. - local GIMP_DIR=${HOME}/.$(rpm -q gimp | cut -d. -f-2) - local GIMP_DIR_BRUSHES=${GIMP_DIR}/brushes - local GIMP_DIR_PALETTES=${GIMP_DIR}/palettes - local GIMP_DIR_PATTERNS=${GIMP_DIR}/patterns - local INKS_DIR=${HOME}/.inkscape - local INKS_DIR_PALETTES=${INKS_DIR}/palettes - local FONT_DIR=${HOME}/.fonts - local APPS_DIR=${HOME}/bin - - # Define the working copy directory structure. Here is where user - # specific configuration links in the workstation will point to. - local WCDIR=${TCAR_WORKDIR}/Identity - local WCDIR_BRUSHES=${WCDIR}/Brushes - local WCDIR_PALETTES=${WCDIR}/Palettes - local WCDIR_PATTERNS=${WCDIR}/Patterns - local WCDIR_FONTS=${WCDIR}/Fonts - local WCDIR_EDITOR=${PREPARE_CONFIG_DIR} - - # Verify required working copy directory structure. If these - # directories don't exist, there isn't a target location where - # configuration links can point to. To prevent such an issue - # output an error message and stop the script execution after it. - for DIR in $(echo "Brushes Palettes Patterns Fonts");do - cli_checkFiles ${WCDIR}/${DIR} - done - - # Define link relation for cli. - LINKS_SRC[((++${#LINKS_SRC[*]}))]=${APPS_DIR}/${CLI_NAME} - LINKS_DST[((++${#LINKS_DST[*]}))]=${CLI_BASEDIR}/${CLI_NAME}.sh - USERFILES="${APPS_DIR}/${CLI_NAME}" - - # Define link relation for fonts. - for FONT in $(cli_getFilesList "${WCDIR_FONTS}" --pattern='^.+\.ttf$');do - LINKS_SRC[((++${#LINKS_SRC[*]}))]=${FONT_DIR}/$(basename $FONT) - LINKS_DST[((++${#LINKS_DST[*]}))]=${FONT} - done - - # Define link relation for common palettes. - for PALETTE in $(cli_getFilesList "${WCDIR_PALETTES}" --pattern="^.+\.gpl$");do - LINKS_SRC[((++${#LINKS_SRC[*]}))]=${GIMP_DIR_PALETTES}/$(prepare_getLinkName ${WCDIR_PALETTES} ${PALETTE}) - LINKS_DST[((++${#LINKS_DST[*]}))]=${PALETTE} - LINKS_SRC[((++${#LINKS_SRC[*]}))]=${INKS_DIR_PALETTES}/$(prepare_getLinkName ${WCDIR_PALETTES} ${PALETTE}) - LINKS_DST[((++${#LINKS_DST[*]}))]=${PALETTE} - done - - # Define link relation for common brushes. - for BRUSH in $(cli_getFilesList "${WCDIR_BRUSHES}" --pattern="^.+\.(gbr|gih)$");do - LINKS_SRC[((++${#LINKS_SRC[*]}))]=${GIMP_DIR_BRUSHES}/$(prepare_getLinkName ${WCDIR_BRUSHES} ${BRUSH}) - LINKS_DST[((++${#LINKS_DST[*]}))]=${BRUSH} - done - - # Define link relation for common patterns. - for PATTERN in $(cli_getFilesList "${WCDIR_PATTERNS}" --pattern="^.+\.png$");do - LINKS_SRC[((++${#LINKS_SRC[*]}))]=${GIMP_DIR_PATTERNS}/$(prepare_getLinkName ${WCDIR_BRUSHES} ${BRUSH}) - LINKS_DST[((++${#LINKS_DST[*]}))]=${PATTERN} - done - - # Define link relation for Vim text editor's configuration. - if [[ $EDITOR == '/usr/bin/vim' ]];then - LINKS_SRC[((++${#LINKS_SRC[*]}))]=${HOME}/.vimrc - LINKS_DST[((++${#LINKS_DST[*]}))]=${WCDIR_EDITOR}/vim.conf - USERFILES="${USERFILES} ${HOME}/.vimrc" - fi - - # Define link relation for the `reset.css' file. The `reset.css' - # file is resets the web browser default style and use ours - # instead. The reset.css file is common for all web environments - # so there is no need to have duplicated files inside the working - # copy. Instead, create a symbolic link to it from different - # places using absolute paths and the default style guide as - # reference. - LINKS_SRC[((++${#LINKS_SRC[*]}))]=${TCAR_WORKDIR}/Identity/Webenv/Themes/Default/Docbook/1.69.1/Css/reset.css - LINKS_DST[((++${#LINKS_DST[*]}))]=${TCAR_WORKDIR}/Identity/Webenv/Themes/Default/Style-guide/0.0.1/Css/reset.css - - # Define link relation for `images' directory used inside the - # default web environment style guide. The `images' directory - # contains common images used by all web environments. By default - # no image is under version control so we point out the output - # directory where this images produced, once rendered. - LINKS_SRC[((++${#LINKS_SRC[*]}))]=${TCAR_WORKDIR}/Identity/Webenv/Themes/Default/Style-guide/0.0.1/Images - LINKS_DST[((++${#LINKS_DST[*]}))]=${TCAR_WORKDIR}/Identity/Images/Webenv - - # Define link relation for `Manuals' images. These images exists - # to help people describe ideas inside documentation. - LINKS_SRC[((++${#LINKS_SRC[*]}))]=${TCAR_WORKDIR}/Identity/Images/Webenv/Manuals - LINKS_DST[((++${#LINKS_DST[*]}))]=${TCAR_WORKDIR}/Identity/Images/Manuals - - # Define link for `centos-logo.png', the branding information that - # should be used in all web applications on the left-top corner. - LINKS_SRC[((++${#LINKS_SRC[*]}))]=${TCAR_WORKDIR}/Identity/Images/Webenv/logo-centos.png - LINKS_DST[((++${#LINKS_DST[*]}))]=${TCAR_WORKDIR}/Identity/Images/Brands/Logos/White/78/centos.png - - # Define which files inside the user's configuration directories - # need to be removed in order for centos-art.sh script to make a - # fresh installation of common patterns, common palettes and - # common brushes using symbolic links from the working copy to the - # user's configuration directories inside the workstation. - USERFILES=$(echo "$USERFILES"; - cli_getFilesList ${APPS_DIR} --pattern='^.+\.sh$'; - cli_getFilesList ${FONT_DIR} --pattern='^.+\.ttf$'; - cli_getFilesList ${GIMP_DIR_BRUSHES} --pattern='^.+\.(gbr|gih)$'; - cli_getFilesList ${GIMP_DIR_PATTERNS} --pattern='^.+\.(pat|png|jpg|bmp)$'; - cli_getFilesList ${GIMP_DIR_PALETTES} --pattern='^.+\.gpl$'; - cli_getFilesList ${INKS_DIR_PALETTES} --pattern='^.+\.gpl$';) - - # Remove user-specific configuration files from user's home - # directory before creating symbolic links from the working copy. - # Otherwise, we might end up having links inside the user's home - # directory that don't exist inside the working copy. - if [[ "$USERFILES" != '' ]];then - rm -r $USERFILES - fi - - while [[ $COUNT -lt ${#LINKS_SRC[*]} ]];do - - # Print action message. - cli_printMessage "${LINKS_SRC[$COUNT]}" --as-creating-line - - # Create symbolic link's parent directory if it doesn't exist. - if [[ ! -d $(dirname ${LINKS_SRC[$COUNT]}) ]];then - mkdir -p $(dirname ${LINKS_SRC[$COUNT]}) - fi - - # Remove symbolic link before creating it to prevent recursive - # creation once the first symbolic link be created and it be a - # directory. - if [[ -a ${LINKS_SRC[$COUNT]} ]];then - rm ${LINKS_SRC[$COUNT]} - fi - - # Create symbolic link. - ln ${LINKS_DST[$COUNT]} ${LINKS_SRC[$COUNT]} --symbolic --force - - # Increment counter. - COUNT=$(($COUNT + 1)) - - done - -} diff --git a/Automation/Functions/Prepare/prepare_updateLocales.sh b/Automation/Functions/Prepare/prepare_updateLocales.sh deleted file mode 100755 index bb66e22..0000000 --- a/Automation/Functions/Prepare/prepare_updateLocales.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -# -# prepare_updateLocales.sh -- This function creates/updates the -# machine object (.mo) file gettext uses to output translated messages -# when centos-art.sh script is running. Certainly, what this function -# really does is a call to the locale functionality of centos-art.sh -# script to realize and update action against itself. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function prepare_updateLocales { - - # Realize localization tasks only when the current locale - # information is different to English language. Otherwise - # centos-art.sh would complain with an `English language cannot be - # localized to itself' message. Avoid this noise in the - # preparation stuff. - if [[ ! ${CLI_LANG_LL} =~ '^en' ]];then - cli_runFnEnvironment locale Scripts/Bash --update - fi - -} diff --git a/Automation/Functions/Prepare/prepare_updateManuals.sh b/Automation/Functions/Prepare/prepare_updateManuals.sh deleted file mode 100755 index a5f5a40..0000000 --- a/Automation/Functions/Prepare/prepare_updateManuals.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -# -# prepare_updateManuals.sh -- This option initializes documentation files -# inside the working copy. When you provide this option, the -# centos-art.sh script renders all documentation manuals from their -# related source files so you can read them nicely. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function prepare_updateManuals { - - # Render key documentation manuals. - cli_runFnEnvironment render Documentation/Models/Docbook/Tcar-ug - cli_runFnEnvironment help --update --format="texinfo" tcar-fs::: - -} diff --git a/Automation/Functions/Prepare/prepare_updatePackages.sh b/Automation/Functions/Prepare/prepare_updatePackages.sh deleted file mode 100755 index fdf2fc0..0000000 --- a/Automation/Functions/Prepare/prepare_updatePackages.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/bash -# -# prepare_updatePackages.sh -- This function verifies the required -# packages your workstation needs to have installed in order for -# `centos-art.sh' script to run correctly. If there is one or more -# missing packages, the `centos-art.sh' script asks you to confirm -# their installation through `sudo yum'. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function prepare_updatePackages { - - local PACKAGE='' - local PACKAGES='' - local PACKAGES_THIRDS='' - local -a PACKAGES_MISSING - local -a PACKAGES_INSTALL - local RPM='/bin/rpm' - local YUM='/usr/bin/yum' - local YUM_OPTIONS='' - - # Check execution rights of package managers. - cli_checkFiles -x $RPM - cli_checkFiles -x $YUM - - # Define required packages needed by centos-art.sh script. - PACKAGES="inkscape ImageMagick netpbm netpbm-progs syslinux gimp - coreutils texinfo texinfo-tex info tetex-latex tetex-fonts - tetex-xdvi tetex-dvips gettext texi2html 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 packages from third party repositories (i.e., packages - # not included in CentOS [base] repository.) required by - # centos-art to work as expected. - PACKAGES_THIRDS="(inkscape|blender)" - - # Build list of installed and missing packages. - for PACKAGE in $PACKAGES;do - $RPM -q --queryformat "%{NAME}\n" $PACKAGE --quiet - if [[ $? -ne 0 ]];then - PACKAGES_MISSING[((++${#PACKAGES_MISSING[*]}))]=$PACKAGE - else - PACKAGES_INSTALL[((++${#PACKAGES_INSTALL[*]}))]=$PACKAGE - fi - done - - # Define relation between centos-art.sh options and yum options. - [[ $FLAG_ANSWER == 'true' ]] && YUM_OPTIONS="${YUM_OPTIONS} -y" - [[ $FLAG_QUIET == 'true' ]] && YUM_OPTIONS="${YUM_OPTIONS} -q" - - # Use `sudo yum' to install missing packages in your workstation. - if [[ ${#PACKAGES_MISSING[*]} -gt 0 ]];then - sudo ${YUM} ${YUM_OPTIONS} install ${PACKAGES_MISSING[*]} - fi - - # Use `sudo yum' to update installed packages in your workstation. - if [[ ${#PACKAGES_INSTALL[*]} -gt 0 ]];then - sudo ${YUM} ${YUM_OPTIONS} update ${PACKAGES_INSTALL[*]} - fi - -} diff --git a/Automation/Functions/Render/Conf/conf.sh b/Automation/Functions/Render/Conf/conf.sh deleted file mode 100755 index 269e016..0000000 --- a/Automation/Functions/Render/Conf/conf.sh +++ /dev/null @@ -1,121 +0,0 @@ -#!/bin/bash -# -# conf.sh -- This function standardizes the way images are produced -# from configuration files. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function conf { - - # Initialize local variables. - local MODEL='' - local -a MODELS - local FORMAT='' - local HEIGHT='' - local FGCOLOR='' - local BGCOLOR='' - - # Define list with all section names. These are the final file - # names we want to produce images for. - local FILENAME='' - local FILENAMES=$(cli_getConfigSectionNames $TEMPLATE) - - for FILENAME in $FILENAMES;do - - # Retrieve models you want to produce the image from. Notice - # that relative path passed in this option must point to one - # existent file inside the working copy. - for MODEL in $(cli_getConfigValue "$TEMPLATE" "$FILENAME" "models");do - MODELS[((++${#MODELS[*]}))]=${TCAR_WORKDIR}/${MODEL} - done - - # Retrieve formats you want to produce the image for. This - # variable contains one or more image format supported by - # ImageMagick. For example, `xpm', `jpg', 'tiff', etc. - local FORMATS=$(cli_getConfigValue "$TEMPLATE" "$FILENAME" "formats") - if [[ -z ${FORMATS} ]];then - FORMATS="xpm pdf jpg tif" - fi - - # Retrieve heights you want to produce the image for. This - # variable contains one or more numerical values. For example, - # `16', `24', `32', etc. - local HEIGHTS=$(cli_getConfigValue "$TEMPLATE" "$FILENAME" "heights") - if [[ -z ${HEIGHTS} ]];then - HEIGHTS="16 20 22 24 32 36 38 40 48 64 72 78 96 112 124 128 148 164 196 200 512" - fi - - # Retrieve foreground colors you want to produce the image - # for. This variable contains one or more color number in - # hexadecimal format. For example, `000000', `ffffff', etc. - local FGCOLORS=$(cli_getConfigValue "$TEMPLATE" "$FILENAME" "fgcolors") - if [[ -z ${FGCOLORS} ]];then - FGCOLORS="000000" - fi - - # Retrieve background colors you want to produce the image - # for. This variable contains one or more color number in - # hexadecimal format with opacity information included. - # Opacity is specified between 0.0 and 1.0 where 0.0 is full - # transparency and 1.0 full opacity. For example, the - # following values are accepted: `000000-0', `ffffff-1', etc. - local BGCOLORS=$(cli_getConfigValue "$TEMPLATE" "$FILENAME" "bgcolors") - if [[ -z ${BGCOLORS} ]];then - BGCOLORS="000000-0" - fi - - # Retrieve command-line you want execute to produce the image. - # For example, `/usr/bin/convert +append' - local COMMAND=$(cli_getConfigValue "$TEMPLATE" "$FILENAME" "command") - if [[ -z ${COMMAND} ]];then - COMMAND=/bin/cp - fi - - for FGCOLOR in $FGCOLORS;do - - # Verify value passed as foreground color. - cli_checkFiles ${FGCOLOR} --match="^[a-fA-F0-9]{3,6}$" - - for BGCOLOR in $BGCOLORS;do - - # Verify value passed as background color. - cli_checkFiles ${BGCOLOR} --match="^[a-fA-F0-9]{6}-(0|1)$" - - for HEIGHT in $HEIGHTS;do - - # Verify value passed as height. - cli_checkFiles ${HEIGHT} --match="^[[:digit:]]+$" - - # Do base rendition actions. - conf_setBaseRendition - - done - done - done - - # Reset models list to prevent it from growing for each file - # name (configuration section) iteration and create this way - # unexpected images as final result. - unset MODELS - - done - -} diff --git a/Automation/Functions/Render/Conf/conf_setBaseRendition.sh b/Automation/Functions/Render/Conf/conf_setBaseRendition.sh deleted file mode 100755 index 4962373..0000000 --- a/Automation/Functions/Render/Conf/conf_setBaseRendition.sh +++ /dev/null @@ -1,126 +0,0 @@ -#!/bin/bash -# -# conf_setBaseRendition.sh -- This function standardizes base actions -# related to image production through configuration files. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function conf_setBaseRendition { - - local COUNTER=0 - local EXPORTID="CENTOSARTWORK" - local -a MODEL_INSTANCES - local -a IMAGE_INSTANCES - local -a IMAGE_COMMANDS - - # Define absolute path to output location. This is the location - # inside the working copy all images will be stored in. - local OUTPUT=${OUTPUT}/${FGCOLOR}/${BGCOLOR}/${HEIGHT}/${FILENAME} - - # Define which command will be used to output the template - # content. This is required because template files might be found - # as compressed files inside the repository. - local VIEWER="/bin/cat" - - while [[ $COUNTER -lt ${#MODELS[*]} ]];do - - # Verify existence and extension of design models. - cli_checkFiles ${MODELS[$COUNTER]} -f --match='\.(svgz|svg)$' - - # Define file name for design model instances. We need to use - # a random string in from of it to prevent duplication. - # Remember that different files can have the same name in - # different locations. Use the correct file information. - MODEL_INSTANCES[$COUNTER]=${TMPDIR}/${RANDOM}-$(basename ${MODELS[$COUNTER]}) - - # Define file name for image instances. We need to use a - # random string in from of it to prevent duplication. - # Remember that different files can have the same name in - # different locations. Use the correct file information. - IMAGE_INSTANCES[$COUNTER]=${TMPDIR}/${RANDOM}-$(basename ${MODELS[$COUNTER]} \ - | sed -r 's/\.(svgz|svg)$/.png/') - - # Redefine command used to read design models. - if [[ $(file -b -i ${MODELS[$COUNTER]}) =~ '^application/x-gzip$' ]];then - VIEWER="/bin/zcat" - fi - - # Create uncompressed design model instances in order to make - # color replacements without affecting original design models. - $VIEWER ${MODELS[$COUNTER]} > ${MODEL_INSTANCES[$COUNTER]} - - # Make your best to be sure the design model instance you are - # processing is a valid scalable vector graphic. - cli_checkFiles ${MODEL_INSTANCES[$COUNTER]} --mime="text/xml" - - # Make color replacements to each design model instance before - # render them using Inkscape. - if [[ ${FGCOLOR} != '000000' ]];then - sed -i -r "s/((fill|stroke):#)000000/\1${FGCOLOR}/g" ${MODEL_INSTANCES[$COUNTER]} - fi - - # Create list of Inkscape commands based for each design model - # set in the configuration file. - IMAGE_COMMANDS[${COUNTER}]="${MODEL_INSTANCES[$COUNTER]} \ - --export-id=${EXPORTID} \ - --export-png=${IMAGE_INSTANCES[$COUNTER]} \ - --export-background=$(echo ${BGCOLOR} | cut -d'-' -f1) \ - --export-background-opacity=$(echo ${BGCOLOR} | cut -d'-' -f2) \ - --export-height=${HEIGHT}" - - # Create PNG image based on design models. - inkscape ${IMAGE_COMMANDS[$COUNTER]} > /dev/null - - COUNTER=$(( $COUNTER + 1 )) - - done - - cli_printMessage "${OUTPUT}" --as-creating-line - - # Verify existence of output directory. - if [[ ! -d $(dirname ${OUTPUT}) ]];then - mkdir -p $(dirname ${OUTPUT}) - fi - - # Apply command to PNG images produced from design models to - # construct the final PNG image. - ${COMMAND} ${IMAGE_INSTANCES[*]} ${OUTPUT} - - # Remove instances to save disk space. There is no need to have - # unused files inside the temporal directory. They would be - # consuming space unnecessarily. Moreover, there is a remote - # chance of name collapsing (because the huge number of files that - # would be in place and the week random string we are putting in - # front of files) which may produce unexpected results. - rm ${IMAGE_INSTANCES[*]} ${MODEL_INSTANCES[*]} - - # Create path for different image formats creation using PNG image - # extension as reference. - local TARGET=$(echo ${OUTPUT} | sed -r "s/\.png$//") - - # Convert images from PNG to those formats specified in the - # configuration file. - for FORMAT in ${FORMATS};do - cli_printMessage "${TARGET}.${FORMAT}" --as-creating-line - convert ${OUTPUT} ${TARGET}.${FORMAT} - done - -} diff --git a/Automation/Functions/Render/Docbook/docbook.sh b/Automation/Functions/Render/Docbook/docbook.sh deleted file mode 100755 index 0cb4d7f..0000000 --- a/Automation/Functions/Render/Docbook/docbook.sh +++ /dev/null @@ -1,106 +0,0 @@ -#!/bin/bash -# -# docbook.sh -- This function performs base-rendition actions for -# DocBook files. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function docbook { - - # Define absolute path to XSL files used for transforming DocBook - # into other formats. - local DOCBOOK_XSL="${TCAR_WORKDIR}/Identity/Webenv/Themes/Default/Docbook/1.69.1/Xsl" - - # Define absolute path to DocBook models. This path must take - # until the directory which holds the main documentation docbook - # file. - local DOCBOOK_MODELS="$(dirname ${TEMPLATE})" - - # Verify absolute path to DocBook models. - cli_checkFiles ${DOCBOOK_MODELS} -d - - # Create the non-translated instance of design model. - cp ${TEMPLATE} ${INSTANCE} - - # Expand common contents inside instance. - docbook_setExpansionLicenses ${INSTANCE} - - # When translated instances are rendered, system entities (e.g., - # `%entity-name;') don't appear in the translated instance (it - # seems that xml2po removes them) and this provokes DocBook - # validation to fail. So in order to pass the validation - # successfully and automate the whole creation of system entities, - # don't let this duty ion users'. Instead, make centos-art.sh - # script responsible of it. - docbook_setExpansionSystemEntities ${INSTANCE} - - # Print validating action. - cli_printMessage "${INSTANCE}" --as-validating-line - - # Validate translated instance before processing it. This step is - # very important in order to detect document's malformations and - # warn you about it, so you can correct them. It is also necessary - # to save them in a new file in order to make translation markers - # expansion possible before transforming the DocBook instance into - # other formats. - xmllint --valid --noent ${INSTANCE} > ${INSTANCE}.tmp - if [[ $? -ne 0 ]];then - cli_printMessage "`gettext "Validation failed."`" --as-error-line - fi - - # Update instance to add translation markers expansion. - mv ${INSTANCE}.tmp ${INSTANCE} - - # Expand translation markers on the temporal instance with - # entities already expanded. - cli_expandTMarkers ${INSTANCE} - - # Verify translation file existence apply translation to docbook - # design model instance in order to produce the translated design - # model instance. - if [[ -f ${TRANSLATION} ]];then - docbook_setTranslation ${INSTANCE} - fi - - # Convert DocBook source files to other formats. - docbook_setConversionXhtmlChunks ${INSTANCE} - docbook_setConversionXhtml ${INSTANCE} - docbook_setConversionText - - # NOTE: The current transformation from DocBook to PDF fails when - # we started to use DocBook tags inside DocBook files. - # Probably we need to test what happen when a newer release of XSL - # is used. Thus, comment production of PDF files until it can be - # produced correctly. - #docbook_setConversionXml2Pdf - - # NOTE: From version 5.0 on, DocBook specification is no longer a - # SGML specification but an XML specification only. Thus, - # transformations related to DocBook SGML specification won't be - # supported in `centos-art.sh' script. - - # Perform format post-rendition. - docbook_setPostRendition - - # Perform format last-rendition. - docbook_setLastRendition - -} diff --git a/Automation/Functions/Render/Docbook/docbook_setConversionText.sh b/Automation/Functions/Render/Docbook/docbook_setConversionText.sh deleted file mode 100755 index 7c4673c..0000000 --- a/Automation/Functions/Render/Docbook/docbook_setConversionText.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash -# -# svg_convertToText.sh -- This function takes the XHTML file produced -# by docbook_setConversionXhtml and produces one plain-text file (i.e., -# without markup inside). -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function docbook_setConversionText { - - # Verify existence of HTML file. If `.xhtml' file doesn't exist - # don't create text file. The `.xhtml' file is required in order - # to create the `.txt' file. - if [[ ! -f ${FILE}.xhtml ]];then - return - fi - - local COMMAND='' - local OPTIONS='' - - # Define the command path to text-based web browser and options - # used to produce plain-text files. Most of these programs have a - # dump option that print formatted plain-text versions of given - # HTML file to stdout. - if [[ -x '/usr/bin/lynx' ]];then - COMMAND='/usr/bin/lynx' - OPTIONS='-force_html -nolist -width 70 -dump' - elif [[ -x '/usr/bin/elinks' ]];then - COMMAND='/usr/bin/elinks' - OPTIONS='-force_html -no-numbering -no-references -width 70 -dump' - elif [[ -x '/usr/bin/w3m' ]];then - COMMAND='/usr/bin/w3m' - OPTIONS='-dump' - fi - - if [[ $COMMAND != '' ]];then - - # Print action message. - if [[ -f ${FILE}.txt ]];then - cli_printMessage "${FILE}.txt" --as-updating-line - else - cli_printMessage "${FILE}.txt" --as-creating-line - fi - - # Convert from HTML to plain-text without markup. - ${COMMAND} ${OPTIONS} ${FILE}.xhtml > ${FILE}.txt - - else - cli_printMessage "`gettext "No way to convert from XHTML to plain-text found."`" --as-error-line - fi - -} diff --git a/Automation/Functions/Render/Docbook/docbook_setConversionXhtml.sh b/Automation/Functions/Render/Docbook/docbook_setConversionXhtml.sh deleted file mode 100755 index 1c9f0a6..0000000 --- a/Automation/Functions/Render/Docbook/docbook_setConversionXhtml.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/bash -# -# docbook_setConversionXhtml.sh -- This function uses DocBook XML as input -# and applies XSL stylesheets to produce a big XHTML files as output. -# The procedure was taken from the documentation of -# `docbook-style-xsl-1.69.1-5.1' package, which says: ---To publish -# HTML from your XML documents, you just need an XSL engine.---. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function docbook_setConversionXhtml { - - local -a STYLE_TEMPLATE - local -a STYLE_INSTANCE - local STYLE_INSTANCE_FINAL='' - - # Define absolute path to DocBook source file. This is the - # repository documentation manual file where DOCTYPE and ENTITY - # definition lines are set. - local SOURCE_FILE=${1} - - # Define absolute path to xhtml target file. This is the final - # location the xhtml file produced as result of DocBook to xhtml - # transformation will be stored in. - local TARGET_FILE=${FILE}-xhtml/$(basename ${FILE}).xhtml - - # Define absolute path to xhtml target file directory. This is the - # location the xhtml target file will be sotred in. - local TARGET_FILE_DIR=$(dirname ${TARGET_FILE}) - - # Print action message. - if [[ -f ${FILE}.xhtml ]];then - cli_printMessage "${TARGET_FILE}" --as-updating-line - else - cli_printMessage "${TARGET_FILE}" --as-creating-line - fi - - # Prepare XSL final instances used in transformations. - docbook_setStyles $(cli_getFilesList \ - ${DOCBOOK_XSL} --pattern='^.*/docbook2xhtml-(single|common)\.xsl$') - - # Clean up output directory. This is required in order to prevent - # old files from remaining therein when they are no longer needed. - if [[ -d ${TARGET_FILE_DIR} ]];then - rm -r "${TARGET_FILE_DIR}" - fi - mkdir ${TARGET_FILE_DIR} - - # Transform DocBook XML to XHTML suppressing all stderr output. - xsltproc --output ${TARGET_FILE} ${STYLE_INSTANCE_FINAL} ${SOURCE_FILE} &> /dev/null - - # Create `css' and `images' directories. In order to save disk - # space, these directories are linked (symbolically) to their - # respective locations inside the working copy. - ln -fs ${TCAR_WORKDIR}/Identity/Webenv/Themes/Default/Docbook/1.69.1/Css ${TARGET_FILE_DIR}/Css - ln -fs ${TCAR_WORKDIR}/Identity/Images/Webenv ${TARGET_FILE_DIR}/Images - - # Remove XSL instance files. - rm ${STYLE_INSTANCE[*]} - -} diff --git a/Automation/Functions/Render/Docbook/docbook_setConversionXhtmlChunks.sh b/Automation/Functions/Render/Docbook/docbook_setConversionXhtmlChunks.sh deleted file mode 100755 index 4caf61f..0000000 --- a/Automation/Functions/Render/Docbook/docbook_setConversionXhtmlChunks.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash -# -# docbook_setConversionXhtmlChunks.sh -- This function uses DocBook XML as -# input and applies XSL stylesheets to produce a directory with many -# XHTML files as output. The procedure was taken from the -# documentation of `docbook-style-xsl-1.69.1-5.1' package, which says: -# ---To publish HTML from your XML documents, you just need an XSLT -# engine.---. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function docbook_setConversionXhtmlChunks { - - local -a STYLE_TEMPLATE - local -a STYLE_INSTANCE - local STYLE_INSTANCE_FINAL='' - - # Define absolute path to DocBook source file. This is the - # repository documentation manual file where DOCTYPE and ENTITY - # definition lines are set. - local SOURCE_FILE=${1} - - # Define absolute path to XHTML target file. This is the final - # location the XHTML file produced as result of DocBook to PDF - # transformation will be stored in. - local TARGET_FILE="${FILE}-xhtml-chunks/" - - # Clean up output directory. This is required in order to prevent - # old files from remaining therein when they are no longer needed. - if [[ -d ${TARGET_FILE} ]];then - rm -r "${TARGET_FILE}" - fi - mkdir ${TARGET_FILE} - - # Print action message. - cli_printMessage "${TARGET_FILE}" --as-creating-line - - # Prepare XSL final instances used in transformations. - docbook_setStyles $(cli_getFilesList \ - ${DOCBOOK_XSL} --pattern='^.*/docbook2xhtml-(chunks|common)\.xsl$') - - # Transform DocBook XML to XHTML suppressing all stderr output. - xsltproc --output ${TARGET_FILE} ${STYLE_INSTANCE_FINAL} ${SOURCE_FILE} &> /dev/null - - # Create `css' and `images' directories. In order to save disk - # space, these directories are linked (symbolically) to their - # respective locations inside the working copy. Be sure to remove - # previous links first to prevent a recursive creation of links. - ln -sf ${TCAR_WORKDIR}/Identity/Webenv/Themes/Default/Docbook/1.69.1/Css ${TARGET_FILE}/Css - ln -sf ${TCAR_WORKDIR}/Identity/Images/Webenv ${TARGET_FILE}/Images - - # Remove XSL instance files. - rm ${STYLE_INSTANCE[*]} - -} diff --git a/Automation/Functions/Render/Docbook/docbook_setConversionXml2Pdf.sh b/Automation/Functions/Render/Docbook/docbook_setConversionXml2Pdf.sh deleted file mode 100755 index f639e93..0000000 --- a/Automation/Functions/Render/Docbook/docbook_setConversionXml2Pdf.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/bash -# -# docbook_setConversionXml2Pdf.sh -- This function transforms DocBook -# files which have set the XML DTD in them. To produce PDF from -# DocBook XML DTD, we need an XSLT engine (e.g., through `xsltproc' -# command) to produce formatting objects (FO), which then must be -# processed with an FO engine (e.g., through `pdfxmltex' command, -# which uses PassiveTex) to produce the PDF output. -# -# In this configuration and using default configuration settings, I've -# presented the following problems: -# -# 1. Something is wrong with headings. They are not expanded along the -# whole page-body. They seem to be rendered in a reduced width (1 inch -# approximately). This provokes the heading to be broken in a -# two-to-five letters column and sometimes it overlaps the sectioning -# titles (e.g., chapter, section). I tried to customize the value of -# `header.column.widths' and `page.margin.top' but it seems to be not -# there where I need to touch. -# -# 2. TOC's indentation is not rendered. Even the `toc.indent.width' -# property is set to 24 by default. -# -# 3. Inside lists, when items are more than one line, the indentation -# seems to work for the first line only. All other lines in the same -# item are not indented and begin completely unaligned. -# -# 4. Long file paths near the end of page-body aren't hyphenated. -# Even the `hyphenate' property is set to `true' by default. -# -# In this configuration and using default configuration settings, I've -# presented the following advantages: -# -# 1. It is possible to produce localized PDF outputs through -# `xml2po', the default way of producing localized content inside -# the `centos-art.sh' script. -# -# To make the whole process transparent, a temporal directory is -# created for intermediate works and final files are moved then to -# their final location. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function docbook_setConversionXml2Pdf { - - # Print action message. - cli_printMessage "${FILE}.pdf" --as-creating-line - - local -a STYLE_TEMPLATE - local -a STYLE_INSTANCE - local STYLE_INSTANCE_FINAL='' - - # Define absolute path to DocBook source file. This is the - # repository documentation manual file where DOCTYPE and ENTITY - # definition lines are set. - local SRC=${INSTANCE} - - # Define absolute path to PDF target file. This is the final - # location the PDF file produced as result of DocBook to PDF - # transformation will be stored in. - local DST="${FILE}.pdf" - - # Define file name of formatting object (.fo) file. This file is - # an intermediate file needed to produced the PDF. - local FO=$(echo ${INSTANCE} | sed -r 's/docbook$/fo/g') - - # Define file name of PDF file. This is the file we were looking - # for and the one moved, once produced. - local PDF=$(echo ${INSTANCE} | sed -r 's/docbook$/pdf/g') - - # Prepare XSL final instances used in transformations. - docbook_setStyles "${DOCBOOK_XSL}/docbook2fo.xsl" - - # Create link to `Images' directory. This is the directory where - # images used by documentation are stored in. Be sure to remove - # previous links first to prevent a recursive creation of links. - ln -sf ${TCAR_WORKDIR}/Identity/Images/Webenv $(dirname ${INSTANCE})/Images - - # Create formatting object suppressing output from stderr. - xsltproc --output ${FO} ${STYLE_INSTANCE_FINAL} ${SRC} 2> /dev/null - - # Create PDF format from formatting object. Because we are using - # relative path to access `Images', it is necessary to move the - # directory stack into the temporal directory where instance files - # are created. Otherwise, the location used to load images will - # fail. - if [[ $? -eq 0 ]];then - pushd $(dirname ${INSTANCE}) > /dev/null - xmlto -o $(dirname ${FILE}) pdf ${FO} - popd > /dev/null - else - cli_printMessage "`gettext "Cannot produce the PDF file."`" --as-error-line - fi - -} diff --git a/Automation/Functions/Render/Docbook/docbook_setExpansionLicenses.sh b/Automation/Functions/Render/Docbook/docbook_setExpansionLicenses.sh deleted file mode 100755 index cb3a032..0000000 --- a/Automation/Functions/Render/Docbook/docbook_setExpansionLicenses.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash -# -# docbook_setExpansionLicenses.sh -- This function modifies the final -# DocBook instance to add license information. We are doing this way -# because using XInclude doesn't work and we want to reuse license -# information in all documents. So, if we cannot link the files, we -# modify the final instance and append the license information to it. -# Later, to reuse translation messages, the locale functionality takes -# care of merging po files related to licenses into documentation po -# file so changes made to licenses translations will also be available -# to documentation manuals in different languages. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function docbook_setExpansionLicenses { - - local INSTANCE=$1 - - # Define absolute path to DocBook models. - local DOCBOOK_MODELS="${TCAR_WORKDIR}/Documentation/Models/Docbook" - - # Define list of files holding licenses you want to include. Note - # even this files are not inside the documentation structure - # itself, they are connected with it. The files holding license - # information does contain id information used inside the - # documentation structure at cross references. - local LICENSES="${DOCBOOK_MODELS}/Default/Licenses/Gpl/gpl.docbook \ - ${DOCBOOK_MODELS}/Default/Licenses/Gfdl/gfdl.docbook" - - # Define top level structure in the instance. This is the tag - # defined in the second field of DOCTYPE definition. - local DOCTYPE=$(egrep '^\n" - BLOCK="${BLOCK}\n\n" - BLOCK="${BLOCK}\n`gettext "Licenses"`\n" - BLOCK="${BLOCK}\n$(cat ${LICENSES} | sed -r '/<\?xml/,/]>/d')\n" - BLOCK="${BLOCK}\n\n" - BLOCK="${BLOCK}\n\n" - - # Expand the licenses section. Remove everything in-between - # Licenses and Back matter comment. Recreate the comments to - # support further actualizations and concatenate license - # information without their document type definitions preamble. - # This is required in order to prevent validation errors and reuse - # (through locale functionality) the translation messages already - # available for these license files. Finally, close any open tag. - sed -r -i -e "//,//c$(echo ${BLOCK})" $INSTANCE - -} diff --git a/Automation/Functions/Render/Docbook/docbook_setExpansionSystemEntities.sh b/Automation/Functions/Render/Docbook/docbook_setExpansionSystemEntities.sh deleted file mode 100755 index 090e09c..0000000 --- a/Automation/Functions/Render/Docbook/docbook_setExpansionSystemEntities.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash -# -# docbook_setExpansionSystemEntities.sh -- This function expands system -# entities required by DocBook projects stored under -# `Documentation/Manuals' directory. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function docbook_setExpansionSystemEntities { - - # Define absolute path to instance where all operations will take - # place in. - local INSTANCE=$1 - - # Define absolute path to both common and specific system - # entities. - local ENTITIES_PATHS="$(cli_getFilesList ${TCAR_WORKDIR}/Documentation/Models/Docbook/Default/Book $(dirname ${TEMPLATE}) \ - --pattern='^.*/[[:alpha:]-]+\.ent$' --maxdepth=1 --mindepth=1 --type='f')" - - # Build definition of both common and specific system entities. - local ENTITIES="$(\ - for ENTITY_PATH in $ENTITIES_PATHS;do - local ENTITY_NAME=$(basename ${ENTITY_PATH}) - echo '\n\t\n' - echo '\t%'${ENTITY_NAME}';' - done)" - - # Define both xml and docbook public definition. - local PREAMBLE="" - PREAMBLE="${PREAMBLE}\n" - - # Remove both xml and docbook preamble from instance and insert - # it again with definitions of required common and specific system - # entities. - sed -r -i "1,2c$(echo $PREAMBLE)" ${INSTANCE} - -} diff --git a/Automation/Functions/Render/Docbook/docbook_setLastRendition.sh b/Automation/Functions/Render/Docbook/docbook_setLastRendition.sh deleted file mode 100755 index 7205cd8..0000000 --- a/Automation/Functions/Render/Docbook/docbook_setLastRendition.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# -# docbook_setLastRendition.sh -- This function performs last-rendition -# actions for DocBook files. These are the actions that take -# base-rendition and post-rendition output as input to produce output -# from it. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function docbook_setLastRendition { - - # Presently, there is no last-rendition action for DocBook base - # rendition but the function should exist for consistency with - # other formats. - return - -} diff --git a/Automation/Functions/Render/Docbook/docbook_setPostRendition.sh b/Automation/Functions/Render/Docbook/docbook_setPostRendition.sh deleted file mode 100755 index 30afef9..0000000 --- a/Automation/Functions/Render/Docbook/docbook_setPostRendition.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -# -# docbook_setPostRendition.sh -- This function performs post-rendition -# actions for DocBook files. These are the actions that take -# base-rendition output as input to producing output from it. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function docbook_setPostRendition { - - # Presently, there is no post-rendition action for DocBook base - # rendition but the function should exist for consistency with - # other formats. - return - -} diff --git a/Automation/Functions/Render/Docbook/docbook_setStyles.sh b/Automation/Functions/Render/Docbook/docbook_setStyles.sh deleted file mode 100755 index 8700f0f..0000000 --- a/Automation/Functions/Render/Docbook/docbook_setStyles.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/bash -# -# docbook_setStyles.sh -- This function prepares styles' final -# instances, used in transformations and based on XSL or DSL -# templates. There might be translation markers inside the XSL and -# DSL templates that need to be expanded before they can be used for -# transformations. This function creates temporal instances of XSL -# and DSL templates with translation markers expanded inside so as for -# transformation commands (e.g., `xmltproc' or `openjade' through -# `docbook2pdf') to use as style definition. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function docbook_setStyles { - - local STYLE_TEMPLATE_FILE='' - local STYLE_TEMPLATE_FILES=$@ - local STYLE_INSTANCE_COMMON='' - local COUNT=0 - - for STYLE_TEMPLATE_FILE in $STYLE_TEMPLATE_FILES;do - - STYLE_TEMPLATE[((++${#STYLE_TEMPLATE[*]}))]="${STYLE_TEMPLATE_FILE}" - STYLE_INSTANCE[((++${#STYLE_INSTANCE[*]}))]="$(cli_getTemporalFile ${STYLE_TEMPLATE_FILE})" - - # Keep track of array's real index value. Remember, it starts - # at zero but counting starts at 1 instead. So, subtracting 1 - # from counting we have the real index value we need to work - # with the information stored in the array. - COUNT=$(( ${#STYLE_INSTANCE[*]} - 1 )) - - # Create style instance from style template. - cp ${STYLE_TEMPLATE[$COUNT]} ${STYLE_INSTANCE[$COUNT]} - - # Define both final an common style instances based on style - # templates. - if [[ $STYLE_TEMPLATE_FILE =~ 'docbook2fo\.xsl$' ]];then - STYLE_INSTANCE_FINAL=${STYLE_INSTANCE[$COUNT]} - elif [[ $STYLE_TEMPLATE_FILE =~ 'docbook2pdf\.dsl$' ]];then - STYLE_INSTANCE_FINAL=${STYLE_INSTANCE[${COUNT}]} - elif [[ $STYLE_TEMPLATE_FILE =~ 'docbook2xhtml-(chunks|single)\.xsl$' ]];then - STYLE_INSTANCE_FINAL=${STYLE_INSTANCE[${COUNT}]} - elif [[ $STYLE_TEMPLATE_FILE =~ 'docbook2xhtml-common\.xsl$' ]];then - STYLE_INSTANCE_COMMON=${STYLE_INSTANCE[${COUNT}]} - fi - - done - - # Verify style final instance. This is the file used by - # transformation command (`xsltproc' or `openjade') to produce the - # specified output. We cannot continue without it. - cli_checkFiles -e $STYLE_INSTANCE_FINAL - - # Expand common translation markers in the common style instance, - # if it exists. - if [[ -f $STYLE_INSTANCE_COMMON ]];then - cli_expandTMarkers $STYLE_INSTANCE_COMMON - fi - - # Expand specific translation markers in final style instance. - sed -r -i "s!=STYLE_XHTML_COMMON=!${STYLE_INSTANCE_COMMON}!" ${STYLE_INSTANCE_FINAL} - -} diff --git a/Automation/Functions/Render/Docbook/docbook_setTranslation.sh b/Automation/Functions/Render/Docbook/docbook_setTranslation.sh deleted file mode 100755 index 1d6bad7..0000000 --- a/Automation/Functions/Render/Docbook/docbook_setTranslation.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/bin/bash -# -# docbook_setTranslation.sh -- This function standardizes the way -# translation files are applied to DocBook design models in order to -# produce the translated instance that is used to expand translation -# markers and produce different output formats. -# -# Assuming no translation file exists, an untranslated instance is -# taken from the design model and created (i.e., just a copy) from it. -# Using a design model instance (translated or not) is required in -# order to expand translation markers safely. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function docbook_setTranslation { - - # Print final location of translation file. - cli_printMessage "${TRANSLATION}" --as-translation-line - - # Create translation instance to combine both template translation - # and licenses translations. - local TRANSLATION_INSTANCE=${TMPDIR}/messages.po - - # Define path to DocBook locales using models as reference. - local DOCBOOK_LOCALES=$(cli_getLocalizationDir "$DOCBOOK_MODELS") - - # Define list of all locale files you want to combine. This - # include the localization files related to all different kind of - # licenses you want to use in the main documentation file and the - # localization file of the main documentation file, as well. - local DOCBOOK_PO_FILES="${TCAR_WORKDIR}/Locales/Documentation/Models/Docbook/Default/Licenses/Gfdl/${CLI_LANG_LC}/messages.po \ - ${TCAR_WORKDIR}/Locales/Documentation/Models/Docbook/Default/Licenses/Gpl/${CLI_LANG_LC}/messages.po \ - ${TRANSLATION}" - - # Be sure the files we want to combine do exist. - cli_checkFiles -e ${DOCBOOK_PO_FILES} - - # Combine license translations with template translation in order - # to reuse licenses translations in template files without - # including them in template portable objects. In the case of - # DocBook templates, translations related to licenses are required - # because license content is expanded at execution time inside the - # DocBook instance used by XSL processor during transformation. - msgcat --output=${TRANSLATION_INSTANCE} \ - --width=70 --no-location --use-first ${DOCBOOK_PO_FILES} - - # At this point the translation instance with both licenses and - # manual translations have been saved. Now it is required to - # expand entities so it could be possible to create a translated - # instance with all the content inside. - - # Print action message. - cli_printMessage "${INSTANCE}" --as-translating-line - - # Create the translated instance of design model instance with all - # entities and translation markers expanded. - xml2po -a -l ${CLI_LANG_LL} \ - -p ${TRANSLATION_INSTANCE} \ - -o ${INSTANCE}-${CLI_LANG_LL}.tmp ${INSTANCE} - - # Rename final instance so it can be treated as just instance. - mv ${INSTANCE}-${CLI_LANG_LL}.tmp ${INSTANCE} - - # Remove .xml2po.mo temporal file. - if [[ -f ${PWD}/.xml2po.mo ]];then - rm ${PWD}/.xml2po.mo - fi - - # Verify instance existence. - cli_checkFiles -e $INSTANCE - -} diff --git a/Automation/Functions/Render/Svg/svg.sh b/Automation/Functions/Render/Svg/svg.sh deleted file mode 100755 index df419c6..0000000 --- a/Automation/Functions/Render/Svg/svg.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash -# -# svg.sh -- This function performs base-rendition action for SVG -# files. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg { - - # Apply translation to design model in order to produce the - # translated design model instance. - svg_doTranslation - - # Expand translation markers inside design model instance. - cli_expandTMarkers ${INSTANCE} - - # Initialize the export id used inside design templates. This - # value defines the design area we want to export. - local EXPORTID='CENTOSARTWORK' - - # Verify the export id. - svg_checkModelExportId "$INSTANCE" "$EXPORTID" - - # Check existence of external files. Inside design templates and - # their instances, external files are used to refer the background - # information required by the design template. If such background - # information is not available the image is produced without - # background information. This is something that need to be - # avoided. - svg_checkModelAbsref "$INSTANCE" - - # Render template instance using inkscape and save the output. - local INKSCAPE_OUTPUT="$(\ - inkscape $INSTANCE --export-id=$EXPORTID --export-png=${FILE}.png)" - - # Modify output from inkscape to fit the centos-art.sh script - # output visual style. - cli_printMessage "$(echo "$INKSCAPE_OUTPUT" | egrep '^Area' \ - | sed -r "s!^Area!`gettext "Area"`:!")" --as-inkscape-line - cli_printMessage "$(echo "$INKSCAPE_OUTPUT" | egrep '^Background' \ - | sed -r "s!^Background (RRGGBBAA):(.*)!`gettext "Background"`: \1 \2!")" --as-inkscape-line - cli_printMessage "$(echo "$INKSCAPE_OUTPUT" | egrep '^Bitmap saved as' \ - | sed -r "s!^Bitmap saved as:!`gettext "Saved as"`:!")" --as-inkscape-line - - # Perform format post-rendition. - svg_doPostActions - - # Perform format last-rendition. - svg_doLastActions - -} diff --git a/Automation/Functions/Render/Svg/svg_checkColorAmount.sh b/Automation/Functions/Render/Svg/svg_checkColorAmount.sh deleted file mode 100755 index 8d25900..0000000 --- a/Automation/Functions/Render/Svg/svg_checkColorAmount.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -# -# svg_checkColorAmount.sh -- This function verifies whether the list -# of colors provided in the first argument matches the amount of -# colors specified by the second argument. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_checkColorAmount { - - # Define list of colors. - local COLORS=$1 - - # Define the amount of colors the list provided must have, in - # order to be considered as valid. - local NUMBER=$2 - - # Verify amount of colors provided in the list. - if [[ $(echo "$COLORS" | wc -l) -ne $NUMBER ]];then - cli_printMessage "`gettext "The palette does not have the correct number of colors."`" --as-error-line - fi - -} diff --git a/Automation/Functions/Render/Svg/svg_checkColorFormats.sh b/Automation/Functions/Render/Svg/svg_checkColorFormats.sh deleted file mode 100755 index 19ddd9d..0000000 --- a/Automation/Functions/Render/Svg/svg_checkColorFormats.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/bash -# -# svg_checkColorFormats.sh -- This function verifies formats of colors -# (i.e., the way color information is specified). -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_checkColorFormats { - - # Define short options. - local ARGSS='' - - # Define long options. - local ARGSL='format:' - - # Initialize pattern used for color sanitation. - local PATTERN='^#[0-9a-f]{6}$' - - # Initialize arguments with an empty value and set it as local - # variable to this function scope. Doing this is very important to - # avoid any clash with higher execution environments. - local ARGUMENTS='' - - # Prepare ARGUMENTS variable for getopt. - cli_parseArgumentsReDef "$@" - - # Redefine ARGUMENTS using getopt(1) command parser. - cli_parseArguments - - # Redefine positional parameters using ARGUMENTS variable. - eval set -- "$ARGUMENTS" - - # Look for options passed through positional parameters. - while true;do - - case "$1" in - - --format ) - - case "$2" in - - rrggbb|*) - PATTERN='^#[0-9a-f]{6}$' - ;; - - esac - shift 2 - ;; - - -- ) - shift 1 - break - ;; - esac - done - - # Define the location we want to apply verifications to. - local COLOR='' - local COLORS="$@" - - # Loop through colors and perform format verification as specified - # by pattern. - for COLOR in $COLORS;do - - if [[ ! $COLOR =~ $PATTERN ]];then - cli_printMessage "`eval_gettext "The \\\"\\\$COLOR\\\" string is not a valid color code."`" --as-error-line - fi - - done - -} diff --git a/Automation/Functions/Render/Svg/svg_checkModelAbsref.sh b/Automation/Functions/Render/Svg/svg_checkModelAbsref.sh deleted file mode 100755 index 4775e26..0000000 --- a/Automation/Functions/Render/Svg/svg_checkModelAbsref.sh +++ /dev/null @@ -1,141 +0,0 @@ -#!/bin/bash -# -# svg_checkModelAbsref.sh -- This function retrives absolute files and -# checks their existence. In order for design templates to point -# different artistic motifs, design templates make use of external -# files which point to specific artistic motif background images. If -# such external files don't exist, try to create the background image -# required by cropping a higher background image (e.g., -# 2048x1536-final.png). If this isn't possible neither, then create -# the background image using a plain color and crop from it then. We -# can't go on without the required background information. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_checkModelAbsref { - - local FILE='' - local BG_DST_FILES='' - local BG_DST_FILE='' - local BG_DST_FILE_WIDTH='' - local BG_DST_FILE_HEIGHT='' - local BG_SRC_FILE='' - local BG_SRC_FILE_COLOR='' - local BG_SRC_FILE_WIDTH='' - local BG_SRC_FILE_HEIGHT='' - - # Define absolute path to the translated instance of design model. - FILE="$1" - - # Verify existence of file we need to retrive absolute paths from. - cli_checkFiles -e "$FILE" - - # Retrive absolute paths from file. - BG_DST_FILES=$(egrep "(sodipodi:absref|xlink:href)=\"${HOME}.+" $FILE \ - | sed -r "s,.+=\"(${HOME}.+\.png)\".*,\1," | sort | uniq) - - # Verify absolute paths retrived from file. - for BG_DST_FILE in $BG_DST_FILES;do - - # Print action message. - cli_printMessage "$BG_DST_FILE" --as-checking-line - - # Verify parent directory of absolute files retrived from - # file. This is required to prevent the construction of paths - # to locations that don't exist. For example, when including - # background images in SVG files, it is possible that the path - # information inside SVG files get outdated temporarly. If in - # that exact moment, you try to render the SVG file it won't - # be possible to create the image used for cropping because - # the path build from the location inside SVG file doesn't - # exist. In this case, centos-art.sh script will end up with - # `file ... doesn't exist' errors. - cli_checkFiles -d "$(dirname ${BG_DST_FILE})" - - if [[ ! -a $BG_DST_FILE ]];then - - # Define the source background file, the image file will - # crop when no specific background informatio be available - # for using. Generally, this is the most reusable - # background file inside the artistic motifs (e.g,. the - # `2048x1536-final.png' file). We can use this image file - # to create almost all artworks inside The CentOS - # Distribution visual manifestation when - # resolution-specific backgrounds don't exist. - BG_SRC_FILE=$(echo $BG_DST_FILE \ - | sed -r "s!(.+)/[[:digit:]]+x[[:digit:]]+(-final\.png)!\1/2048x1536\2!") - - # Verify existence of source background file. If the file - # doesn't exist create it using The CentOS Project default - # background color information, as specified in its - # corporate identity manual. - if [[ ! -f $BG_SRC_FILE ]];then - - # Define plain color that will be used as background. - BG_SRC_FILE_COLOR=$(svg_getColors) - - # Verify format of color value. - svg_checkColorFormats $BG_SRC_FILE_COLOR --format='rrggbb' - - # Define width for the source background file the - # required background information is cropped from. - BG_SRC_FILE_WIDTH=$(echo $BG_SRC_FILE \ - | sed -r 's!.+/([[:digit:]]+)x[[:digit:]]+-final\.png!\1!') - - # Define height for the source background file the - # required background information is cropped from. - BG_SRC_FILE_HEIGHT=$(echo $BG_SRC_FILE \ - | sed -r 's!.+/[[:digit:]]+x([[:digit:]]+)-final\.png!\1!') - - # Print action message. - cli_printMessage "${BG_SRC_FILE} ($BG_SRC_FILE_COLOR)" --as-creating-line - - # Create the source background file. - ppmmake -quiet ${BG_SRC_FILE_COLOR} \ - ${BG_SRC_FILE_WIDTH} ${BG_SRC_FILE_HEIGHT} \ - | pnmtopng > ${BG_SRC_FILE} - - fi - - # Print action message. - cli_printMessage "$BG_SRC_FILE" --as-cropping-line - - # Define the width of the required background information. - BG_DST_FILE_WIDTH=$(echo $BG_DST_FILE \ - | sed -r 's!.+/([[:digit:]]+)x[[:digit:]]+-final\.png!\1!') - - # Define the height of the required background information. - BG_DST_FILE_HEIGHT=$(echo $BG_DST_FILE \ - | sed -r 's!.+/[[:digit:]]+x([[:digit:]]+)-final\.png!\1!') - - # Create required backgrounnd information. - convert -quiet \ - -crop ${BG_DST_FILE_WIDTH}x${BG_DST_FILE_HEIGHT}+0+0 \ - ${BG_SRC_FILE} ${BG_DST_FILE} - - # Verify required background information. - cli_checkFiles -e $BG_DST_FILE - - fi - - done - -} diff --git a/Automation/Functions/Render/Svg/svg_checkModelExportId.sh b/Automation/Functions/Render/Svg/svg_checkModelExportId.sh deleted file mode 100755 index 2944195..0000000 --- a/Automation/Functions/Render/Svg/svg_checkModelExportId.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# -# svg_checkModelExportId.sh -- This function standardizes the export -# id used inside svg files and the way of verify them. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_checkModelExportId { - - local INSTANCE="$1" - local EXPORTID="$2" - - # Verify instance. - cli_checkFiles -e $INSTANCE - - # Verify export id. - if [[ $EXPORTID == '' ]];then - cli_printMessage "`gettext "The export id value cannot be empty."`" --as-error-line - fi - - # Check export id inside design templates. - grep "id=\"$EXPORTID\"" $INSTANCE > /dev/null - if [[ $? -gt 0 ]];then - cli_printMessage "`eval_gettext "There is not export id (\\\$EXPORTID) inside \\\"\\\$TEMPLATE\\\"."`" --as-error-line - fi - -} diff --git a/Automation/Functions/Render/Svg/svg_convertGplToHex.sh b/Automation/Functions/Render/Svg/svg_convertGplToHex.sh deleted file mode 100755 index 51efe26..0000000 --- a/Automation/Functions/Render/Svg/svg_convertGplToHex.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -# -# svg_convertGplToHex.sh -- This function takes one palette produced -# by Gimp (e.g., syslinux.gpl) as input and outputs the list of -# hexadecimal colors and their respective index position the -# `pnmtolss16' program needs (e.g., #RRGGBB=0 #RRGGBB=1 ... [all -# values in the same line]). -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_convertGplToHex { - - # Define path to GPL palette. This is the .gpl file we use to - # retrive color information from. - local PALETTE_GPL="$1" - - # Define path to HEX palette. This is the palette used to stored - # the color information the `ppmtolss16' program needs. - local PALETTE_HEX="$2" - - # Define the number of colors this function should return. - local NUMBER="$3" - - # Define list of colors from GPL palette. - local COLORS=$(svg_getColors $PALETTE_GPL --head=$NUMBER --tail=$NUMBER) - - # Verify number of colors returned in the list. They must match - # exactly the amount specified, no more no less. Sometimes, the - # list of colors may have less colors than it should have, so we - # need to prevent such palettes from being used. - svg_checkColorAmount "$COLORS" "$NUMBER" - - # Verify format of colors. - svg_checkColorFormats "$COLORS" --format='rrggbb' - - # Create list of colors to be processed by `pnmtolss16'. - echo "$COLORS" | nl | gawk '{ printf "%s=%d ", $2, $1 - 1 }' \ - > $PALETTE_HEX - - # Verify HEX palette existence. - cli_checkFiles -e $PALETTE_HEX - -} diff --git a/Automation/Functions/Render/Svg/svg_convertGplToPpm.sh b/Automation/Functions/Render/Svg/svg_convertGplToPpm.sh deleted file mode 100755 index 559127b..0000000 --- a/Automation/Functions/Render/Svg/svg_convertGplToPpm.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash -# -# svg_convertGplToPpm.sh -- This function takes one palette produced -# by Gimp (e.g., syslinux.gpl) as input and outputs one PPM file based -# on it (e.g., syslinux.ppm). -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_convertGplToPpm { - - local -a FILES - local COUNT=0 - - # Define path to GPL palette. This is the .gpl file we use to - # retrive color information from. - local PALETTE_GPL="$1" - - # Define path to PPM palette. This is the .ppm file we'll save - # color information to. - local PALETTE_PPM="$2" - - # Define the number of colors this function should return. - local NUMBER="$3" - - # Define list of colors from GPL palette. - local COLOR='' - local COLORS=$(svg_getColors "$PALETTE_GPL" --head=$NUMBER --tail=$NUMBER --format='rrrggbb') - - # Verify amount of colors in the list of colors. - svg_checkColorAmount "$COLORS" "$NUMBER" - - # Verify format of colors. - svg_checkColorFormats $COLORS --format='rrggbb' - - # Create temporal images (of 1x1 pixel each) to store each color - # retrived from Gimp's palette. - for COLOR in $COLORS;do - FILES[$COUNT]=$(cli_getTemporalFile ${COUNT}.ppm) - ppmmake $COLOR 1 1 > ${FILES[$COUNT]} - COUNT=$(($COUNT + 1)) - done - - # Concatenate each temporal image from left to right to create the - # PPM file. - pnmcat -lr ${FILES[*]} > $PALETTE_PPM - - # Remove temporal images used to build the PPM palette file. - rm ${FILES[*]} - - # Verify PPM palette existence. - cli_checkFiles -e "$PALETTE_PPM" - -} diff --git a/Automation/Functions/Render/Svg/svg_convertPngTo.sh b/Automation/Functions/Render/Svg/svg_convertPngTo.sh deleted file mode 100755 index 9fad7ba..0000000 --- a/Automation/Functions/Render/Svg/svg_convertPngTo.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -# -# svg_convertPngTo.sh -- This function provides post-rendition actions -# to use the `convert' command of ImageMagick tool set. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_convertPngTo { - - # Initialize image formats. - local FORMAT='' - local FORMATS=$(render_getConfigOption "$ACTION" '2') - - # Convert from PNG to specified formats. - for FORMAT in $FORMATS;do - cli_printMessage "${FILE}.${FORMAT}" --as-savedas-line - convert -quality 85 ${FILE}.png ${FILE}.${FORMAT} - done - -} diff --git a/Automation/Functions/Render/Svg/svg_convertPngToBranded.sh b/Automation/Functions/Render/Svg/svg_convertPngToBranded.sh deleted file mode 100755 index 8ffba47..0000000 --- a/Automation/Functions/Render/Svg/svg_convertPngToBranded.sh +++ /dev/null @@ -1,108 +0,0 @@ -#!/bin/bash -# -# svg_convertPngToBranded.sh -- This function standardizes image -# branding. Once the base PNG image is rendered and the -# `--with-brands' option is provided, this function composites a new -# branded image using the preferences set in the related -# `branding.conf' file. The `branding.conf' file must be stored -# inside the related design model component used as reference to -# produce the base PNG image. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_convertPngToBranded { - - # Verify whether the option `--with-brands' was provided or not to - # `centos-art.sh' script command-line. - if [[ $FLAG_WITH_BRANDS == 'false' ]];then - return - fi - - local BRANDING_CONF_FILE='' - local BRANDING_CONF_SECTION='' - local BRANDING_CONF_VALUES='' - local BRANDING_CONF_VALUE='' - local BRANDFILE='' - local POSITION='' - local POSITIONS='' - - # Define absolute path to branding configuration file. - BRANDING_CONF_FILE="$(dirname ${TEMPLATE})/branding.conf" - - # Verify absolute path to branding configuration file. This is - # required in order to avoid trying to render branded content - # which doesn't have an associated `branding.conf' file. If there - # is no associated `branding.conf' file don't stop the script - # execution. Instead, continue with the next action in the list. - # This is required in order to perform massive rendition inside - # structures like themes where components might or might not have - # `branding.conf' files associated. For example, the `Concept' - # component doesn't have branding information associated but most - # elements inside `Distro' component do. - if [[ ! -f "$BRANDING_CONF_FILE" ]];then - continue - fi - - # Define regular expression matching the variable name (i.e., the - # left column), inside the configuration line, you want to match - # on. - BRANDING_CONF_VARNAME=$(basename ${TEMPLATE}) - - # Define list of configuration lines related to current design - # model. This are the lines that tell us how and where to apply - # branding information on base PNG image. Be sure that only - # configuration lines from supported section names (e.g., - # `symbol', `type', `logo') be read, no need to waste resources - # with others. - BRANDING_CONF_VALUES=$(\ - for BRANDING_CONF_SECTION in $(echo "types symbols logos");do - cli_getConfigValue "${BRANDING_CONF_FILE}" "${BRANDING_CONF_SECTION}" "${BRANDING_CONF_VARNAME}" - done) - - for BRANDING_CONF_VALUE in $BRANDING_CONF_VALUES;do - - # Define absolute path to image file used as brand. This is - # the image put over the PNG image produced as result of - # design models base rendition. - BRANDFILE=${TCAR_WORKDIR}/Identity/Images/Brands/$(echo $BRANDING_CONF_VALUE \ - | gawk 'BEGIN{ FS=":" } { print $1 }' ) - - # Verify absolute path to image file used as brand. Assuming - # no brand image file is found, continue with the next - # configuration line. - if [[ ! -f $BRANDFILE ]];then - continue - fi - - # Define list of positions using the format of ImageMagick - # `-geometry' option argument. - POSITIONS=$(echo "$BRANDING_CONF_VALUE" | cut -d: -f2- | tr ':' ' ') - - # Loop through list of brand image positions and use the - # composite command from ImageMagick, to overlap the unbranded - # image just rendered with the branded version of itself. - for POSITION in $POSITIONS;do - composite -geometry ${POSITION} ${BRANDFILE} ${FILE}.png ${FILE}.png - done - - done - -} diff --git a/Automation/Functions/Render/Svg/svg_convertPngToDm.sh b/Automation/Functions/Render/Svg/svg_convertPngToDm.sh deleted file mode 100755 index 4ba8b10..0000000 --- a/Automation/Functions/Render/Svg/svg_convertPngToDm.sh +++ /dev/null @@ -1,183 +0,0 @@ -#!/bin/bash -# -# svg_convertPngToDm.sh -- This function standardize production of -# display managers (e.g., Gdm and Kdm). This function copies all files -# needed into a temporal directory, realize expansion of translation -# markers and packs all the files into a tar.gz package that is used -# for installation. This function must be used as last-rendition -# action for Gdm and Kdm directory specific base-rendition actions. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_convertPngToDm { - - # Print separator line. - cli_printMessage '-' --as-separator-line - - # Initialize source and destination local variables. - local SRC='' - local DST='' - - # Initialize display manager type. - local DM=$(render_getConfigOption "${ACTION}" '2') - - # Initialize screen resolutions used by display manager theme. - # These are the different screen resolutions a display manager - # theme is built for. The amount of screen resolution a display - # manager theme can be built for is limited to the amount of - # background files provided by the artistic motif used to build - # the display manager theme. - local RESOLUTION='' - local RESOLUTIONS=$(render_getConfigOption "${ACTION}" '3') - - # Verify screen resolutions. We cannot produce display manager - # theme if no screen resolution has been specified. - if [[ "$RESOLUTIONS" == '' ]];then - cli_printMessage "`gettext "There is no resolution information to process."`" --as-error-line - fi - - # Initialize theme information we are going to build the display - # manager theme for. - local THEME=$(cli_getPathComponent $ACTIONVAL --motif) - local THEME_NAME=$(cli_getPathComponent $ACTIONVAL --motif-name) - - # Initialize temporal directory where we collect all files needed - # in order to create the tar.gz file. This intermediate step is - # also needed in order to expand translation markers from XML and - # Desktop definitions. - local TMPDIR=$(cli_getTemporalFile 'dm') - - # Initialize source location for brands. This is the place where - # brand information, needed to build the display manager theme, is - # retrieved from. - local BRAND_BASEDIR=${TCAR_WORKDIR}/Identity/Images/Brands - - # Initialize source location for artistic motif's backgrounds. - # This is the place where background information needed to ubild - # the display manager theme is retrieved from. - local BGS=${TCAR_WORKDIR}/Identity/Images/Themes/${THEME}/Backgrounds/Img/Png - - # Initialize file variables. File variables are used build and - # process the file relation between source and target locations. - local FILE='' - local FILES='' - - # Define major release from template. - local MAJOR_RELEASE=$(cli_getPathComponent "$TEMPLATE" "--release-major") - - # Define file relation between source and target locations, based - # on whether we are producing GDM or KDM. Use the colon character - # (`:') as separator; on the left side we put the file's source - # location and in the right side the file's target location. - # Presently, both GDM and KDM are very similar on files with the - # exception that GDM does use icons near actions buttons (e.g., - # shutdown, reboot, session, language) and KDM doesn't. - case ${DM} in - - Gdm ) - FILES="\ - ${BRAND_BASEDIR}/Symbols/48/${TCAR_BRAND}.png:${TCAR_BRAND}-symbol.png - ${OUTPUT}/screenshot.png:screenshot.png - $(dirname $TEMPLATE)/GdmGreeterTheme.xml:${THEME_NAME}.xml - $(dirname $TEMPLATE)/GdmGreeterTheme.desktop:GdmGreeterTheme.desktop - $(dirname $TEMPLATE)/icon-language.png:icon-language.png - $(dirname $TEMPLATE)/icon-reboot.png:icon-reboot.png - $(dirname $TEMPLATE)/icon-session.png:icon-session.png - $(dirname $TEMPLATE)/icon-shutdown.png:icon-shutdown.png - " - ;; - - Kdm ) - FILES="\ - ${BRAND_BASEDIR}/Symbols/48/${TCAR_BRAND}.png:${TCAR_BRAND}-symbol.png - ${OUTPUT}/screenshot.png:screenshot.png - $(dirname $TEMPLATE)/GdmGreeterTheme.xml:${THEME_NAME}.xml - $(dirname $TEMPLATE)/GdmGreeterTheme.desktop:GdmGreeterTheme.desktop - " - ;; - - * ) - cli_printMessage "`eval_gettext "The \\\"\\\$DM\\\" display manager is not supported yet."`" --as-error-line - ;; - esac - - for FILE in $FILES;do - - # Define source location. - SRC=$(echo $FILE | cut -d: -f1) - - # Define target location. - DST=${TMPDIR}/${THEME_NAME}/$(echo $FILE | cut -d: -f2) - - # Verify source files. - cli_checkFiles -e $SRC - - # Verify parent directory for target file. - if [[ ! -d $(dirname $DST) ]];then - mkdir -p $(dirname $DST) - fi - - # Copy files from source to target location. - cp ${SRC} ${DST} - - # Expand translation markers. - if [[ ${DST} =~ "\.(xml|desktop)$" ]];then - cli_expandTMarkers "${DST}" - fi - - done - - # Move into temporal directory. - pushd $TMPDIR > /dev/null - - for RESOLUTION in $RESOLUTIONS;do - - # Verify background information. If it doesn't exist go on - # with the next one in the list. - if [[ ! -f $BGS/${RESOLUTION}-final.png ]];then - continue - fi - - # Print action message. - if [[ -f ${RESOLUTION}.tar.gz ]];then - cli_printMessage "${OUTPUT}/${RESOLUTION}.tar.gz" --as-updating-line - else - cli_printMessage "${OUTPUT}/${RESOLUTION}.tar.gz" --as-creating-line - fi - - # Copy background information. - cp $BGS/${RESOLUTION}-final.png ${THEME_NAME}/background.png - - # Create tar.gz file. - tar -czf ${RESOLUTION}.tar.gz ${THEME_NAME} - - # Move from temporal directory to its final location. - mv ${RESOLUTION}.tar.gz ${OUTPUT} - - done - - # Return to where we were initially. - popd > /dev/null - - # Remove temporal directory. - rm -r ${TMPDIR} - -} diff --git a/Automation/Functions/Render/Svg/svg_convertPngToGrub.sh b/Automation/Functions/Render/Svg/svg_convertPngToGrub.sh deleted file mode 100755 index 00da4d6..0000000 --- a/Automation/Functions/Render/Svg/svg_convertPngToGrub.sh +++ /dev/null @@ -1,148 +0,0 @@ -#!/bin/bash -# -# svg_convertPngToGrub.sh -- This function provides post-rendition -# action used to produce GRUB images. -# -# Initially, the color information is defined with GIMP (The GNU Image -# Manipulation Program) as a `.gpl' palette of color. This palette of -# colors contains 14 colors only and is saved in a file named -# `grub.gpl. The `grub.gpl' file is used to build the `grub.ppm' file -# which provide the color information needed to reduce the full color -# PNG image, produced as result of SVG base-rendition, to the amount -# of colors specified (i.e., 14 colors). Later, with the 14 color PNG -# image already created, the `grub.ppm' file is used to build the -# `splash.xpm.gz' file. -# -# In order for this function to work, the `grub.gpl' file should have -# a format similar to the following: -# -# GIMP Palette -# Name: CentOS-TreeFlower-4-Syslinux -# Columns: 14 -# # -# 32 76 141 204c8d -# 36 82 146 245292 -# 52 93 152 345d98 -# 72 108 162 486ca2 -# 102 131 176 6683b0 -# 126 153 190 7e99be -# 146 170 200 92aac8 -# 161 182 209 a1b6d1 -# 182 199 219 b6c7db -# 202 214 228 cad6e4 -# 221 230 238 dde6ee -# 235 241 245 ebf1f5 -# 246 251 254 f6fbfe -# 254 255 252 fefffc -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_convertPngToGrub { - - # Define number of colors the images will be produced on. - local COLORS='14' - - # Define options using those passed to actions from pre-rendition - # configuration script. These options are applied to pnmremap when - # doing color reduction, so any option available for pnmremap - # command can be passed to renderSyslinux functionality. - local OPTIONS=$(render_getConfigOption "$ACTION" '2-') - - # Check options passed to action. This is required in order to - # aviod using options used already in this script. For example - # -verbose and -mapfile options. - for OPTION in $OPTIONS;do - # Remove anything after equal sign inside option. - OPTION=$(echo -n $OPTION | cut -d'=' -f1) - if [[ "$OPTION" =~ "-(mapfile|verbose)" ]];then - cli_printMessage "`eval_gettext "The \\\"\\\$OPTION\\\" option is already used."`" --as-error-line - fi - done - - # Define file name prefix. - local PREFIX="-${COLORS}c" - - # Redefine file name prefix using options as reference. This is - # useful to differenciate final files produced using - # Floyd-Steinberg dithering and files which are not. - if [[ "$OPTIONS" =~ '-floyd' ]];then - PREFIX="${PREFIX}-floyd" - fi - - # Define logs' file. Log files are stored in the same place of - # images and are used to store output information produced by - # programs when the image files are built up. - local LOGS=${FILE}${PREFIX}.log - - # Define absolute path to GPL palette. This palettes should have - # 14 colors only. For more information on this see the GRUB's - # documentation. - local PALETTE_GPL=${MOTIF_DIR}/Palettes/grub.gpl - - # Verify GPL palette existence. If it doesn't exist copy the one - # provided by the design model through subversion (to keep track - # of the change) and expand translation markers in the copied - # instance. - if [[ ! -f $PALETTE_GPL ]];then - cli_runFnEnvironment vcs --copy ${MODEL_BASEDIR}/${FLAG_THEME_MODEL}/Palettes/grub.gpl ${PALETTE_GPL} - cli_expandTMarkers ${PALETTE_GPL} - fi - - # Define absolute path to PPM palette. The PPM palette is built - # from source palette (PALETTE_GPL) and provides the color - # information understood by `ppmremap', the program used to - # produce images in a specific amount of colors. - local PALETTE_PPM=$(cli_getTemporalFile "grub.ppm") - - # Create image in Netpbm superformat (PNM). The PNM image file is - # created from the PNG image rendered previously as centos-art - # base-rendition output. The PNM image is an intermediate format - # used to manipulate images through Netpbm tools. - cli_printMessage "${FILE}.pnm" --as-savedas-line - pngtopnm -verbose \ - < ${FILE}.png 2>${LOGS} > ${FILE}.pnm - - # Print the path to GPL palette. - cli_printMessage "$PALETTE_GPL" --as-palette-line - - # Create PPM palette using GPL palette. - svg_convertGplToPpm "$PALETTE_GPL" "$PALETTE_PPM" "$COLORS" - - # Reduce colors as specified in PPM palette. Here we use the PPM - # palette to enforce the color position in the image index and the - # Floyd-Steinberg dithering in order to improve color reduction. - cli_printMessage "${FILE}${PREFIX}.ppm" --as-savedas-line - pnmremap -verbose -mapfile=$PALETTE_PPM $OPTIONS \ - < ${FILE}.pnm 2>>${LOGS} > ${FILE}${PREFIX}.ppm - - # Remove PPM palette. It is no longer needed. - if [[ -f ${PALETTE_PPM} ]];then - rm $PALETTE_PPM - fi - - # Create the 14 colors xpm.gz file. - cli_printMessage "${FILE}${PREFIX}.xpm.gz" --as-savedas-line - ppmtoxpm \ - < ${FILE}${PREFIX}.ppm 2>>${LOGS} > ${FILE}.xpm \ - && gzip --force ${FILE}.xpm \ - && mv ${FILE}.xpm.gz ${FILE}${PREFIX}.xpm.gz - -} diff --git a/Automation/Functions/Render/Svg/svg_convertPngToIcons.sh b/Automation/Functions/Render/Svg/svg_convertPngToIcons.sh deleted file mode 100755 index 1c4a1af..0000000 --- a/Automation/Functions/Render/Svg/svg_convertPngToIcons.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash -# -# svg_convertPngToIcons.sh -- This function provides post-rendition -# actions to produce icon images in different sizes and formats from -# the same SVG design model. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_convertPngToIcons { - - # Define height dimensions you want to produce brands for. - local SIZE="" - local SIZES="16 20 22 24 32 36 40 48 64 96 128 148 164 196 200 512" - - # Define image formats you want to produce brands for. - local FORMAT="" - local FORMATS="" - - for SIZE in ${SIZES};do - - # Redefine absolute path to file location where size-specific - # images will be stored in. - local FINALFILE=$(dirname $FILE)/${SIZE}/$(basename $FILE) - - # Prepare directory where size-specific images will be stored - # in. If it doesn't exist create it. - if [[ ! -d $(dirname $FINALFILE) ]];then - mkdir -p $(dirname $FINALFILE) - fi - - # Print action message. - cli_printMessage "${FINALFILE}.png" --as-creating-line - - # Create size-specific PNG image ommiting all output. - inkscape $INSTANCE --export-id=$EXPORTID \ - --export-png=${FINALFILE}.png --export-height=${SIZE} \ - &> /dev/null - - #for FORMAT in ${FORMATS};do - # - # # Print action message. - # cli_printMessage "${FINALFILE}.${FORMAT}" --as-creating-line - # - # # Convert size-specific PNG image into different formats. - # convert ${FINALFILE}.png ${FINALFILE}.${FORMAT} - # - #done - - # Create copy of size-specific image in 2 colors. - #cli_printMessage "${FINALFILE}.xbm" --as-creating-line - #convert -colorspace gray -colors 2 ${FINALFILE}.png ${FINALFILE}.xbm - - # Create copy of size-specific image with emboss effect. - #cli_printMessage "${FINALFILE}-emboss.png" --as-creating-line - #convert -emboss 1 ${FINALFILE}.png ${FINALFILE}-emboss.png - - done - -} diff --git a/Automation/Functions/Render/Svg/svg_convertPngToKsplash.sh b/Automation/Functions/Render/Svg/svg_convertPngToKsplash.sh deleted file mode 100755 index 091245d..0000000 --- a/Automation/Functions/Render/Svg/svg_convertPngToKsplash.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/bash -# -# svg_convertPngToKsplash.sh -- This function collects KDE splash -# (KSplash) required files and creates a tar.gz package that groups -# them all together. Use this function as last-rendition action for -# KSplash base-rendition action. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_convertPngToKsplash { - - local -a SRC - local -a DST - local FONT='' - local COUNT=0 - - # Define font used to print bottom splash message. - FONT=$(svg_getTTFont "DejaVuLGCSans-Bold") - - # Check existence of font file. - cli_checkFiles -e "$FONT" - - # Define absolute source location of files. - SRC[0]="${OUTPUT}/splash_top.png" - SRC[1]="${OUTPUT}/splash_active_bar.png" - SRC[2]="${OUTPUT}/splash_inactive_bar.png" - SRC[3]="${OUTPUT}/splash_bottom.png" - SRC[4]="$(dirname $TEMPLATE)/Theme.rc" - - # Check absolute source location of files. - cli_checkFiles -e "${SRC[@]}" - - # Define relative target location of files. - DST[0]="${OUTPUT}/splash_top.png" - DST[1]="${OUTPUT}/splash_active_bar.png" - DST[2]="${OUTPUT}/splash_inactive_bar.png" - DST[3]="${OUTPUT}/splash_bottom.png" - DST[4]="${OUTPUT}/Theme.rc" - - # Print action message. - cli_printMessage "${OUTPUT}/Preview.png" --as-creating-line - - # Create `Preview.png' image. - convert -append ${SRC[0]} ${SRC[1]} ${SRC[3]} ${OUTPUT}/Preview.png - - # Add bottom text to Preview.png image. The text position was set - # inside an image of 400x300 pixels. If you change the final - # preview image dimension, you probably need to change the text - # position too. - mogrify -draw 'text 6,295 "KDE is up and running."' \ - -fill \#ffffff \ - -font $FONT \ - ${OUTPUT}/Preview.png - - # Copy `Theme.rc' file. - cp ${SRC[4]} ${DST[4]} - - # Apply common translation markers to Theme.rc file. - cli_expandTMarkers "${DST[4]}" - -} diff --git a/Automation/Functions/Render/Svg/svg_convertPngToSyslinux.sh b/Automation/Functions/Render/Svg/svg_convertPngToSyslinux.sh deleted file mode 100755 index d04b0a0..0000000 --- a/Automation/Functions/Render/Svg/svg_convertPngToSyslinux.sh +++ /dev/null @@ -1,189 +0,0 @@ -#!/bin/bash -# -# svg_convertPngToSyslinux.sh -- This function provides post-rendition -# action used to produce LSS16 images, the images used by isolinux. -# -# Initially, the color information is defined with GIMP (The GNU Image -# Manipulation Program) as a `.gpl' palette of color. This palette of -# colors contains 16 colors only and is saved in a file named -# `syslinux.gpl. The `syslinux.gpl' file is used to build two other -# files: the `syslinux.ppm' file and the `syslinux.hex' file. The -# `syslinux.ppm' provides the color information needed to reduce the -# full color PNG image, produced as result of SVG base-rendition, to -# the amount of colors specified (i.e., 16 colors). Later, with the 16 -# color PNG image already created, the `syslinux.hex' file is used to -# build the LSS16 image. -# -# In order to produce images in LSS16 format correctly, it is required -# that both the `syslinux.ppm' and `syslinux.hex' files do contain the -# same color information. This is, both `syslinux.ppm' and -# `syslinux.hex' must represent the same color values and in the same -# color index. -# -# In order for this function to work, the `syslinux.gpl' file should -# have a format similar to the following: -# -# GIMP Palette -# Name: CentOS-TreeFlower-4-Syslinux -# Columns: 16 -# # -# 32 76 141 204c8d -# 37 82 146 255292 -# 52 94 153 345e99 -# 73 110 162 496ea2 -# 91 124 172 5b7cac -# 108 136 180 6c88b4 -# 120 146 186 7892ba -# 131 158 193 839ec1 -# 255 255 255 ffffff -# 146 170 200 92aac8 -# 162 182 209 a2b6d1 -# 183 199 219 b7c7db -# 204 216 230 ccd8e6 -# 221 229 238 dde5ee -# 235 241 245 ebf1f5 -# 246 251 254 f6fbfe -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_convertPngToSyslinux { - - # Define number of colors the images will be produced on. - local COLORS='16' - - # Define options using those passed to actions from pre-rendition - # configuration script. These options are applied to pnmremap when - # doing color reduction, so any option available for pnmremap - # command can be passed to renderSyslinux functionality. - local OPTIONS=$(render_getConfigOption "$ACTION" '2-') - - # Check options passed to action. This is required in order to - # aviod using options already used in this script. For example - # -verbose and -mapfile options. - for OPTION in $OPTIONS;do - # Remove anything after equal sign inside option. - OPTION=$(echo $OPTION | cut -d'=' -f1) - if [[ "$OPTION" =~ "-(mapfile|verbose)" ]];then - cli_printMessage "`eval_gettext "The \\\"\\\$OPTION\\\" option is already used."`" --as-error-line - fi - done - - # Define default file name prefix for 16 colors images. - local PREFIX="-${COLORS}c" - - # Re-define 16 colors images default file name prefix using - # options as reference. This is useful to differenciate final - # files produced using Floyd-Steinberg dithering and final files - # which are not. - if [[ "$OPTIONS" =~ '-floyd' ]];then - PREFIX="${PREFIX}-floyd" - fi - - # Define logs' file. Log files are stored in the same place of - # images and are used to store output information produced by - # programs when the image files are built up. - local LOGS=${FILE}${PREFIX}.log - - # Define absolute path to GPL palette. The GPL palette defines the - # color information used to build syslinux images. This palette - # should be set to 16 colors and, as specified in isolinux - # documentation, the background color should be indexed on - # position 0 and the forground in position 7 (see - # /usr/share/doc/syslinux-X.XX/isolinux.doc, for more - # information.) - local PALETTE_GPL=${MOTIF_DIR}/Palettes/syslinux.gpl - - # Verify GPL palette existence. If it doesn't exist copy the one - # provided by the design model through subversion (to keep track - # of the change) and expand translation markers in the copied - # instance. - if [[ ! -f $PALETTE_GPL ]];then - cli_runFnEnvironment vcs --copy ${MODEL_BASEDIR}/${FLAG_THEME_MODEL}/Palettes/syslinux.gpl ${PALETTE_GPL} - cli_expandTMarkers ${PALETTE_GPL} - fi - - # Define absolute path to PPM palette. The PPM palette is built - # from source palette (PALETTE_GPL) and provides the color - # information understood by `ppmremap', the program used to - # produce images in a specific amount of colors. - local PALETTE_PPM=$(cli_getTemporalFile "syslinux.ppm") - - # Define the HEX palette. The HEX palette is built from source - # palette (PALETTE_GPL) and provides the color information in the - # format understood by `ppmtolss16', the program used to produce - # images in LSS16 format. The HEX palette stores just one line - # with the color information as described in isolinux - # documentation (i.e #RRGGBB=0 #RRGGBB=1 ... [all values in the - # same line]) - local PALETTE_HEX=$(cli_getTemporalFile "syslinux.hex") - - # Create image in Netpbm superformat (PNM). The PNM image file is - # created from the PNG image rendered previously as centos-art - # base-rendition output. The PNM image is an intermediate format - # used to manipulate images through Netpbm tools. - cli_printMessage "${FILE}.pnm" --as-savedas-line - pngtopnm -verbose \ - < ${FILE}.png 2>${LOGS} > ${FILE}.pnm - - # Print the path to GPL palette. - cli_printMessage "$PALETTE_GPL" --as-palette-line - - # Create PPM palette using GPL palette. - svg_convertGplToPpm "$PALETTE_GPL" "$PALETTE_PPM" "$COLORS" - - # Create HEX palette using GPL palette. - svg_convertGplToHex "$PALETTE_GPL" "$PALETTE_HEX" "$COLORS" - - # Reduce colors as specified in PPM palette. Here we use the PPM - # palette to enforce the color position in the image index and the - # Floyd-Steinberg dithering in order to improve color reduction. - cli_printMessage "${FILE}${PREFIX}.pnm" --as-savedas-line - pnmremap -verbose -mapfile=$PALETTE_PPM $OPTIONS \ - < ${FILE}.pnm 2>> ${LOGS} > ${FILE}${PREFIX}.pnm - - # Create LSS16 image. - cli_printMessage "${FILE}${PREFIX}.lss" --as-savedas-line - ppmtolss16 $(cat $PALETTE_HEX) \ - < ${FILE}${PREFIX}.pnm 2>>${LOGS} > ${FILE}${PREFIX}.lss - - # Remove HEX palette. It is no longer needed. - if [[ -f ${PALETTE_HEX} ]];then - rm $PALETTE_HEX - fi - - # Create PPM image indexed to 16 colors. Also the colormap used in - # the LSS16 image is saved on ${FILE}.log; this is useful to - # verify the correct order of colors in the image index. - cli_printMessage "${FILE}${PREFIX}.ppm" --as-savedas-line - lss16toppm -map \ - < ${FILE}${PREFIX}.lss 2>>${LOGS} > ${FILE}${PREFIX}.ppm - - # Create PNG image indexed to 16 colors. - cli_printMessage "${FILE}${PREFIX}.png" --as-savedas-line - pnmtopng -verbose \ - < ${FILE}${PREFIX}.pnm 2>>${LOGS} > ${FILE}${PREFIX}.png - - # Remove PPM palette. It is no longer needed. - if [[ -f ${PALETTE_PPM} ]];then - rm $PALETTE_PPM - fi - -} diff --git a/Automation/Functions/Render/Svg/svg_convertPngToThumbnail.sh b/Automation/Functions/Render/Svg/svg_convertPngToThumbnail.sh deleted file mode 100755 index 52dcf3b..0000000 --- a/Automation/Functions/Render/Svg/svg_convertPngToThumbnail.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash -# -# svg_convertPngToThumbnail.sh -- This function provides -# post-rendition to create thumbnails from images produced by -# centos-art base-rendition. Thumbnails are created in PNG and JPG -# format for you to decide which is the more appropriate one. When no -# size is specified, thumbnails are created at 250 pixels width and -# height is automatically calculated to match the image ratio. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_convertPngToThumbnail { - - # Get image size. - local SIZE='' - local SIZES=$(render_getConfigOption "$ACTION" '2-') - - # Check image sizes and do convertion. - if [[ "$SIZES" == "" ]];then - SIZES='250' - fi - - # Check base file existence. - cli_checkFiles -e "${FILE}.png" - - # Create thumbnails. - for SIZE in $SIZES;do - cli_printMessage "${FILE}-thumb-${SIZE}.png" --as-savedas-line - convert -thumbnail ${SIZE} ${FILE}.png ${FILE}-thumb-${SIZE}.png - cli_printMessage "${FILE}-thumb-${SIZE}.jpg" --as-savedas-line - convert -thumbnail ${SIZE} ${FILE}-thumb-${SIZE}.png ${FILE}-thumb-${SIZE}.jpg - cli_printMessage "${FILE}-thumb-${SIZE}.pdf" --as-savedas-line - convert -thumbnail ${SIZE} ${FILE}-thumb-${SIZE}.png ${FILE}-thumb-${SIZE}.pdf - done - -} diff --git a/Automation/Functions/Render/Svg/svg_doLastActions.sh b/Automation/Functions/Render/Svg/svg_doLastActions.sh deleted file mode 100755 index 5562eeb..0000000 --- a/Automation/Functions/Render/Svg/svg_doLastActions.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/bash -# -# svg_doLastActions.sh -- This function performs last-rendition -# actions for SVG files. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_doLastActions { - - # Verify position of file being produced in the list of files been - # currently processed. - if [[ $THIS_FILE_DIR == $NEXT_FILE_DIR ]];then - return - fi - - local ACTION='' - - # Redefine SVG last-rendition actions as local to avoid undesired - # concatenation when massive rendition is performed. - local -a LASTACTIONS - - # Define SVG directory-specific actions. This is required in order - # to provide a predictable way of producing content inside the - # repository and save you the time of writing long several - # commands each time you need to produce images inside the - # repository. - if [[ $FLAG_DONT_DIRSPECIFIC == 'false' ]];then - if [[ $TEMPLATE =~ "Distro/$(cli_getPathComponent --release-pattern)/Gdm/.+\.svg$" ]];then - LASTACTIONS[((++${#LASTACTIONS[*]}))]='convertPngToDm:Gdm:800x600 1024x768 1280x1024 1360x768 2048x1536 2560x1240' - elif [[ $TEMPLATE =~ "Distro/$(cli_getPathComponent --release-pattern)/Kdm/.+\.svg$" ]];then - LASTACTIONS[((++${#LASTACTIONS[*]}))]='convertPngToDm:Kdm:800x600 1024x768 1280x1024 1360x768 2048x1536 2560x1240' - elif [[ $TEMPLATE =~ "Distro/$(cli_getPathComponent --release-pattern)/Ksplash/.+\.svg$" ]];then - LASTACTIONS[((++${#LASTACTIONS[*]}))]='convertPngToKsplash:' - fi - fi - - # Define SVG last-rendition actions. Since last-rendition makes - # use of all files in the output directory structure and - # directory-specific rendition modifies all the files in the - # output directory structure as well, these actions must be - # defined after the directory-specific definition. Otherwise, - # modifications impossed by these actions may interfier the whole - # purpose of having a directory-specific rendition. - [[ $FLAG_LASTRENDITION != '' ]] && LASTACTIONS[((++${#LASTACTIONS[*]}))]="doLastActions:(png|jpg):${FLAG_LASTRENDITION}" - - # At this point centos-art.sh should be producing the last file - # from the same unique directory structure, so, before producing - # images for the next directory structure lets execute the list of - # last-rendition actions for the current directory structure. - for ACTION in "${LASTACTIONS[@]}"; do - svg_$(echo "$ACTION" | cut -d: -f1) - done - -} diff --git a/Automation/Functions/Render/Svg/svg_doLastCommand.sh b/Automation/Functions/Render/Svg/svg_doLastCommand.sh deleted file mode 100755 index 458ec6b..0000000 --- a/Automation/Functions/Render/Svg/svg_doLastCommand.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash -# -# svg_doLastCommand.sh -- This function standardizes the way -# last-rendition commands are applied to base-rendition and -# post-rendition outputs. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_doLastCommand { - - # Define the file extensions. This value is a regular expression - # pattern which must match the file extensions that last-rendition - # actions will be applied to. - local EXTENSION=$(render_getConfigOption "$ACTION" '2') - - # Define the command string that will be evaluated as - # last-rendition action. Only commands that perform in-place - # modifications can be passed here. - local COMMAND=$(render_getConfigOption "$ACTION" '3-') - - # Define the list of files to process. This value contain all the - # files in the output directory which extension match the - # extension pattern previously defined. - local FILE='' - local FILES=$(cli_getFilesList $OUTPUT --pattern="^.+\.${EXTENSION}$") - - for FILE in $FILES;do - - # Identify file before processing it. Only formats recognized - # by ImageMagick are supported. In case the file isn't - # supported by ImageMagick, continue with the next file in the - # list. - identify -quiet ${FILE} > /dev/null - if [[ $? -ne 0 ]];then - continue - fi - - # Print action message. - cli_printMessage "${FILE}" --as-updating-line - - # Execute mogrify action on all files inside the same - # directory structure. - eval ${COMMAND} ${FILE} - - # Be sure the command was executed correctly. Otherwise stop - # script execution. - if [[ $? -ne 0 ]];then - exit - fi - - done - -} diff --git a/Automation/Functions/Render/Svg/svg_doPostActions.sh b/Automation/Functions/Render/Svg/svg_doPostActions.sh deleted file mode 100755 index 86b998e..0000000 --- a/Automation/Functions/Render/Svg/svg_doPostActions.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/bash -# -# svg_doPostActions.sh -- This function performs post-rendition -# actions for SVG files. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_doPostActions { - - local ACTION='' - - # Redefine SVG post-rendition actions as local to avoid undesired - # concatenation when massive rendition is performed. - local -a POSTACTIONS - - # Define default comment written to base-rendition output. - local COMMENT="`gettext "Created in CentOS Artwork Repository"` ($(cli_printUrl '--svn')artwork/)" - - # Define SVG post-rendition actions. Since these actions are - # applied to base-rendition output and base-rendition output is - # used as reference to perform directory-specific rendition, these - # action must be defined before directory-specific rendition. - # Otherwise it wouldn't be possible to propagate changes imposed - # by these actions to new files produced as result of - # directory-specific rendition. - POSTACTIONS[((++${#POSTACTIONS[*]}))]="doPostCommand:png:mogrify -comment '$COMMENT'" - [[ $FLAG_POSTRENDITION != '' ]] && POSTACTIONS[((++${#POSTACTIONS[*]}))]="doPostCommand:png:${FLAG_POSTRENDITION}" - - # Define SVG directory-specific rendition. Directory-specfic - # rendition provides a predictable way of producing content inside - # the repository. - if [[ $FLAG_DONT_DIRSPECIFIC == 'false' ]];then - - if [[ $TEMPLATE =~ "Identity/(Models|Images)/Themes/.+\.${RENDER_EXTENSION}$" ]];then - - POSTACTIONS[((++${#POSTACTIONS[*]}))]="convertPngToBranded" - - if [[ $TEMPLATE =~ "Backgrounds/.+\.${RENDER_EXTENSION}$" ]];then - POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngTo:jpg' - POSTACTIONS[((++${#POSTACTIONS[*]}))]='groupBy:png jpg' - - elif [[ $TEMPLATE =~ "Concept/.+\.${RENDER_EXTENSION}$" ]];then - POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngTo:jpg pdf' - POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngToThumbnail:250' - - elif [[ $TEMPLATE =~ "Distro/$(cli_getPathComponent --release-pattern)/Syslinux/.+\.${RENDER_EXTENSION}$" ]];then - POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngToSyslinux:' - POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngToSyslinux:-floyd' - - elif [[ $TEMPLATE =~ "Distro/$(cli_getPathComponent --release-pattern)/Grub/.+\.${RENDER_EXTENSION}$" ]];then - POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngToGrub:' - POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngToGrub:-floyd' - - elif [[ $TEMPLATE =~ "Posters/.+\.${RENDER_EXTENSION}$" ]];then - POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngTo:jpg pdf' - fi - - elif [[ $TEMPLATE =~ "Identity/Models/Icons/.+\.${RENDER_EXTENSION}$" ]];then - POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngToIcons' - - elif [[ $TEMPLATE =~ "Identity/Models/Manuals.+\.${RENDER_EXTENSION}$" ]];then - POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngTo:jpg pdf' - - fi - - fi - - # Execute SVG post-rendition actions. - for ACTION in "${POSTACTIONS[@]}"; do - svg_$(echo "$ACTION" | cut -d: -f1) - done - -} diff --git a/Automation/Functions/Render/Svg/svg_doPostCommand.sh b/Automation/Functions/Render/Svg/svg_doPostCommand.sh deleted file mode 100755 index 42c7738..0000000 --- a/Automation/Functions/Render/Svg/svg_doPostCommand.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -# -# svg_doPostCommand.sh -- This function standardizes the way -# post-rendition commands are applied to base-rendition output. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_doPostCommand { - - # Define the file extension of base-rendition output. - local EXTENSION=$(render_getConfigOption "$ACTION" '2') - - # Define the command string. - local COMMAND=$(render_getConfigOption "$ACTION" '3-') - - # Verify the absolute path of base-rendition output. - cli_checkFiles -e ${FILE}.${EXTENSION} - - # Execute the command string on base-rendition output. - eval $COMMAND ${FILE}.${EXTENSION} - - # Be sure the command string was executed correctly. Otherwise - # stop the script execution. - if [[ $? -ne 0 ]];then - exit - fi - -} diff --git a/Automation/Functions/Render/Svg/svg_doTranslation.sh b/Automation/Functions/Render/Svg/svg_doTranslation.sh deleted file mode 100755 index 2dc359e..0000000 --- a/Automation/Functions/Render/Svg/svg_doTranslation.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/bin/bash -# -# svg_doTranslation.sh -- This function standardizes the way -# translation files are applied to SVG design models in order to -# produce the translated instance that is used to expand translation -# markers and produce PNG output in different languages. -# -# Assuming no translation file exists, an untranslated instace is -# taken from the design model and created (i.e., just a copy) from it. -# Using a design model instance (translated or not) is required in -# order to expand translation markers safetly. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_doTranslation { - - # Define which command will be used to output the template - # content. This is required because template files might be found - # as compressed files inside the repository. - local COMMAND="/bin/cat" - if [[ $(file -b -i $TEMPLATE) =~ '^application/x-gzip$' ]];then - COMMAND="/bin/zcat" - fi - - # Move into template's directory in order to satisfy relative - # entities. Take care that some XML documents (e.g., DocBook - # documents) can use entities relatively from their base - # locations. In order to process such documents, it is necessary - # to put the template directory up in the directory stack and - # create the instance from there. Thus, it is possible to expand - # relative entities correctly when validating the document. - pushd $(dirname $TEMPLATE) > /dev/null - - # Verify translation file existence and create template - # instance accordingly. - if [[ -f ${TRANSLATION} ]];then - - # Print final location of translation file. - cli_printMessage "${TRANSLATION}" --as-translation-line - - # Create translation instance to combine both template - # translation and licenses translations. - local TRANSLATION_INSTANCE=${TMPDIR}/message.po - - # In the case of SVG and other files, license translations is - # not required so we don't combine it into the template - # translation. - cp ${TRANSLATION} ${TRANSLATION_INSTANCE} - - # Create the translated instance of design model. - ${COMMAND} ${TEMPLATE} | xml2po -a -l ${CLI_LANG_LL} \ - -p ${TRANSLATION_INSTANCE} -o ${INSTANCE} - - - # Remove .xml2po.mo temporal file. - if [[ -f ${PWD}/.xml2po.mo ]];then - rm ${PWD}/.xml2po.mo - fi - - # Remove instance created to store both licenses and template - # translations. - if [[ -f ${TRANSLATION_INSTANCE} ]];then - rm ${TRANSLATION_INSTANCE} - fi - - else - - # Create the non-translated instance of design model. - ${COMMAND} ${TEMPLATE} > ${INSTANCE} - - fi - - # Return to where we were. - popd > /dev/null - - # Verify instance existence. - cli_checkFiles -e $INSTANCE - -} diff --git a/Automation/Functions/Render/Svg/svg_getColors.sh b/Automation/Functions/Render/Svg/svg_getColors.sh deleted file mode 100755 index 2b4ccd9..0000000 --- a/Automation/Functions/Render/Svg/svg_getColors.sh +++ /dev/null @@ -1,154 +0,0 @@ -#!/bin/bash -# -# svg_getColors.sh -- This function takes one palette produced by Gimp -# (e.g., syslinux.gpl) as input and outputs a list of colors in the -# specified format. In order for this function to output the color in -# the format specified, it is needed that the fourth column in the gpl -# palette be set in the `rrggbb' format and the appropriate conversion -# be implemented here. -# -# Notice that using both the `--head' and `--tail' options it is -# possible to control how many consecutive items does the list of -# colors is going to have. It is possible to output all colors in the -# list, or a consecutive range of them. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_getColors { - - # Define short options. - local ARGSS='' - - # Define long options. - local ARGSL='head:,tail:,format:' - - # Initialize both head and tail values to return the first line of - # color information from the palette. - local HEAD=1 - local TAIL=1 - - # Initialize format value used as default when no format option be - # provided. - local FORMAT='rrggbb' - - # Initialize list of colors. - local COLORS='' - - # Initialize arguments with an empty value and set it as local - # variable to this function scope. Doing this is very important to - # avoid any clash with higher execution environments. - local ARGUMENTS='' - - # Prepare ARGUMENTS variable for getopt. - cli_parseArgumentsReDef "$@" - - # Redefine ARGUMENTS using getopt(1) command parser. - cli_parseArguments - - # Redefine positional parameters using ARGUMENTS variable. - eval set -- "$ARGUMENTS" - - # Look for options passed through positional parameters. - while true;do - - case "$1" in - - --head ) - HEAD=$2 - shift 2 - ;; - - --tail ) - TAIL=$2 - shift 2 - ;; - - --format ) - FORMAT=$2 - shift 2 - ;; - - -- ) - shift 1 - break - ;; - esac - done - - # Define path to gpl palette. This is the first file we use to - # retrieve color information from. Only the first file provided - # will be used. - local PALETTE=$(echo $@ | cut -d' ' -f1) - - if [[ ! -f $PALETTE ]];then - - # Define palette path inside the theme's artistic motif. - local MOTIF_PALETTE=${TCAR_WORKDIR}/Identity/Images/Themes/$(cli_getPathComponent $ACTIONVAL --motif)/Palettes/grub.gpl - - # Define palette path inside the theme's design model. - local MODEL_PALETTE=${TCAR_WORKDIR}/Identity/Models/Themes/${THEME_MODEL_NAME}/Palettes/grub.gpl - - # Redefine default background color using palettes provided by - # artistic motif first, and design model later. Assuming none - # of them is present, use The CentOS Project default color - # then. - if [[ -f $MOTIF_PALETTE ]];then - COLORS=$(svg_getColors $MOTIF_PALETTE --head=1 --tail=1) - elif [[ -f $MODEL_PALETTE ]];then - COLORS=$(svg_getColors $MODEL_PALETTE --head=1 --tail=1) - else - COLORS='#204c8d' - fi - - else - - # Retrieve the fourth column from GPL palette. The fourth - # column of a GPL palette contains the palette commentary - # field. The palette commentary field can be anything, but for - # the sake of our own convenience we use it to store the color - # value in hexadecimal format (e.g., rrggbb). Notice that you - # can put your comments from the fifth column on using an - # space as field separator. - COLORS=$(sed -r '1,/^#/d' $PALETTE \ - | awk '{ printf "%s\n", $4 }' | head -n $HEAD | tail -n $TAIL) - - fi - - # Implement color formats conversions from rrggbb to other formats - # that you might need to use. - for COLOR in $COLORS;do - - case $FORMAT in - - rrggbb|* ) - if [[ ! $COLOR =~ '^#' ]];then - COLOR="#${COLOR}" - fi - ;; - - esac - - # Output color value. - echo "$COLOR" - - done - -} diff --git a/Automation/Functions/Render/Svg/svg_getTTFont.sh b/Automation/Functions/Render/Svg/svg_getTTFont.sh deleted file mode 100755 index 78b6050..0000000 --- a/Automation/Functions/Render/Svg/svg_getTTFont.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash -# -# cli_getFont.sh -- This function creates a list of all True Type -# Fonts (TTF) installed in your workstation and returns the absolute -# path of the file matching the pattern passed as first argument. -# Assuming more than one value matches, the first one in the list is -# used. In case no match is found, the function verifies if there is -# any file in the list that can be used (giving preference to sans -# files). If no file is found at this point, an error will be printed -# out. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_getTTFont { - - local -a FONT_PATTERNS - local FONT_PATTERN='' - local FONT_FILE='' - - # Define list of patterns used to build the list of TTF files. - FONT_PATTERNS[((++${#FONT_PATTERNS[*]}))]="/${1}\.ttf$" - FONT_PATTERNS[((++${#FONT_PATTERNS[*]}))]="sans\.ttf$" - FONT_PATTERNS[((++${#FONT_PATTERNS[*]}))]="\.ttf$" - - # Define directory location where fonts are installed in your - # workstation. - local FONT_DIR='/usr/share/fonts' - - # Define list of all TTF files installed in your workstation. - local FONT_FILES=$(cli_getFilesList ${FONT_DIR} --pattern="^.+\.ttf$") - - # Define TTF absolute path based on pattern. Notice that if the - # pattern matches more than one value, only the first one of a - # sorted list will be used. - for FONT_PATTERN in ${FONT_PATTERNS[@]};do - - FONT_FILE=$(echo "$FONT_FILES" | egrep ${FONT_PATTERN} \ - | head -n 1) - - if [[ -f $FONT_FILE ]];then - break - fi - - done - - # Output TTF absolute path. - if [[ -f $FONT_FILE ]];then - echo $FONT_FILE - else - cli_printMessage "`gettext "The font provided doesn't exist."`" --as-error-line - fi - -} diff --git a/Automation/Functions/Render/Svg/svg_groupBy.sh b/Automation/Functions/Render/Svg/svg_groupBy.sh deleted file mode 100755 index 25d334c..0000000 --- a/Automation/Functions/Render/Svg/svg_groupBy.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash -# -# svg_groupBy.sh -- This function provides post-rendition action to -# group files inside directories named as their file extensions. For -# example: if the current file is a .png file, it is moved inside a -# Png/ directory; if the current file is a .jpg file, it is stored -# inside a Jpg/ directory, and so on. -# -# For this function to work correctly, you need to specify which file -# type you want to group. This is done in the post-rendition ACTIONS -# array inside the appropriate `render.conf.sh' pre-configuration -# script. This function cannot be used as last-rendition action. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_groupBy { - - local SOURCE='' - local TARGET='' - - # Sanitate file types passed from render.conf.sh pre-rendition - # configuration script. - local FORMAT='' - local FORMATS=$(render_getConfigOption "$ACTION" '2-') - - for FORMAT in $FORMATS;do - - # Redifine source file we want to move. - SOURCE=${FILE}.${FORMAT} - - # Define target directory where source file will be moved - # into. - TARGET=$(dirname "$FILE")/$(cli_getRepoName $FORMAT -d) - - # Check existence of source file. - cli_checkFiles -e $SOURCE - - # Check existence of target directory. - if [[ ! -d $TARGET ]];then - mkdir -p $TARGET - fi - - # Redifine file path to add file and its type. - TARGET=${TARGET}/$(cli_getRepoName $FILE -f).${FORMAT} - - # Move file into its final location. - cli_printMessage "$TARGET" --as-movedto-line - mv ${SOURCE} ${TARGET} - - done - -} diff --git a/Automation/Functions/Render/render.sh b/Automation/Functions/Render/render.sh deleted file mode 100755 index d271baa..0000000 --- a/Automation/Functions/Render/render.sh +++ /dev/null @@ -1,151 +0,0 @@ -#!/bin/bash -# -# render.sh -- This function standardizes the way source files are -# rendered inside the working copy. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function render { - - local ACTIONNAM='' - local ACTIONVAL='' - - # Initialize `--releasever' option. The release version option - # controls the release number used to produce release-specific - # content. By default, the release number of The CentOS - # Distribution you have installed in your workstation is used. - local FLAG_RELEASEVER=$(cat /etc/redhat-release \ - | gawk '{ print $3 }') - - # Initialize `--basearch' option. The base architecture option - # controls the architecture type used to produce - # architecture-specific content. By default, the hardware - # platform of your workstation is used. - local FLAG_BASEARCH=$(uname -i) - - # Initialize `--theme-model' option. The theme model option - # specifies the theme model name used to produce theme - # artistic motifs. - local FLAG_THEME_MODEL='Default' - - # Initialize `--post-rendition' option. This option defines what - # command to use as post-rendition. Post-rendition takes place - # over base-rendition output. - local FLAG_POSTRENDITION='' - - # Initialize `--last-rendition' option. This option defines what - # command to use as last-rendition. Last-rendition takes place - # once both base-rendition and post-rendition has been performed - # in the same directory structure. - local FLAG_LASTRENDITION='' - - # Initialize `--dont-dirspecific' option. This option can take two - # values only (e.g., `true' or `false') and controls whether to - # perform or not directory-specific rendition. Directory-specific - # rendition may use any of the three types of renditions (e.g., - # base-rendition, post-rendition and last-rendition) to accomplish - # specific tasks when specific directory structures are detected - # in the rendition flow. By default, the centos-art.sh script - # performs directory-specific rendition. - local FLAG_DONT_DIRSPECIFIC='false' - - # Initialize `--with-brands' option. This option controls whether - # to brand output images or not. By default output images are not - # branded. - local FLAG_WITH_BRANDS='false' - - # Initialize list of supported file extensions. These file - # extensions are used to build the list of source files we'll use - # to create images from. The order in which these extensions are - # listed here determines the order in which they are process if - # more than one is found in the same location. - local RENDER_EXTENSIONS='svgz svg docbook conf' - - # Initialize the rendition format name as an empty value. The name - # of rendition format is determined later at rendition time, based - # on template file extension. - local RENDER_FORMAT='' - - # Initialize absolute path to format's base directory, the place - # where format-specific directories are stored in. - local RENDER_FORMAT_DIR="${CLI_FUNCDIR}/${CLI_FUNCDIRNAM}" - - # Interpret arguments and options passed through command-line. - render_getOptions - - # Redefine positional parameters using ARGUMENTS. At this point, - # option arguments have been removed from ARGUMENTS variable and - # only non-option arguments remain in it. - eval set -- "$ARGUMENTS" - - # Define action value. We use non-option arguments to define the - # action value (ACTIONVAL) variable. - for ACTIONVAL in "$@";do - - # Sanitate non-option arguments to be sure they match the - # directory conventions established by centos-art.sh script - # against source directory locations in the working copy. - ACTIONVAL=$(cli_checkRepoDirSource ${ACTIONVAL}) - - # Verify non-option arguments passed to centos-art.sh - # command-line. The path provided as argument must exist in - # the repository. Otherwise, it would be possible to create - # arbitrary directories inside the repository without any - # meaning. In order to be sure all required directories are - # available in the repository it is necessary use the prepare - # functionality. - #cli_checkFiles ${ACTIONVAL} -d - - # Define render-able directories and the way they are - # produced. To describe the way render-able directories are - # produced, we take the action value (ACTIONVAL) as reference - # and describe the production through an action name - # (ACTIONNAM). - if [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/Identity/Images/Themes" ]];then - ACTIONNAM="render_setThemes" - elif [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/Identity/Images/Brands" ]];then - ACTIONNAM="render_setBrands" - elif [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/Identity/Images" ]];then - ACTIONNAM="render_setBaseRendition" - elif [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/Documentation/Manuals/(Docbook|Svg)/[[:alnum:]-]+" ]];then - ACTIONNAM="render_setBaseRendition" - else - cli_printMessage "`gettext "The path provided doesn't support rendition."`" --as-error-line - fi - - # Synchronize changes between repository and working copy. At - # this point, changes in the repository are merged in the - # working copy and changes in the working copy committed up to - # repository. - cli_synchronizeRepoChanges "${ACTIONVAL}" - - # Execute action name. - ${ACTIONNAM} - - # Synchronize changes between repository and working copy. At - # this point, changes in the repository are merged in the - # working copy and changes in the working copy committed up to - # repository. - cli_synchronizeRepoChanges "${ACTIONVAL}" - - done - -} diff --git a/Automation/Functions/Render/render_getConfigOption.sh b/Automation/Functions/Render/render_getConfigOption.sh deleted file mode 100755 index dbf1937..0000000 --- a/Automation/Functions/Render/render_getConfigOption.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash -# -# render_getConfigOption.sh -- This function standardizes the -# configuration fields are retrived from some action-specific -# definitions. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function render_getConfigOption { - - # Initialize action string. - local ACTION="$1" - - # Initialize field definition. - local FIELD="$2" - - # Initialize configuration options. - local OPTION='' - - # Check action string. The action string must be present in order - # for this function to work. It provides the information needed to - # retrive configurantion options from. - if [[ "$ACTION" == '' ]];then - cli_printMessage "`gettext "There is no action string to work with."`" --as-error-line - fi - - # Check field definition. The field definition must match any of - # the formats specified by the `-f' option of `cut' command. - if [[ ! "$FIELD" =~ '^([0-9]+|[0-9]+-|-[0-9]+|[0-9]+-[0-9]+)$' ]];then - cli_printMessage "`gettext "The field definition is not valid."`" --as-error-line - fi - - # Get configuration option from action string. - OPTION=$(echo -n "$ACTION" | cut -d: -f${FIELD}) - - # Sanitate configuration option retrived from action string. - OPTION=$(echo -n "${OPTION}" \ - | sed -r 's!^ *!!g' \ - | sed -r 's!( |,|;) *! !g' \ - | sed -r 's! *$!!g') - - # Print out the configuration option retrived from action string, - # only if it is not an empty value. Do not use `echo' or `printf' - # built-in commands here. Use the `cli_printMessage' functionality - # instead. This is required in order to reverse the apostrophe - # codification accomplished when options were retrived from - # command-line (cli_parseArgumentsReDef) in the argument of - # options like `--post-rendition' and `--last-rendition'. - if [[ $OPTION != '' ]];then - cli_printMessage "$OPTION" --as-stdout-line - fi - -} diff --git a/Automation/Functions/Render/render_getDirOutput.sh b/Automation/Functions/Render/render_getDirOutput.sh deleted file mode 100755 index ffc475e..0000000 --- a/Automation/Functions/Render/render_getDirOutput.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash -# -# render_getDirOutput.sh -- This function defines the final -# absolute path the centos-art.sh script uses to store identity -# contents produced at rendition time. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function render_getDirOutput { - - # Define base output directory using design model path as - # reference. - OUTPUT=$(dirname $FILE | sed -r \ - -e "s!Identity/Models!Identity/Images!" \ - -e "s!Themes/${FLAG_THEME_MODEL}!Themes/$(cli_getPathComponent $ACTIONVAL --motif)!" \ - -e "s!Documentation/Models!Documentation/Manuals!" \ - -e "s!/Models!!") - - # By default, images rendered are stored under Identity/Images - # directory structure. But if an `Images/' directory exists in the - # current location use it instead. - if [[ -d "${OUTPUT}/Images" ]];then - OUTPUT=${OUTPUT}/Images - fi - - # Redefine base output directory to introduce specific information - # like release number and architecture. This information is - # require by directories (e.g., the `Media' directory inside - # themes and the `Documentation/Manuals/Docbook/Distro' directory - # ) whose need this information to be passed explicitly at the - # command-line through the `--releasever' and `--basearch' - # options. Other directories take such information from the path - # they are stored in (e.g., the `Distro/5/Anaconda' directory - # inside themes.). So, we need to differentiate the way - # information like release numbers and architectures are retrieved - # in order to build the output path correctly at rendition time. - if [[ $OUTPUT =~ "^${MOTIF_DIR}/Media$" ]];then - OUTPUT=${OUTPUT}/${FLAG_RELEASEVER}/${FLAG_BASEARCH} - elif [[ $OUTPUT =~ 'Documentation/Manuals/Docbook/Distro$' ]];then - OUTPUT=${OUTPUT}/${FLAG_RELEASEVER} - else - OUTPUT=${OUTPUT} - fi - - # Define whether to use or not locale-specific directory to store - # content, using current locale information as reference. As - # convection, when we produce content, only specific locations - # use locale-specific directories to organize language-specific - # content (e.g., Manuals, Anaconda, Installation media, etc.). All - # other locations do not use locale-specific directories to - # organize content. This convection is important in order for - # the `prepare' functionality of centos-art.sh script to produce - # content in the correct location. Otherwise, we might end up - # duplicating content (e.g., icons, brands, etc.) which doesn't - # have any translation, nor any need to be translated. - if [[ ! ${CLI_LANG_LC} =~ '^en' ]];then - OUTPUT=${OUTPUT}/${CLI_LANG_LC} - fi - - # Create final output directory, if it doesn't exist yet. - if [[ ! -d ${OUTPUT} ]];then - mkdir -p ${OUTPUT} - fi - -} diff --git a/Automation/Functions/Render/render_getDirTemplate.sh b/Automation/Functions/Render/render_getDirTemplate.sh deleted file mode 100755 index 9c6058a..0000000 --- a/Automation/Functions/Render/render_getDirTemplate.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/bash -# -# render_getDirTemplate.sh -- This function defines the way renderable -# directories are processed inside the repository. Inside the -# repository, renderable directories are processed either through -# direct or theme-specific rendition. -# -# Direct rendition takes one XML file from design model -# (`Identity/Models') directory structure and produces one file -# in `Identity/Images' directory strucutre. In this -# configuration, the organization used to stored the design model is -# taken as reference to build the path required to store the image -# related to it under `Identity/Images' directory structure. -# -# Theme-specific rendition takes one design model from -# `Identity/Models/Themes' directory structure to produce one or -# more images in `Identity/Images/Themes/$THEME/$VERSION/$MODEL' -# directory structure. In this configuration we have many different -# artistic motifs that use one unique design model directory structure -# as reference to produce images. -# -# Since theme design models are unified to be reused by more -# than one artistic motif, it is not possible to render artistic -# motifs in a lineal manner (i.e., as we do with direct rendition) -# because we need to establish the relation between the artistic motif -# renderable directory structure and the design model first and that -# relation happens when renderable directory structures inside -# artistic motifs are processed individually. -# -# In the first rendition category, we use a design model directory -# structure as reference to produce images one by one. In the second -# rendition category, we can't use the same procedure because one -# design model directory structure is used to produce several -# renderable directory structures, not just one. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function render_getDirTemplate { - - # Initialize design models location used as reference to process - # renderable directory structures. - TEMPLATE=$ACTIONVAL - - # Define absolute path to input files using absolute path from - # output files. - if [[ -d ${TEMPLATE}/Models ]];then - TEMPLATE=${TEMPLATE}/Models - else - TEMPLATE=$(echo "$TEMPLATE" | sed -r \ - -e "s!/Themes/$(cli_getPathComponent $ACTIONVAL --motif)!/Themes/${FLAG_THEME_MODEL}!" \ - -e "s!/(Manuals|Images)!/Models!") - fi - - # Verify absolute path to input file. This verification is - # specially needed in those situations when the artistic motif - # directory structure has an organization different to that in - # design models directory structure. Since the path to design - # models is built from artistic motif directory structure, if - # artistic motifs directory structure is different from design - # model directory structure, as result we'll have a path to a - # design model that may not exist and that would make - # centos-art.sh script to fail. So, verify the absolute path to - # the input file and stop script execution if it doesn't exist. - cli_checkFiles -e $TEMPLATE - -} diff --git a/Automation/Functions/Render/render_getOptions.sh b/Automation/Functions/Render/render_getOptions.sh deleted file mode 100755 index 6598f99..0000000 --- a/Automation/Functions/Render/render_getOptions.sh +++ /dev/null @@ -1,131 +0,0 @@ -#!/bin/bash -# -# render_getOptions.sh -- This function interprets option parameters -# passed to `render' functionality and calls actions accordingly. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function render_getOptions { - - # Define short options we want to support. - local ARGSS="h,q" - - # Define long options we want to support. - local ARGSL="help,quiet,filter:,answer-yes,dont-dirspecific,releasever:,basearch:,post-rendition:,last-rendition:,theme-model:,with-brands,synchronize" - - # Redefine ARGUMENTS using getopt(1) command parser. - cli_parseArguments - - # Redefine positional parameters using ARGUMENTS variable. - eval set -- "$ARGUMENTS" - - # Look for options passed through command-line. - while true; do - - case "$1" in - - -h | --help ) - cli_runFnEnvironment help --read --format="texinfo" "tcar-fs::scripts:bash-functions-render" - shift 1 - exit - ;; - - -q | --quiet ) - FLAG_QUIET="true" - shift 1 - ;; - - --filter ) - FLAG_FILTER="$2" - shift 2 - ;; - - --answer-yes ) - FLAG_ANSWER="true" - shift 1 - ;; - - --dont-dirspecific ) - FLAG_DONT_DIRSPECIFIC="true" - shift 1 - ;; - - --post-rendition ) - FLAG_POSTRENDITION="$2" - shift 2 - ;; - - --last-rendition ) - FLAG_LASTRENDITION="$2" - shift 2 - ;; - - --basearch ) - FLAG_BASEARCH="$2" - if [[ ! $FLAG_BASEARCH =~ $(cli_getPathComponent --architecture-pattern) ]];then - cli_printMessage "`gettext "The architecture provided is not supported."`" --as-error-line - fi - shift 2 - ;; - - --releasever ) - FLAG_RELEASEVER="$2" - if [[ ! $FLAG_RELEASEVER =~ $(cli_getPathComponent --release-pattern) ]];then - cli_printMessage "`gettext "The release version provided is not supported."`" --as-error-line - fi - shift 2 - ;; - - --theme-model ) - FLAG_THEME_MODEL=$(cli_getRepoName $2 -d) - shift 2 - ;; - - --with-brands ) - FLAG_WITH_BRANDS='true' - shift 1 - ;; - - --synchronize ) - FLAG_SYNCHRONIZE='true' - shift 1 - ;; - - -- ) - # Remove the `--' argument from the list of arguments - # in order for processing non-option arguments - # correctly. At this point all option arguments have - # been processed already but the `--' argument still - # remains to mark ending of option arguments and - # beginning of non-option arguments. The `--' argument - # needs to be removed here in order to avoid - # centos-art.sh script to process it as a path inside - # the repository, which obviously is not. - shift 1 - break - ;; - esac - done - - # Redefine ARGUMENTS variable using current positional parameters. - cli_parseArgumentsReDef "$@" - -} diff --git a/Automation/Functions/Render/render_setBaseRendition.sh b/Automation/Functions/Render/render_setBaseRendition.sh deleted file mode 100755 index 8591dec..0000000 --- a/Automation/Functions/Render/render_setBaseRendition.sh +++ /dev/null @@ -1,276 +0,0 @@ -#!/bin/bash -# -# render_setBaseRendition.sh -- This function performs base-rendition -# action for all files. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function render_setBaseRendition { - - local -a FILES - local FILE='' - local OUTPUT='' - local TEMPLATE='' - local TEMPLATES='' - local PARENTDIR='' - local TRANSLATION='' - local EXTERNALFILE='' - local EXTERNALFILES='' - local THIS_FILE_DIR='' - local NEXT_FILE_DIR='' - local RENDER_EXTENSION='' - local EXPORTID='' - local COUNT=0 - - # Verify default directory where design models are stored in. - cli_checkFiles -e "${TCAR_WORKDIR}/Identity/Models/Themes/${FLAG_THEME_MODEL}" - - # Redefine parent directory for current workplace. - PARENTDIR=$(basename "${ACTIONVAL}") - - # Loop through list of supported file extensions. - for RENDER_EXTENSION in ${RENDER_EXTENSIONS};do - - # Redefine rendition format name based on supported file - # extension. - if [[ $RENDER_EXTENSION =~ '^(svgz|svg)$' ]];then - RENDER_FORMAT='svg' - elif [[ $RENDER_EXTENSION =~ '^(docbook)$' ]];then - RENDER_FORMAT='docbook' - elif [[ $RENDER_EXTENSION =~ '^(conf)$' ]];then - RENDER_FORMAT='conf' - else - cli_printMessage "`eval_gettext "The \\\"\\\$RENDER_EXTENSION\\\" file extension is not supported yet."`" --as-error-line - fi - - # Redefine specific function export id. - EXPORTID="${CLI_FUNCDIRNAM}/$(cli_getRepoName ${RENDER_FORMAT} -d)/$(cli_getRepoName ${RENDER_FORMAT} -f)" - - # Define base location of template files using paths passed to - # centos-art.sh script as argument to. - render_getDirTemplate - - # Verify whether or not the source location of the path - # provided as argument to centos-art.sh script accepts or not - # localization messages. Don't produce localized content for - # repository components that don't accept it. - if [[ ! ${CLI_LANG_LC} =~ '^en' ]];then - cli_runFnEnvironment locale --is-localizable ${TEMPLATE} - fi - - # Define the list of files to process. Use an array variable - # to store the list of files to process. This make possible to - # realize verifications like: is the current base directory - # equal to the next one in the list of files to process? - # Questions like this let us to know when centos-art.sh is - # leaving a directory structure and entering another. This - # information is required in order for centos-art.sh to know - # when to apply last-rendition actions. - # - # Another issue is that some directories might be named as if - # they were files (e.g., using a render able extension like - # .docbook). In these situations we need to avoid such - # directories from being interpreted as a render able file. - # For this, pass the `--type="f"' option when building the - # list of files to process in order to retrieve regular files - # only. - # - # Another issue to consider here is that, in some cases, both - # templates and outputs might be in the same location. In - # these cases localized content are stored in the same - # location where template files are retrieved from and we need - # to avoid using localized content from being interpreted as - # design models. In that sake, build the list of files to - # process using the files directly stored in the directory - # passed as argument to centos-art.sh command-line. Don't go - # recursively here. - # - # Another issue to consider here, is the way of restricting - # the list of files to process. We cannot expand the pattern - # specified by FLAG_FILTER with a `.*' here (e.g., - # "${FLAG_FILTER}.*\.${RENDER_EXTENSION}") because that would - # suppress any possibility from the user to specify just one - # file name in locations where more than one file with the - # same name as prefix exists (e.g., `repository.docbook', - # `repository-preamble.docbook' and - # `repository-parts.docbook'). Instead, pass filtering - # control to the user whom can use regular expression markup - # in the `--filter' option to decide whether to match - # `repository.docbook' only (e.g., through - # `--filter="repository"') or `repository-preamble.docbook' - # and `repository-parts.docbook' but not `repository.docbook' - # (e.g., through `--filter="repository-.*"'). - if [[ ${RENDER_FORMAT} =~ "^docbook$" ]];then - - # When the render format is docbook, don't build a list of - # files to process. Instead, build the absolute path of - # the main file used to render docbook from models to - # final output manuals. This file must be stored directly - # inside the main manual's directory and named as it but - # with all letters in lowercase. - for FILE in $(cli_getFilesList ${TEMPLATE} \ - --maxdepth="1" --mindepth="1" \ - --pattern="^.*$(cli_getRepoName ${TEMPLATE} -f)\.${RENDER_EXTENSION}$" \ - --type="f");do - FILES[((++${#FILES[*]}))]=$FILE - done - - elif [[ ${RENDER_FORMAT} =~ "^conf$" ]];then - - # When the render format is conf, be sure it refers to - # image.conf files only. Other configuration files (e.g., - # branding.conf) cannot be processed this way because - # their configuration options and values haven't any - # meaning in this context. - for FILE in $(cli_getFilesList ${TEMPLATE} \ - --pattern="^.+/images\.${RENDER_EXTENSION}$" \ - --type="f");do - FILES[((++${#FILES[*]}))]=$FILE - done - - else - - # For all other cases, build a list of files to process - # using the path value pass as argument. - for FILE in $(cli_getFilesList ${TEMPLATE} \ - --pattern="^.+/${FLAG_FILTER}.*\.${RENDER_EXTENSION}$" \ - --type="f");do - FILES[((++${#FILES[*]}))]=$FILE - done - - fi - - # Verify list of files to process. Assuming no file was found, - # evaluate the next supported file extension. - if [[ ${#FILES[*]} -eq 0 ]];then - continue - fi - - # Initialize format-specific functionalities. - cli_exportFunctions "${EXPORTID}" - - # Start processing the base rendition list of FILES. Fun part - # approaching :-). - while [[ $COUNT -lt ${#FILES[*]} ]];do - - # Define base file. - FILE=${FILES[$COUNT]} - - # Define the base directory path for the current file being - # process. - THIS_FILE_DIR=$(dirname ${FILES[$COUNT]}) - - # Define the base directory path for the next file that will - # be process. - if [[ $(($COUNT + 1)) -lt ${#FILES[*]} ]];then - NEXT_FILE_DIR=$(dirname ${FILES[$(($COUNT + 1))]}) - else - NEXT_FILE_DIR='' - fi - - # Print separator line. - cli_printMessage '-' --as-separator-line - - # Print action message based on file extension. - if [[ ${FILE} =~ 'images\.conf$' ]] && [[ $FLAG_WITH_BRANDS == 'true' ]];then - cli_printMessage "${FILE}" --as-processing-line - elif [[ ${FILE} =~ 'brands\.conf$' ]];then - continue - else - cli_printMessage "${FILE}" --as-template-line - fi - - # Verify design models file existence. We cannot continue - # with out it. - cli_checkFiles ${FILE} -f - - # Define final location of translation file. - TRANSLATION=$(dirname ${FILE} \ - | sed -r 's!(Documentation|Identity)!Locales/\1!')/${CLI_LANG_LC}/messages.po - - # Define final location of template file. - TEMPLATE=${FILE} - - # Define final location of output directory. - render_getDirOutput - - # Get relative path to file. The path string (stored in - # FILE) has two parts: 1. the variable path and 2. the - # common path. The variable path is before the common - # point in the path string. The common path is after the - # common point in the path string. The common point is the - # name of the parent directory (stored in PARENTDIR). - # - # Identity/Models/Themes/.../Firstboot/3/splash-small.svg - # -------------------------^| the |^------------^ - # variable path | common | common path - # -------------------------v| point | v------------v - # Identity/Images/Themes/.../Firstboot/Img/3/splash-small.png - # - # What we do here is remove the variable path, the common - # point, and the file extension parts in the string - # holding the path retrieved from design models directory - # structure. Then we use the common path as relative path - # to store the final image file. - # - # The file extension is removed from the common path - # because it is set when we create the final image file. - # This configuration let us use different extensions for - # the same file name. - # - # When we render using base-rendition action, the - # structure of files under the output directory will be - # the same used after the common point in the related - # design model directory structure. - FILE=$(echo ${FILE} \ - | sed -r "s!.*${PARENTDIR}/!!" \ - | sed -r "s/\.${RENDER_EXTENSION}$//") - - # Define absolute path to final file (without extension). - FILE=${OUTPUT}/$(basename "${FILE}") - - # Define instance name from design model. - INSTANCE=$(cli_getTemporalFile ${TEMPLATE}) - - # Perform format base-rendition. - ${RENDER_FORMAT} - - # Remove template instance. - if [[ -f $INSTANCE ]];then - rm $INSTANCE - fi - - # Increment file counter. - COUNT=$(($COUNT + 1)) - - done - - # Reset counter to prevent accumulation of values. - COUNT=0 - - # Unset format-specific functionalities. - cli_unsetFunctions "${EXPORTID}" - - # Unset files list to prevent accumulation of values. - unset FILES - - done -} diff --git a/Automation/Functions/Render/render_setBrands.sh b/Automation/Functions/Render/render_setBrands.sh deleted file mode 100755 index 187c4df..0000000 --- a/Automation/Functions/Render/render_setBrands.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -# -# render_setBrands.sh -- This function performs brand-specific -# rendition. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function render_setBrands { - - local BRANDS_MODELS_DIR=${TCAR_WORKDIR}/Identity/Models/Brands - local BRANDS_IMAGES_DIR=${TCAR_WORKDIR}/Identity/Images/Brands - - render_setBrandsDirValidates ${BRANDS_IMAGES_DIR} ${ACTIONVAL} - render_setBrandsDirStructure ${BRANDS_MODELS_DIR} ${BRANDS_IMAGES_DIR} - - render_setBaseRendition - -} diff --git a/Automation/Functions/Render/render_setBrandsDirStructure.sh b/Automation/Functions/Render/render_setBrandsDirStructure.sh deleted file mode 100755 index 453e90c..0000000 --- a/Automation/Functions/Render/render_setBrandsDirStructure.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -# -# render_setBrandsDirectoryStructure.sh -- This function verifies the -# directory structure of brands images using the directory structure -# of brands models as reference. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function render_setBrandsDirStructure { - - local BRANDS_SOURCE_DIR=$(cli_checkRepoDirSource ${1}) - local BRANDS_TARGET_DIR=$(cli_checkRepoDirSource ${2}) - - cli_printMessage "${BRANDS_TARGET_DIR} `gettext "directory structures..."`" --as-checking-line - - cli_runFnEnvironment prepare ${BRANDS_SOURCE_DIR} ${BRANDS_TARGET_DIR} --directories - -} diff --git a/Automation/Functions/Render/render_setBrandsDirValidates.sh b/Automation/Functions/Render/render_setBrandsDirValidates.sh deleted file mode 100755 index 8622474..0000000 --- a/Automation/Functions/Render/render_setBrandsDirValidates.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -# -# render_setBrandsDirVerification.sh -- This function standardize path -# verification between path provided in the command line and -# repository directory structure. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - - -function render_setBrandsDirValidates { - - local BRANDS_PATH_OK=$(cli_checkRepoDirSource ${1}) - local BRANDS_PATH_UNKNOWN=$(cli_checkRepoDirSource ${2}) - - cli_checkFiles ${BRANDS_PATH_UNKNOWN} --match="^${BRANDS_PATH_OK}" - - local BRANDS_PATH_UNKNOWN_MODEL=$(echo ${BRANDS_PATH_UNKNOWN} \ - | sed -r "s,/Images/,/Models/,") - - cli_checkFiles ${BRANDS_PATH_UNKNOWN_MODEL} -d - -} diff --git a/Automation/Functions/Render/render_setThemes.sh b/Automation/Functions/Render/render_setThemes.sh deleted file mode 100755 index 134d6aa..0000000 --- a/Automation/Functions/Render/render_setThemes.sh +++ /dev/null @@ -1,153 +0,0 @@ -#!/bin/bash -# -# render_setThemes.sh -- This function performs theme-specific -# rendition. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function render_setThemes { - - local -a DIRS - local COUNT=0 - local NEXTDIR='' - local MOTIF_NAME='' - local MOTIF_DIR='' - - # Define base directory of artistic motifs. This is the location - # where all artistic motifs are stored in. - local MOTIF_BASEDIR="${TCAR_WORKDIR}/Identity/Images/Themes" - - # Define base directory of design models. This is the location - # where all design models are stored in. - local MODEL_BASEDIR="${TCAR_WORKDIR}/Identity/Models/Themes" - - # Verify directory structure for all theme-specific directories. - render_setThemesDirStructure "${MODEL_BASEDIR}/${FLAG_THEME_MODEL}" "${MOTIF_BASEDIR}" - - # Define directory structure of design models. Design models - # directory structures are used as reference to create artistic - # motifs directory structure. Use the `--pattern' option to be - # sure any modification to FLAG_FILTER won't affect the output - # result. We need to make matching everything here, no matter what - # the FLAG_FILTER value be. - local MODEL_DIR='' - local MODEL_DIRS="$(cli_getFilesList ${MODEL_BASEDIR}/${FLAG_THEME_MODEL} \ - --pattern='^.+/[^.svn][[:alnum:]_/-]+$' --type="d" \ - | sed -e "s!^.*/${FLAG_THEME_MODEL}!!" \ - -e '/^[[:space:]]*$/d' \ - -e 's!^/!!')" - - # Define design model regular expression patterns from design - # models directory structure. - local MODEL_PATTERN=$(echo "$MODEL_DIRS" | tr "\n" '|' \ - | sed -e 's!^|!!' -e 's!|$!!') - - # Define regular expression pattern that match the theme artistic - # motif component inside the path strings. - local MOTIF_PATTERN=$(cli_getPathComponent --motif-pattern) - - # Define list of render-able directory structures inside the - # artistic motif. As reference, to build this list, use design - # model directory structure. The more specific you be in the path - # specification the more specific theme rendition will be. Thus, - # we use the path provided as argument and the --filter option as - # reference to control the amount of directories considered - # render-able directory. - local MOTIF_RENDERABLE_DIR='' - local MOTIF_RENDERABLE_DIRS=$(cli_getFilesList ${MOTIF_BASEDIR} \ - --pattern="^${TCAR_WORKDIR}/${MOTIF_PATTERN}/($MODEL_PATTERN)$" --type="d" \ - | grep "$(echo ${ACTIONVAL} | sed -r 's,/$,,')") - - # When no render-able directories are found, finish the script - # execution with an error message. There is an obvious typo in the - # path provided. - if [[ -z ${MOTIF_RENDERABLE_DIRS} ]];then - cli_printMessage "`gettext "No related model was found for the path provided."`" --as-error-line - fi - - # Rebuild list of render-able directory structures using an array - # variable. This let us to predict what directory is one step - # forward or backward from the current directory structure. - for MOTIF_RENDERABLE_DIR in $MOTIF_RENDERABLE_DIRS;do - DIRS[((++${#DIRS[*]}))]=${MOTIF_RENDERABLE_DIR} - done - - # Define total number of directories to process. This is required - # in order to correct the counting value and so, make it to match - # the zero based nature of bash array variables. - local DIRS_TOTAL=$((${#DIRS[*]} - 1)) - - while [[ $COUNT -le ${DIRS_TOTAL} ]];do - - # Redefine action value to refer the theme-specific render-able - # directory. - ACTIONVAL=${DIRS[$COUNT]} - - # Refine artistic motif name using the current action value. - MOTIF_NAME=$(cli_getPathComponent $ACTIONVAL --motif) - - # Verify artistic motif name. The name of the artistic motif - # must be present in order for theme rendition to happen. - # Theme rendition takes place inside artistic motifs and the - # artistic motif name is an indispensable part of it. Take - # care of not using design models directory structure as name - # for artistic motifs. They, sometimes, match the pattern used - # to verify artistic motifs names but must not be confused. - if [[ $MOTIF_NAME == '' ]] || [[ $MOTIF_NAME =~ "^($MODEL_PATTERN)" ]];then - COUNT=$(($COUNT + 1)) - continue - fi - - # Refine artistic motif directory. This is the top directory - # where all visual manifestations of an artistic motif are - # stored in (e.g., Backgrounds, Brushes, Concept, Distro, - # etc.). - MOTIF_DIR="${MOTIF_BASEDIR}/${MOTIF_NAME}" - - # Define what is the next directory in the list, so we could - # verify whether to render or not the current theme-specific - # render-able directory. - if [[ $COUNT -lt ${DIRS_TOTAL} ]];then - NEXTDIR=$(dirname ${DIRS[(($COUNT + 1))]}) - else - NEXTDIR='' - fi - - # Verify whether to render or not the current theme's - # render-able directory. This verification is needed in order - # to avoid unnecessary rendition loops. For example, don't - # render `path/to/dir/A' when `path/to/dir/A/B' does exist, - # that configuration would produce `/path/to/dir/A/B twice. - if [[ $ACTIONVAL =~ '[[:digit:]]$' ]] || [[ $ACTIONVAL == $NEXTDIR ]];then - COUNT=$(($COUNT + 1)) - continue - fi - - # Execute direct rendition on theme specific render-able - # directory as specified by action value. - render_setBaseRendition - - # Increment counter to match the correct count value. - COUNT=$(($COUNT + 1)) - - done - -} diff --git a/Automation/Functions/Render/render_setThemesDirStructure.sh b/Automation/Functions/Render/render_setThemesDirStructure.sh deleted file mode 100755 index ed98d3d..0000000 --- a/Automation/Functions/Render/render_setThemesDirStructure.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# -# render_setThemeDirectoryStructre.sh -- This function verifies -# theme-specific directory structures using common theme models -# directory structure as pattern. If there are missing directories inside -# theme-specific directories, this function will create it. This is a -# requisite of rendition process, so be sure to call this function -# before building the list of render-able theme directories. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - - -function render_setThemesDirStructure { - - local THEMES_SOURCE_DIR=$(cli_checkRepoDirSource "${1}") - local THEMES_TARGET_DIR=$(cli_checkRepoDirSource "${2}") - - local THEMES_FILTER=${THEMES_TARGET_DIR}/$(cli_getPathComponent --motif ${ACTIONVAL}) - - THEMES_TARGET_DIRS=$(cli_getFilesList ${THEMES_TARGET_DIR} \ - --pattern=".+/[[:digit:]]+$" --maxdepth=2 --mindepth=2 \ - | grep "${THEMES_FILTER}") - - for THEMES_TARGET_DIR in $THEMES_TARGET_DIRS;do - cli_printMessage "$THEMES_TARGET_DIR `gettext "directory structure..."`" --as-checking-line - cli_runFnEnvironment prepare ${THEMES_SOURCE_DIR} ${THEMES_TARGET_DIR} --directories - done - -} diff --git a/Automation/Functions/Tuneup/Sh/Config/topcomment.sed b/Automation/Functions/Tuneup/Sh/Config/topcomment.sed deleted file mode 100755 index 8b56461..0000000 --- a/Automation/Functions/Tuneup/Sh/Config/topcomment.sed +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sed -# -# topcomment.sed -- This file standardizes the top comment inside -# centos-art.sh scripts. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- -/^# +Copyright .*$/a\ -# Copyright (C) 2009-=COPYRIGHT_YEAR_LAST= =COPYRIGHT_HOLDER=\ -#\ -# 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.\ -#\ -# ---------------------------------------------------------------------- - -# Remove previous copyright notice, just to be sure the one above be -# used always. -/^# +Copyright .*$/,/^# -{70}$/{ -d -} - -# Remove more than one space after comments. -s/^# +/# / - -# Define script first line. -1c\ -#!/bin/bash diff --git a/Automation/Functions/Tuneup/Sh/sh.sh b/Automation/Functions/Tuneup/Sh/sh.sh deleted file mode 100755 index cd59368..0000000 --- a/Automation/Functions/Tuneup/Sh/sh.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# -# sh.sh -- This function standardizes maintainance tasks for Shell -# script files. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function sh { - - # Rebuild top comment inside shell scripts, mainly to update - # copyright information. - sh_doTopComment - -} diff --git a/Automation/Functions/Tuneup/Sh/sh_doTopComment.sh b/Automation/Functions/Tuneup/Sh/sh_doTopComment.sh deleted file mode 100755 index 808dafa..0000000 --- a/Automation/Functions/Tuneup/Sh/sh_doTopComment.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash -# -# sh_doTopComment.sh -- This function standardizes the top comment -# section inside shell scripts (*.sh) using a predefined template. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function sh_doTopComment { - - # Define absolute path to template file. - local TEMPLATE="${TUNEUP_CONFIG_DIR}/topcomment.sed" - - # Check template file existence. - cli_checkFiles -e $TEMPLATE - - # Define file name to template instance. - local INSTANCE=$(cli_getTemporalFile $TEMPLATE) - - # Create template instance. - cp $TEMPLATE $INSTANCE - - # Check template instance. We cannot continue if template instance - # couldn't be created. - cli_checkFiles -e $INSTANCE - - # Expand translation markers in template instance. - cli_expandTMarkers $INSTANCE - - # Apply template instance to file. - sed -r -i -f $INSTANCE $FILE - - # Remove template instance. - if [[ -f ${INSTANCE} ]];then - rm ${INSTANCE} - fi - -} diff --git a/Automation/Functions/Tuneup/Svg/Config/metadata.sed b/Automation/Functions/Tuneup/Svg/Config/metadata.sed deleted file mode 100755 index 199c44d..0000000 --- a/Automation/Functions/Tuneup/Svg/Config/metadata.sed +++ /dev/null @@ -1,64 +0,0 @@ -# This file is the metadata information used by CentOS Artwork SIG on -# its scalable vector graphics (SVG) files. This files is used with -# the regular expression '.*\.svg$' only. -# --------------------------------------------------- -# $Id$ -# --------------------------------------------------- -/\ - \ - \ - image/svg+xml\ - \ - \ - =TITLE=\ - =DATE=\ - \ - \ - =COPYRIGHT_HOLDER=\ - \ - \ - \ - \ - =COPYRIGHT_HOLDER=\ - \ - \ - \ - \ - =COPYRIGHT_HOLDER=\ - \ - \ - =URL=\ - =URL=\ - =URL=\ - =LOCALE=\ - \ - \ -=KEYWORDS=\ - \ - \ - =COPYRIGHT_HOLDER=\ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - diff --git a/Automation/Functions/Tuneup/Svg/svg.sh b/Automation/Functions/Tuneup/Svg/svg.sh deleted file mode 100755 index ac7a22b..0000000 --- a/Automation/Functions/Tuneup/Svg/svg.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -# -# svg.sh -- This function standardizes maintainance of SVG files. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg { - - # Update metadata information. - svg_doMetadata - - # Remove all unused items. - svg_doVacuumDefs - -} diff --git a/Automation/Functions/Tuneup/Svg/svg_doMetadata.sh b/Automation/Functions/Tuneup/Svg/svg_doMetadata.sh deleted file mode 100755 index 32865e0..0000000 --- a/Automation/Functions/Tuneup/Svg/svg_doMetadata.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/bash -# -# svg_doMetadata.sh -- This function updates metadata values inside -# scalable vector graphic (SVG) files using default values from The -# CentOS Project. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_doMetadata { - - # Define template file name. - local TEMPLATE="${TUNEUP_CONFIG_DIR}/metadata.sed" - - # Check template file existence. - cli_checkFiles -e $TEMPLATE - - # Build title from file path. - local TITLE=$(basename "$FILE") - - # Build url from file path. - local URL=$(echo $FILE | sed 's!/home/centos!https://projects.centos.org/svn!') - - # Build keywords from file path. Do not include filename, it is - # already on title. - local KEY='' - local KEYS=$(dirname "$FILE" | cut -d/ -f6- | tr '/' '\n') - - # Build keywords using SVG standard format. Note that this - # information is inserted inside template file. The template file - # is a replacement set of sed commands so we need to escape the - # new line of each line using one backslash (\). As we are doing - # this inside bash, it is required to escape the backslash with - # another backslash so one of them passes literally to template - # file. - KEYS=$(\ - for KEY in $KEYS;do - echo " $KEY\\" - done) - - # Redefine template instance file name. - local INSTANCE=$(cli_getTemporalFile $TEMPLATE) - - # Create instance. - cp $TEMPLATE $INSTANCE - - # Check template instance. We cannot continue if the template - # instance couldn't be created. - cli_checkFiles -e $INSTANCE - - # Expand translation markers inside template instance. - sed -r -i \ - -e "s!=TITLE=!$TITLE!" \ - -e "s!=URL=!$URL!" \ - -e "s!=DATE=!$(date "+%Y-%m-%d")!" $INSTANCE - sed -i -r "/=KEYWORDS=/c\\${KEYS}" $INSTANCE - sed -i -r 's/>$/>\\/g' $INSTANCE - cli_expandTMarkers $INSTANCE - - # Update scalable vector graphic using template instance. - sed -i -f $INSTANCE $FILE - - # Remove template instance. - if [[ -f $INSTANCE ]];then - rm $INSTANCE - fi - - # Sanitate scalable vector graphic. - sed -i -r '/^[[:space:]]*$/d' $FILE - -} diff --git a/Automation/Functions/Tuneup/Svg/svg_doVacuumDefs.sh b/Automation/Functions/Tuneup/Svg/svg_doVacuumDefs.sh deleted file mode 100755 index 58d60fc..0000000 --- a/Automation/Functions/Tuneup/Svg/svg_doVacuumDefs.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -# -# svg_doVacuumDefs.sh -- This function removes all unused items from -# the defs section of the SVG file. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svg_doVacuumDefs { - - # Vacuum unused svg definition using inkscape. - inkscape --vacuum-defs $FILE &> /dev/null - -} diff --git a/Automation/Functions/Tuneup/Xhtml/Config/toc.awk b/Automation/Functions/Tuneup/Xhtml/Config/toc.awk deleted file mode 100755 index d4e9d75..0000000 --- a/Automation/Functions/Tuneup/Xhtml/Config/toc.awk +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/gawk -# -# toc.awk -- This file provides the output format required by -# `xhtml_makeToc' function, inside centos-art.sh script, to produce -# the table of contents correctly. -# -# Copyright (C) 2009-2012 The CentOS Project -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Pubdtc License as pubdtshed 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 usefdl, but -# WITHOUT ANY WARRANTY; without even the impdted warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Pubdtc License for more details. -# -# You shodld have received a copy of the GNU General Pubdtc License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -# USA. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -BEGIN {FS=":"} - -{ - if ($1 == 0 && $2 == $3) { - opentags = "
" - closetags = "" - } - - if ($1 > 0 && $2 > $3) { - opentags = "
" - closetags = "" - } - - if ($1 > 0 && $2 == $3) { - opentags = "
" - closetags = "" - } - - if ($1 > 0 && $2 < $3) { - opentags = "" - for (i = 1; i <= ($3 - $2); i++) { - opentags = opentags "
" - closetags = "" - } - opentags = opentags "
" - } - - printf "%s%s%s\n",opentags,$4,closetags - -} - -END { - - if ($1 > 0 && $2 >= $3 && $3 > 1) { - for (i = 1; i <= $3; i++) { - print "
" - } - } - - if ($1 > 0 && $2 >= $3 && $3 == 1) { - print "" - print "" - } - - if ($1 > 0 && $2 < $3) { - for (i = 1; i <= $2; i++) { - print "" - } - } - - print "" -} diff --git a/Automation/Functions/Tuneup/Xhtml/xhtml.sh b/Automation/Functions/Tuneup/Xhtml/xhtml.sh deleted file mode 100755 index f758f8f..0000000 --- a/Automation/Functions/Tuneup/Xhtml/xhtml.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# -# xhtml.sh -- This function standardizes maintainance tasks of XHTML -# files. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function xhtml { - - # Transforms xhtml headings to make them accessible (e.g., through - # a table of contents). - xhtml_doToc - -} diff --git a/Automation/Functions/Tuneup/Xhtml/xhtml_doToc.sh b/Automation/Functions/Tuneup/Xhtml/xhtml_doToc.sh deleted file mode 100755 index e75698e..0000000 --- a/Automation/Functions/Tuneup/Xhtml/xhtml_doToc.sh +++ /dev/null @@ -1,160 +0,0 @@ -#!/bin/bash -# -# xhtml_doToc.sh -- This functionality transforms web page headings to -# make them accessible through a table of contents. The table of -# contents is expanded in place, wherever the
-# piece of code be in the page. Once the
-# piece of code has be expanded, there is no need to put anything else -# in the page. -# -# In order for the tuneup functionality to transform headings, you -# need to put headings in just one line using one of the following -# forms: -# -#

Title

-#

Title

-#

Title

-# -# In the example above, h1 can vary from h1 to h6. Closing tag must be -# present and also match the openning tag. The value of `name' and -# `href' options from the anchor element are set dynamically using the -# md5sum output of combining the page location, the head- string and -# the heading string. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function xhtml_doToc { - - # Define variables as local to avoid conflicts outside. - local COUNT=0 - local PREVCOUNT=0 - local -a FINAL - local -a TITLE - local -a MD5SM - local -a OPTNS - local -a CLASS - local -a LEVEL - local -a PARENT - local -a TOCENTRIES - local -a LINK - - # Define table of content configuration file, the file used to - # produce the table of content XHTML output code. - local TOC_CONFIG=${TUNEUP_CONFIG_DIR}/toc.awk - - # Verify table of content configuration file. - cli_checkFiles -e ${TOC_CONFIG} - - # Define html heading regular expression pattern. Use parenthisis - # to save html action name, action value, and heading title. - local PATTERN='(]>)(.*[^<])' - - # Verify list of html files. Are files really html files? If they - # don't, continue with the next one in the list. - if [[ ! $(file --brief $FILE) =~ '^(XHTML|HTML|XML)' ]];then - continue - fi - - # Define list of headings to process. When building the heading, - # it is required to change spaces characters from its current - # decimal output to something different (e.g., its \040 octal - # alternative). This is required because the space character is - # used as egrep default field separator and spaces can be present - # inside heading strings we don't want to separate. - for HEADING in $(egrep "$PATTERN" $FILE \ - | sed -r -e 's!^[[:space:]]+!!' -e "s! !\\\040!g");do - - # Define previous counter value using current counter - # value as reference. - if [[ $COUNT -ne 0 ]];then - PREVCOUNT=$(($COUNT-1)) - fi - - # Define initial heading information. - FIRST[$COUNT]=$(echo $HEADING | sed -r "s!\\\040! !g") - TITLE[$COUNT]=$(echo ${FIRST[$COUNT]} | sed -r "s!$PATTERN!\4!") - MD5SM[$COUNT]=$(echo "${FILE}${FIRST[$COUNT]}" | md5sum | sed -r 's![[:space:]]+-$!!') - OPTNS[$COUNT]=$(echo ${FIRST[$COUNT]} | sed -r "s!$PATTERN!\3!") - CLASS[$COUNT]=$(echo ${FIRST[$COUNT]} | sed -r "s!$PATTERN!\2!") - LEVEL[$COUNT]=$(echo ${FIRST[$COUNT]} | sed -r "s!$PATTERN!\1!") - PARENT[$COUNT]=${LEVEL[$PREVCOUNT]} - - # Transform heading information using initial heading - # information as reference. - if [[ ${OPTNS[$COUNT]} =~ '^$' ]];then - OPTNS[$COUNT]='' - elif [[ ${OPTNS[$COUNT]} =~ '^$' ]];then - OPTNS[$COUNT]='' - elif [[ ${OPTNS[$COUNT]} =~ '^$' ]];then - OPTNS[$COUNT]='' - fi - - # Build final html heading structure. - FINAL[$COUNT]=''${OPTNS[$COUNT]}${TITLE[$COUNT]}'' - - # Build html heading link structure. These links are used by - # the table of contents later. - LINK[$COUNT]=''${TITLE[$COUNT]}'' - - # Build table of contents entry with numerical - # identifications. The numerical identification is what we use - # to determine the correct position of each heading link on - # the table of content. - TOCENTRIES[$COUNT]="$COUNT:${LEVEL[$COUNT]}:${PARENT[$COUNT]}:${LINK[$COUNT]}" - - # Update heading information inside the current file being - # processed. Use the first and final heading information. - sed -i -r "s!${FIRST[$COUNT]}!${FINAL[$COUNT]}!" $FILE - - # Increase heading counter. - COUNT=$(($COUNT + 1)) - - done - - # Build the table of contents using heading numerical - # identifications as reference. The numerical identification - # describes the order of headings in one xhtml file. This - # information is processed by awk to make the appropriate - # replacements. Finnally, the result is stored in the TOC - # variable. - TOC=$(echo '
' - echo "

`gettext "Table of contents"`

" - for TOCENTRY in "${TOCENTRIES[@]}";do - echo $TOCENTRY - done \ - | awk -f ${TOC_CONFIG}) - - # Update table of contents inside the current file being - # processed. - sed -i -r '/
[^<\/div].*<\/div>/c'"$(echo -e $TOC)" $FILE - - # Clean up variables to receive the next file. - unset FINAL - unset TITLE - unset MD5SM - unset OPTNS - unset CLASS - unset LEVEL - unset PARENT - unset TOCENTRIES - unset LINK - -} diff --git a/Automation/Functions/Tuneup/tuneup.sh b/Automation/Functions/Tuneup/tuneup.sh deleted file mode 100755 index 07f96fc..0000000 --- a/Automation/Functions/Tuneup/tuneup.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/bash -# -# tuneup.sh -- This function standardizes maintainance tasks for files -# inside the repository. Maintainance tasks are applied to files using -# file extension as reference. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function tuneup { - - local ACTIONNAM='' - local ACTIONVAL='' - - # Initialize name of rendition format as an empty value. The name - # of rendition format is determined automatically based on - # template file extension, later, when files are processed. - local TUNEUP_FORMAT='' - - # Initialize absolute path to format's base directory, the place - # where format-specific directories are stored in. - local TUNEUP_BASEDIR="${CLI_FUNCDIR}/${CLI_FUNCDIRNAM}" - - # Initialize list of supported file extensions. This is, the file - # extensions we want to perform maintenance tasks for. - local TUNEUP_EXTENSIONS='svg xhtml sh' - - # Interpret arguments and options passed through command-line. - tuneup_getOptions - - # Redefine positional parameters using ARGUMENTS. At this point, - # option arguments have been removed from ARGUMENTS variable and - # only non-option arguments remain in it. - eval set -- "$ARGUMENTS" - - # Define action name. No matter what option be passed to - # centos-art, there is only one action to perform (i.e., build the - # list of files and interpretation of file extensions for further - # processing). - ACTIONNAM="tuneup_doBaseActions" - - # Define action value. We use non-option arguments to define the - # action value (ACTIONVAL) variable. - for ACTIONVAL in "$@";do - - # Sanitate non-option arguments to be sure they match the - # directory conventions established by centos-art.sh script - # against source directory locations in the working copy. - ACTIONVAL=$(cli_checkRepoDirSource ${ACTIONVAL}) - - # Verify source location absolute path. It should point to - # existent directories under version control inside the - # working copy. Otherwise, if it doesn't point to an existent - # file under version control, finish the script execution with - # an error message. - cli_checkFiles ${ACTIONVAL} -d --is-versioned - - # Synchronize changes between repository and working copy. At - # this point, changes in the repository are merged in the - # working copy and changes in the working copy committed up to - # repository. - cli_synchronizeRepoChanges "${ACTIONVAL}" - - # Execute action name. - ${ACTIONNAM} - - # Synchronize changes between repository and working copy. At - # this point, changes in the repository are merged in the - # working copy and changes in the working copy committed up to - # repository. - cli_synchronizeRepoChanges "${ACTIONVAL}" - - done - -} diff --git a/Automation/Functions/Tuneup/tuneup_doBaseActions.sh b/Automation/Functions/Tuneup/tuneup_doBaseActions.sh deleted file mode 100755 index dc25fb8..0000000 --- a/Automation/Functions/Tuneup/tuneup_doBaseActions.sh +++ /dev/null @@ -1,98 +0,0 @@ -#!/bin/bash -# -# tuneup_doBaseActions.sh -- This function builds one list of files to -# process for each file extension supported and applies maintainance -# tasks file by file for each one of them. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function tuneup_doBaseActions { - - local TUNEUP_CONFIG_DIR='' - local TUNEUP_FORMAT_DIR='' - local TUNEUP_FORMAT_INIT='' - local TUNEUP_EXTENSION='' - local EXPORTID='' - local FILE='' - local FILES='' - - # Print separator line. - cli_printMessage '-' --as-separator-line - - # Loop through list of supported file extensions. - for TUNEUP_EXTENSION in ${TUNEUP_EXTENSIONS};do - - # Define format name based on supported file extensions. - TUNEUP_FORMAT="${TUNEUP_EXTENSION}" - - # Define specific functions export id. - EXPORTID="${CLI_FUNCDIRNAM}/$(cli_getRepoName ${TUNEUP_FORMAT} -d)/${TUNEUP_FORMAT}" - - # Define absolute path to directory where format-specific - # functionalities are stored in. - TUNEUP_FORMAT_DIR="${TUNEUP_BASEDIR}/$(cli_getRepoName \ - ${TUNEUP_FORMAT} -d)" - - # Define absolute path to format initialization script. - TUNEUP_FORMAT_INIT="${TUNEUP_FORMAT_DIR}/$(cli_getRepoName ${TUNEUP_FORMAT} -f).sh" - - # Verify absolute path to format initialization script. When - # a file extension is provided, but no format initialization - # script exists for it, continue with the next file extension - # in the list. - if [[ ! -f ${TUNEUP_FORMAT_INIT} ]];then - continue - fi - - # Define absolute path to directory where format-specific - # configurations are retrieved from. - TUNEUP_CONFIG_DIR="${TUNEUP_FORMAT_DIR}/Config" - - # Build list of files to process using action value as - # reference. - FILES=$(cli_getFilesList ${ACTIONVAL} --pattern="^.*${FLAG_FILTER}\.${TUNEUP_EXTENSION}$") - - # Verify list of files to process. Assuming no file is found, - # evaluate the next supported file extension. - if [[ $FILES == '' ]];then - continue - fi - - # Export format-specific functionalities up to the - # execution environment. - cli_exportFunctions "${EXPORTID}" - - # Execute format-specific maintenance tasks. - for FILE in $FILES;do - cli_printMessage "$FILE" --as-tuningup-line - ${TUNEUP_FORMAT} - done - - # Unset format-specific functionalities from execution - # environment. This is required to prevent end up with more - # than one format-specific function initialization, in those - # cases when different template files are rendered in just one - # execution of `centos-art.sh' script. - cli_unsetFunctions "${EXPORTID}" - - done - -} diff --git a/Automation/Functions/Tuneup/tuneup_getOptions.sh b/Automation/Functions/Tuneup/tuneup_getOptions.sh deleted file mode 100755 index 0cf8d33..0000000 --- a/Automation/Functions/Tuneup/tuneup_getOptions.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/bin/bash -# -# tuneup_getOptions.sh -- This function interprets option parameters -# passed to `tuneup' functionality and calls actions accordingly. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function tuneup_getOptions { - - # Define short options we want to support. - local ARGSS="h,q" - - # Define long options we want to support. - local ARGSL="help,quiet,filter:,answer-yes,synchronize" - - # Redefine ARGUMENTS using getopt(1) command parser. - cli_parseArguments - - # Redefine positional parameters using ARGUMENTS variable. - eval set -- "$ARGUMENTS" - - # Look for options passed through command-line. - while true; do - - case "$1" in - - -h | --help ) - cli_runFnEnvironment help --read --format="texinfo" "tcar-fs::scripts:bash-functions-tuneup" - shift 1 - exit - ;; - - -q | --quiet ) - FLAG_QUIET="true" - shift 1 - ;; - - --filter ) - FLAG_FILTER="$2" - shift 2 - ;; - - --answer-yes ) - FLAG_ANSWER="true" - shift 1 - ;; - - --synchronize ) - FLAG_SYNCHRONIZE="true" - shift 1 - ;; - - -- ) - # Remove the `--' argument from the list of arguments - # in order for processing non-option arguments - # correctly. At this point all option arguments have - # been processed already but the `--' argument still - # remains to mark ending of option arguments and - # begining of non-option arguments. The `--' argument - # needs to be removed here in order to avoid - # centos-art.sh script to process it as a path inside - # the repository, which obviously is not. - shift 1 - break - ;; - esac - done - - # Redefine ARGUMENTS variable using current positional parameters. - cli_parseArgumentsReDef "$@" - -} diff --git a/Automation/Functions/Vcs/Git/git.sh b/Automation/Functions/Vcs/Git/git.sh deleted file mode 100755 index 0f6bdd5..0000000 --- a/Automation/Functions/Vcs/Git/git.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash -# -# git.sh -- This function standardizes Git tasks inside the -# repository. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function git { - - # Redefine positional parameters using ARGUMENTS. At this point, - # option arguments have been removed from ARGUMENTS variable and - # only non-option arguments remain in it. - eval set -- "$ARGUMENTS" - - # Don't realize action value verification here. There are actions - # like `copy' and `rename' that require two arguments from which - # the last one doesn't exist at the moment of executing the - # command. This will provoke the second action value verification - # to fail when indeed is should not. Thus, go to action names - # processing directly. - - # All git actions will be performed against the working copy. - # Otherwise, errors like `fatal: Not a git repository (or any of - # the parent directories): .git' or `Unable to determine absolute - # path of git directory' might occur. So, move from whenever you - # be right now up to the git working copy. - pushd ${TCAR_WORKDIR} > /dev/null - - # Execute action names. This is required in order to realize - # actions like copy and rename which need two values as argument. - # Otherwise, it wouldn't be possible to execute them because - # action values would be processed one a time. Thus, lets work - # with `$@' instead. - for ACTIONNAM in $ACTIONNAMS;do - $ACTIONNAM "$@" - done - - # Return to the place you were initially. - popd > /dev/null - -} diff --git a/Automation/Functions/Vcs/Git/git_commitRepoChanges.sh b/Automation/Functions/Vcs/Git/git_commitRepoChanges.sh deleted file mode 100755 index f965966..0000000 --- a/Automation/Functions/Vcs/Git/git_commitRepoChanges.sh +++ /dev/null @@ -1,118 +0,0 @@ -#!/bin/bash -# -# git_commitRepoChanges.sh -- This function standardizes the way local -# changes are committed up to central repository. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function git_commitRepoChanges { - - local -a FILES - local -a INFO - local -a FILESNUM - local COUNT=0 - local STATUSOUT='' - local PREDICATE='' - local CHNGTOTAL=0 - local LOCATION=$(cli_checkRepoDirSource "${1}") - - # Verify source location absolute path. It should point to - # existent files or directories. They don't need to be under - # version control. - cli_checkFiles ${LOCATION} -e - - # Print action message. - cli_printMessage "`gettext "Checking changes in the working copy"`" --as-banner-line - - # Build list of files that have received changes in its version - # status. Be sure to keep output files off from this list. - # Remember, output files are not version inside the working copy, - # so they are not considered for evaluation here. But take care, - # sometimes output files are in the same format of source files, - # so we need to differentiate them using their locations. - STATUSOUT="$(${COMMAND} status --porcelain ${LOCATION})" - - # Process location based on its path information. Both - # by-extension and by-location exclusions are no longer needed - # here. They are already set in the `.git/info/exclude' file. - - # Define path to files considered recent modifications from - # working copy up to local repository. - FILES[0]=$(echo "$STATUSOUT" | egrep "^[[:space:]]M") - FILES[1]=$(echo "$STATUSOUT" | egrep "^\?\?") - FILES[2]=$(echo "$STATUSOUT" | egrep "^[[:space:]]D") - FILES[3]=$(echo "$STATUSOUT" | egrep "^[[:space:]]A") - FILES[4]=$(echo "$STATUSOUT" | egrep "^(A|M|R|C)( |M|D)") - - # Define description of files considered recent modifications from - # working copy up to local repository. - INFO[0]="`gettext "Modified"`" - INFO[1]="`gettext "Untracked"`" - INFO[2]="`gettext "Deleted"`" - INFO[3]="`gettext "Added"`" - INFO[4]="`gettext "Staged"`" - - while [[ $COUNT -ne ${#FILES[*]} ]];do - - # Define total number of files. Avoid counting empty line. - if [[ "${FILES[$COUNT]}" == '' ]];then - FILESNUM[$COUNT]=0 - else - FILESNUM[$COUNT]=$(echo "${FILES[$COUNT]}" | wc -l) - fi - - # Calculate total amount of changes. - CHNGTOTAL=$(($CHNGTOTAL + ${FILESNUM[$COUNT]})) - - # Build report predicate. Use report predicate to show any - # information specific to the number of files found. For - # example, you can use this section to show warning messages, - # notes, and so on. By default we use the word `file' or - # `files' at ngettext's consideration followed by change - # direction. - PREDICATE[$COUNT]=`ngettext "file in the working copy" \ - "files in the working copy" $((${FILESNUM[$COUNT]} + 1))` - - # Output report line. - cli_printMessage "${INFO[$COUNT]}: ${FILESNUM[$COUNT]} ${PREDICATE[$COUNT]}" --as-stdout-line - - # Increase counter. - COUNT=$(($COUNT + 1)) - - done - - # Stage files - cli_printMessage "`gettext "Do you want to stage files?"`" --as-yesornorequest-line - ${COMMAND} add ${LOCATION} - - # See staged differences. - cli_printMessage "`gettext "Do you want to see staged files differences?"`" --as-yesornorequest-line - ${COMMAND} diff --staged ${LOCATION} | less - - # Commit staged files. - cli_printMessage "`gettext "Do you want to commit staged files differences?"`" --as-yesornorequest-line - ${COMMAND} commit ${LOCATION} - - # Push committed files. - cli_printMessage "`gettext "Do you want to push committed files?"`" --as-yesornorequest-line - ${COMMAND} push - -} diff --git a/Automation/Functions/Vcs/Git/git_copyRepoFile.sh b/Automation/Functions/Vcs/Git/git_copyRepoFile.sh deleted file mode 100755 index 28e9cab..0000000 --- a/Automation/Functions/Vcs/Git/git_copyRepoFile.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash -# -# git_copyRepoFile.sh -- This function standardizes the way files -# (including directories) are duplicated inside the working copy. This -# function is an interface for git's `copy' command. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function git_copyRepoFile { - - local SOURCE=$(cli_checkRepoDirSource ${1}) - local TARGET=$(cli_checkRepoDirSource ${2}) - - # Verify source location absolute path. It should point to - # existent files or directories. They don't need to be under - # version control. - cli_checkFiles ${SOURCE} -e - - # Print action reference. - if [[ -f ${SOURCE} ]];then - cli_printMessage "${TARGET}/$(basename ${SOURCE})" --as-creating-line - else - cli_printMessage "${TARGET}" --as-creating-line - fi - - # Copy source location to its target using version control. I - # didn't find a copy command for Git. If you know a better way to - # track a copy action through Git, set it here. - /bin/cp ${SOURCE} ${TARGET} - if [[ $? -eq 0 ]];then - ${COMMAND} add ${TARGET} - fi - -} diff --git a/Automation/Functions/Vcs/Git/git_deleteRepoFile.sh b/Automation/Functions/Vcs/Git/git_deleteRepoFile.sh deleted file mode 100755 index 3623084..0000000 --- a/Automation/Functions/Vcs/Git/git_deleteRepoFile.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash -# -# git_deleteRepoFile.sh -- This function standardizes the way -# centos-art.sh script deletes files and directories inside the -# working copy. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function git_deleteRepoFile { - - local TARGET=$(cli_checkRepoDirSource ${1}) - - # Print action reference. - cli_printMessage "${TARGET}" --as-deleting-line - - # Reset target to its default status before remove it from the - # work copy. - if [[ $(cli_runFnEnvironment vcs --status ${TARGET}) =~ '^(A|M|R)$' ]];then - ${COMMAND} reset HEAD ${TARGET} --quiet - fi - - # Remove target based on whether it is under version control or - # not. - if [[ $(cli_runFnEnvironment vcs --status ${TARGET}) =~ '^\?\?$' ]];then - # Target isn't under version control. - if [[ -d ${TARGET} ]];then - rm -r ${TARGET} - else - rm ${TARGET} - fi - else - # Target is under version control. - if [[ -d ${TARGET} ]];then - ${COMMAND} rm ${TARGET} -r --force --quiet - else - ${COMMAND} rm ${TARGET} --force --quiet - fi - fi - -} diff --git a/Automation/Functions/Vcs/Git/git_getRepoStatus.sh b/Automation/Functions/Vcs/Git/git_getRepoStatus.sh deleted file mode 100755 index b54bd51..0000000 --- a/Automation/Functions/Vcs/Git/git_getRepoStatus.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# -# git_getRepoStatus.sh -- This function requests the working copy -# using the status command and returns the first character in the -# output line, as described in git help status, for the LOCATION -# specified. Use this function to perform verifications based a -# repository LOCATION status. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function git_getRepoStatus { - - local LOCATION=$(cli_checkRepoDirSource "$1") - - # Verify source location absolute path. It should point either to - # existent files or directories both under version control inside - # the working copy. Otherwise, if it doesn't point to an existent - # file under version control, finish the script execution with an - # error message. - cli_checkFiles ${LOCATION} -e - - # Define regular expression pattern to retrieve the work tree - # status. This is the second character of the first column - # returned by `git status --porcelain' command. - local PATTERN='^(.)(.)[[:space:]]+.+$' - - # Output the work tree status. - ${COMMAND} status "$LOCATION" --porcelain \ - | sed -r "s/${PATTERN}/\2/" - -} diff --git a/Automation/Functions/Vcs/Git/git_isVersioned.sh b/Automation/Functions/Vcs/Git/git_isVersioned.sh deleted file mode 100755 index 0b8c814..0000000 --- a/Automation/Functions/Vcs/Git/git_isVersioned.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# -# git_isVersioned.sh -- This function determines whether a location is -# under version control or not. When the location is under version -# control, this function returns `0'. When the location isn't under -# version control, this function returns `1'. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function git_isVersioned { - - # Define the location absolute path we want to determine whether - # it is under version control or not. Only the first non-option - # argument passed to centos-art.sh command-line will be used. - local LOCATION=$(cli_checkRepoDirSource "${1}") - - # Use Git to determine whether the location is under version - # control or not. - local OUTPUT=$(${COMMAND} status --porcelain ${LOCATION} \ - | egrep "\?\? ${LOCATION}") - - # If there are unversioned files inside location, stop the script - # execution with an error message. All files must be under version - # control except those set in the `.git/info/exclude/' file. - if [[ ! -z ${OUTPUT} ]];then - cli_printMessage "${LOCATION} `gettext " contains untracked files."`" --as-error-line - fi - -} diff --git a/Automation/Functions/Vcs/Git/git_mkRepoDirectory.sh b/Automation/Functions/Vcs/Git/git_mkRepoDirectory.sh deleted file mode 100755 index fd9fe0b..0000000 --- a/Automation/Functions/Vcs/Git/git_mkRepoDirectory.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash -# -# git_mkRepoDirectory.sh -- This function standardizes the way -# centos-art.sh script creates directories inside the working copy. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function git_mkRepoDirectory { - - local TARGET=$(cli_checkRepoDirSource ${1}) - - # Print action reference. - cli_printMessage "${TARGET}" --as-creating-line - - # Copy source location to its target using version control. - /bin/mkdir ${TARGET} - ${COMMAND} add ${TARGET} - -} diff --git a/Automation/Functions/Vcs/Git/git_syncRepoChanges.sh b/Automation/Functions/Vcs/Git/git_syncRepoChanges.sh deleted file mode 100755 index c2aa395..0000000 --- a/Automation/Functions/Vcs/Git/git_syncRepoChanges.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -# -# git_syncRepoChanges.sh -- This function standardizes the way changes -# are brought from central repository and merged into the local -# repository. It also standardizes the way local changes are send from -# the local repository up to central repository. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function git_syncRepoChanges { - - local LOCATION='' - local LOCATIONS="${@}" - - for LOCATION in $LOCATIONS;do - - # Verify whether the location is valid or not. - LOCATION=$(cli_checkRepoDirSource ${LOCATION}) - - # Verify source location absolute path. It should point either - # to existent files or directories both under version control - # inside the working copy. Otherwise, if it doesn't point to - # an existent file under version control, finish the script - # execution with an error message. - cli_checkFiles ${LOCATION} -e --is-versioned - - # Bring changes from the repository into the working copy. - git_updateRepoChanges ${LOCATION} - - # Check changes in the working copy. - git_commitRepoChanges ${LOCATION} - - done - -} diff --git a/Automation/Functions/Vcs/Git/git_updateRepoChanges.sh b/Automation/Functions/Vcs/Git/git_updateRepoChanges.sh deleted file mode 100755 index f24f399..0000000 --- a/Automation/Functions/Vcs/Git/git_updateRepoChanges.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -# -# git_updateRepoChanges.sh -- This function standardizes the way -# changes are merged into the repository's local working copy. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function git_updateRepoChanges { - - # Print action message. - cli_printMessage "`gettext "Bringing changes from the repository into the working copy"`" --as-banner-line - - # Update working copy and retrieve update output. When we use - # git, it is not possible to bring changes for specific - # directories trees but the whole repository tree. So, we need to - # position the script in the local working copy directory and - # execute the pull command therein. - # - # NOTE: The `${COMMAND} pull' command triggers the error `Unable - # to determine absolute path of git directory' while fetch and - # merge equivalents seems to do what we expect without any visible - # error. - ${COMMAND} fetch - ${COMMAND} merge FETCH_HEAD - -} diff --git a/Automation/Functions/Vcs/Subversion/subversion.sh b/Automation/Functions/Vcs/Subversion/subversion.sh deleted file mode 100755 index a534496..0000000 --- a/Automation/Functions/Vcs/Subversion/subversion.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# -# subversion.sh -- This function standardizes Subversion tasks inside -# the repository. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function subversion { - - # Redefine positional parameters using ARGUMENTS. At this point, - # option arguments have been removed from ARGUMENTS variable and - # only non-option arguments remain in it. - eval set -- "$ARGUMENTS" - - # Don't realize action value verification here. There are actions - # like `copy' and `rename' that require two arguments from which - # the last one doesn't exist at the moment of executing the - # command. This will provoke the second action value verification - # to fail when indeed is should not. Thus, go to action names - # processing directly. - - # Execute action names. This is required in order to realize - # actions like copy and rename which need two values as argument. - # Otherwise, it wouldn't be possible to execute them because - # action values would be processed one a time. Thus, lets work - # with `$@' instead. - for ACTIONNAM in $ACTIONNAMS;do - $ACTIONNAM "$@" - done - -} diff --git a/Automation/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh b/Automation/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh deleted file mode 100755 index 84d0ce7..0000000 --- a/Automation/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh +++ /dev/null @@ -1,154 +0,0 @@ -#!/bin/bash -# -# subversion_commitRepoChanges.sh -- This function explores the -# working copy and commits changes up to central repository after -# checking changes and adding files which aren't under version -# control. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function subversion_commitRepoChanges { - - local -a FILES - local -a INFO - local -a FILESNUM - local COUNT=0 - local STATUSOUT='' - local PREDICATE='' - local CHNGTOTAL=0 - local LOCATION=$(cli_checkRepoDirSource "$1") - - # Verify source location absolute path. It should point either to - # existent files or directories both under version control inside - # the working copy. Otherwise, if it doesn't point to an existent - # file under version control, finish the script execution with an - # error message. - cli_checkFiles ${LOCATION} -e --is-versioned - - # Print action message. - cli_printMessage "`gettext "Checking changes in the working copy"`" --as-banner-line - - # Build list of files that have received changes in its version - # status. Be sure to keep output files off from this list. - # Remember, output files are not version inside the working copy, - # so they are not considered for evaluation here. But take care, - # sometimes output files are in the same format of source files, - # so we need to differentiate them using their locations. - - # Process location based on its path information. - if [[ ${LOCATION} =~ 'Documentation/Manuals/Texinfo)' ]];then - STATUSOUT="$(${COMMAND} status ${LOCATION} | egrep -v '(pdf|txt|xhtml|xml|docbook|bz2)$')\n$STATUSOUT" - elif [[ $LOCATION =~ 'Documentation/Manuals/Docbook' ]];then - STATUSOUT="$(${COMMAND} status ${LOCATION} | egrep -v '(pdf|txt|xhtml)$')\n$STATUSOUT" - elif [[ $LOCATION =~ 'Identity' ]];then - STATUSOUT="$(${COMMAND} status ${LOCATION} | egrep -v '(pdf|png|jpg|rc|xpm|xbm|tif|ppm|pnm|gz|lss|log)$')\n$STATUSOUT" - else - STATUSOUT="$(${COMMAND} status ${LOCATION})\n$STATUSOUT" - fi - - # Sanitate status output. Expand new lines, remove leading spaces - # and empty lines. - STATUSOUT=$(echo -e "$STATUSOUT" | sed -r 's!^[[:space:]]*!!' | egrep -v '^[[:space:]]*$') - - # Define path to files considered recent modifications from - # working copy up to central repository. - FILES[0]=$(echo "$STATUSOUT" | egrep "^M" | sed -r "s,^.+${TCAR_WORKDIR}/,,") - FILES[1]=$(echo "$STATUSOUT" | egrep "^\?" | sed -r "s,^.+${TCAR_WORKDIR}/,,") - FILES[2]=$(echo "$STATUSOUT" | egrep "^D" | sed -r "s,^.+${TCAR_WORKDIR}/,,") - FILES[3]=$(echo "$STATUSOUT" | egrep "^A" | sed -r "s,^.+${TCAR_WORKDIR}/,,") - - # Define description of files considered recent modifications from - # working copy up to central repository. - INFO[0]="`gettext "Modified"`" - INFO[1]="`gettext "Unversioned"`" - INFO[2]="`gettext "Deleted"`" - INFO[3]="`gettext "Added"`" - - while [[ $COUNT -ne ${#FILES[*]} ]];do - - # Define total number of files. Avoid counting empty line. - if [[ "${FILES[$COUNT]}" == '' ]];then - FILESNUM[$COUNT]=0 - else - FILESNUM[$COUNT]=$(echo "${FILES[$COUNT]}" | wc -l) - fi - - # Calculate total amount of changes. - CHNGTOTAL=$(($CHNGTOTAL + ${FILESNUM[$COUNT]})) - - # Build report predicate. Use report predicate to show any - # information specific to the number of files found. For - # example, you can use this section to show warning messages, - # notes, and so on. By default we use the word `file' or - # `files' at ngettext's consideration followed by change - # direction. - PREDICATE[$COUNT]=`ngettext "file in the working copy" \ - "files in the working copy" $((${FILESNUM[$COUNT]} + 1))` - - # Output report line. - cli_printMessage "${INFO[$COUNT]}: ${FILESNUM[$COUNT]} ${PREDICATE[$COUNT]}" --as-stdout-line - - # Increase counter. - COUNT=$(($COUNT + 1)) - - done - - # When files have changed in the target location, show which these - # files are and request user to see such changes and then, for - # committing them up to the central repository. - if [[ ${FILESNUM[0]} -gt 0 ]];then - - cli_printMessage "`gettext "Do you want to see changes now?"`" --as-yesornorequest-line - ${COMMAND} diff ${LOCATION} | less - - # Commit changes up to central repository. - cli_printMessage "`gettext "Do you want to commit changes now?"`" --as-yesornorequest-line - ${COMMAND} commit ${LOCATION} - - fi - - # When there are unversioned files in the target location, show - # which these files are and request user to add such files into - # the working copy. - if [[ ${FILESNUM[1]} -gt 0 ]];then - - cli_printMessage '-' --as-separator-line - cli_printMessage "`gettext "Do you want to add unversioned files now?"`" --as-yesornorequest-line - for FILE in ${FILES[1]};do - ${COMMAND} add "${TCAR_WORKDIR}/$FILE" - done - - # Commit changes up to central repository. - cli_printMessage "`gettext "Do you want to commit changes now?"`" --as-yesornorequest-line - ${COMMAND} commit ${LOCATION} - - fi - - # When there are added files in the target location, show which - # these files are and request user to commit them up to central - # repository. - if [[ ${FILESNUM[3]} -gt 0 ]];then - cli_printMessage '-' --as-separator-line - cli_printMessage "`gettext "Do you want to commit changes now?"`" --as-yesornorequest-line - ${COMMAND} commit ${LOCATION} - fi - -} diff --git a/Automation/Functions/Vcs/Subversion/subversion_copyRepoFile.sh b/Automation/Functions/Vcs/Subversion/subversion_copyRepoFile.sh deleted file mode 100755 index 10729c5..0000000 --- a/Automation/Functions/Vcs/Subversion/subversion_copyRepoFile.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# -# subversion_copyRepoFile.sh -- This function standardizes the way -# files (including directories) are duplicated inside the working -# copy. This function is an interface for subversion's `copy' command. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function subversion_copyRepoFile { - - local SOURCE=$(cli_checkRepoDirSource ${1}) - local TARGET=$(cli_checkRepoDirSource ${2}) - - # Verify source location absolute path. It should point either to - # existent files or directories both under version control inside - # the working copy. Otherwise, if it doesn't point to an existent - # file under version control, finish the script execution with an - # error message. - cli_checkFiles ${SOURCE} -e --is-versioned - - # Print action reference. - if [[ -f ${SOURCE} ]];then - cli_printMessage "${TARGET}/$(basename ${SOURCE})" --as-creating-line - else - cli_printMessage "${TARGET}" --as-creating-line - fi - - # Copy source location to its target using version control. - ${COMMAND} copy ${SOURCE} ${TARGET} --quiet - -} diff --git a/Automation/Functions/Vcs/Subversion/subversion_deleteRepoFile.sh b/Automation/Functions/Vcs/Subversion/subversion_deleteRepoFile.sh deleted file mode 100755 index 5874af8..0000000 --- a/Automation/Functions/Vcs/Subversion/subversion_deleteRepoFile.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -# -# subversion_deleteRepoFile.sh -- This function standardizes the way -# centos-art.sh script deletes files and directories inside the -# working copy. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function subversion_deleteRepoFile { - - local TARGET=$(cli_checkRepoDirSource ${1}) - - # Print action reference. - cli_printMessage "${TARGET}" --as-deleting-line - - # Verify target existence. Be sure it is under version control. - cli_checkFiles "${TARGET}" --is-versioned - - # Revert changes before deleting related files. - ${COMMAND} revert ${TARGET} --quiet --recursive - - # Delete source location. - ${COMMAND} delete ${TARGET} --quiet --force - -} diff --git a/Automation/Functions/Vcs/Subversion/subversion_getRepoStatus.sh b/Automation/Functions/Vcs/Subversion/subversion_getRepoStatus.sh deleted file mode 100755 index f4eb4bf..0000000 --- a/Automation/Functions/Vcs/Subversion/subversion_getRepoStatus.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# -# subversion_getRepoStatus.sh -- This function requests the working -# copy using the svn status command and returns the first character in -# the output line, as described in svn help status, for the LOCATION -# specified. Use this function to perform verifications based a -# repository LOCATION status. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function subversion_getRepoStatus { - - local LOCATION=$(cli_checkRepoDirSource "$1") - - # Verify source location absolute path. It should point either to - # existent files or directories both under version control inside - # the working copy. Otherwise, if it doesn't point to an existent - # file under version control, finish the script execution with an - # error message. - cli_checkFiles ${LOCATION} -e --is-versioned - - # Define regular expression pattern to retrieve first column, - # returned by subversion status command. This column is one - # character column as describes `svn help status' command. - local PATTERN='^( |A|C|D|I|M|R|X|!|~).+$' - - # Output specific state of location using subversion `status' - # command. - ${COMMAND} status "$LOCATION" -N --quiet | sed -r "s/${PATTERN}/\1/" - -} diff --git a/Automation/Functions/Vcs/Subversion/subversion_isVersioned.sh b/Automation/Functions/Vcs/Subversion/subversion_isVersioned.sh deleted file mode 100755 index 92f5a48..0000000 --- a/Automation/Functions/Vcs/Subversion/subversion_isVersioned.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -# -# subversion_isVersioned.sh -- This function determines whether a -# location is under version control or not. When the location is under -# version control, this function returns `0'. When the location isn't -# under version control, this function returns `1'. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function subversion_isVersioned { - - # Define the location absolute path we want to determine whether - # it is under version control or not. Only the first non-option - # argument passed to centos-art.sh command-line will be used. - local LOCATION=$(cli_checkRepoDirSource "${1}") - - # Use Subversion to determine whether the location is under - # version control or not. - ${COMMAND} info ${LOCATION} > /dev/null 2>&1 - - # Verify Subversion's exit status. - if [[ $? -ne 0 ]];then - cli_printMessage "${LOCATION} `gettext "isn't under version control."`" --as-error-line - fi - -} diff --git a/Automation/Functions/Vcs/Subversion/subversion_mkRepoDirectory.sh b/Automation/Functions/Vcs/Subversion/subversion_mkRepoDirectory.sh deleted file mode 100755 index 2e28067..0000000 --- a/Automation/Functions/Vcs/Subversion/subversion_mkRepoDirectory.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -# -# subversion_mkRepoDirectory.sh -- This function standardizes the way -# centos-art.sh script creates directories inside the working copy. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function subversion_mkRepoDirectory { - - local TARGET=$(cli_checkRepoDirSource ${1}) - - # Print action reference. - cli_printMessage "${TARGET}" --as-creating-line - - # Copy source location to its target using version control. - ${COMMAND} mkdir ${TARGET} --quiet - -} diff --git a/Automation/Functions/Vcs/Subversion/subversion_syncRepoChanges.sh b/Automation/Functions/Vcs/Subversion/subversion_syncRepoChanges.sh deleted file mode 100755 index 1171c4f..0000000 --- a/Automation/Functions/Vcs/Subversion/subversion_syncRepoChanges.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -# -# subversion_syncRepoChanges.sh -- This function synchronizes both -# central repository and working copy directory structures by -# performing a subversion update command first and a subversion commit -# command later. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function subversion_syncRepoChanges { - - local LOCATION='' - local LOCATIONS="${@}" - - for LOCATION in $LOCATIONS;do - - # Verify whether the location is valid or not. - LOCATION=$(cli_checkRepoDirSource ${LOCATION}) - - # Verify source location absolute path. It should point either - # to existent files or directories both under version control - # inside the working copy. Otherwise, if it doesn't point to - # an existent file under version control, finish the script - # execution with an error message. - cli_checkFiles ${LOCATION} -e --is-versioned - - # Bring changes from the repository into the working copy. - subversion_updateRepoChanges ${LOCATION} - - # Check changes in the working copy. - subversion_commitRepoChanges ${LOCATION} - - done - -} diff --git a/Automation/Functions/Vcs/Subversion/subversion_updateRepoChanges.sh b/Automation/Functions/Vcs/Subversion/subversion_updateRepoChanges.sh deleted file mode 100755 index 5b24acb..0000000 --- a/Automation/Functions/Vcs/Subversion/subversion_updateRepoChanges.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/bash -# -# subversion_updateRepoChanges.sh -- This function realizes a -# subversion update command against the working copy in order to bring -# changes from the central repository into the working copy. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function subversion_updateRepoChanges { - - local -a FILES - local -a INFO - local -a FILESNUM - local COUNT=0 - local UPDATEOUT='' - local PREDICATE='' - local CHNGTOTAL=0 - local LOCATION=$(cli_checkRepoDirSource "$1") - - # Verify source location absolute path. It should point either to - # existent files or directories both under version control inside - # the working copy. Otherwise, if it doesn't point to an existent - # file under version control, finish the script execution with an - # error message. - cli_checkFiles ${LOCATION} -e --is-versioned - - # Update working copy and retrieve update output. - cli_printMessage "`gettext "Bringing changes from the repository into the working copy"`" --as-banner-line - UPDATEOUT=$(${COMMAND} update ${LOCATION} --quiet) - - # Define path of files considered recent modifications from - # central repository to working copy. - FILES[0]=$(echo "$UPDATEOUT" | egrep "^A" | sed -r "s,^.+${TCAR_WORKDIR},,") - FILES[1]=$(echo "$UPDATEOUT" | egrep "^D" | sed -r "s,^.+${TCAR_WORKDIR},,") - FILES[2]=$(echo "$UPDATEOUT" | egrep "^U" | sed -r "s,^.+${TCAR_WORKDIR},,") - FILES[3]=$(echo "$UPDATEOUT" | egrep "^C" | sed -r "s,^.+${TCAR_WORKDIR},,") - FILES[4]=$(echo "$UPDATEOUT" | egrep "^G" | sed -r "s,^.+${TCAR_WORKDIR},,") - - # Define description of files considered recent modifications from - # central repository to working copy. - INFO[0]="`gettext "Added"`" - INFO[1]="`gettext "Deleted"`" - INFO[2]="`gettext "Updated"`" - INFO[3]="`gettext "Conflicted"`" - INFO[4]="`gettext "Merged"`" - - while [[ $COUNT -ne ${#FILES[*]} ]];do - - # Define total number of files. Avoid counting empty line. - if [[ "${FILES[$COUNT]}" == '' ]];then - FILESNUM[$COUNT]=0 - else - FILESNUM[$COUNT]=$(echo "${FILES[$COUNT]}" | wc -l) - fi - - # Calculate total amount of changes. - CHNGTOTAL=$(($CHNGTOTAL + ${FILESNUM[$COUNT]})) - - # Build report predicate. Use report predicate to show any - # information specific to the number of files found. For - # example, you can use this section to show warning messages, - # notes, and so on. By default we use the word `file' or - # `files' at ngettext's consideration followed by change - # direction. - PREDICATE[$COUNT]=`ngettext "file from the repository" \ - "files from the repository" $((${FILESNUM[$COUNT]} + 1))` - - # Output report line. - cli_printMessage "${INFO[$COUNT]}: ${FILESNUM[$COUNT]} ${PREDICATE[$COUNT]}" --as-stdout-line - - # Increase counter. - COUNT=$(($COUNT + 1)) - - done - -} diff --git a/Automation/Functions/Vcs/vcs.sh b/Automation/Functions/Vcs/vcs.sh deleted file mode 100755 index 7585198..0000000 --- a/Automation/Functions/Vcs/vcs.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/bash -# -# vcs.sh -- This function standardizes version control tasks inside -# the repository. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function vcs { - - local ACTIONNAM='' - local ACTIONNAMS='' - local ACTIONVAL='' - - # Verify whether version control actions should be performed or - # not inside the repository directory structure. - local ENABLED=$(cli_getConfigValue "${CLI_BASEDIR}/${CLI_NAME}.conf" "version_control" "enabled") - if [[ ! ${ENABLED} =~ '^(yes|ye|y|1)$' ]];then - return - fi - - # Initialize version control system to use inside the repository. - local PACKAGE=$(cli_getConfigValue "${CLI_BASEDIR}/${CLI_NAME}.conf" "version_control" "package") - - # Set possible values to packages used as version control system. - if [[ ${PACKAGE} =~ '^(git|subversion)$' ]];then - - # Initialize the absolute path to commands we'll use as - # version control system in the working copy. - case ${PACKAGE} in - - 'git' ) - COMMAND=/usr/bin/git - ;; - - 'subversion' ) - COMMAND=/usr/bin/svn - ;; - esac - - else - cli_printMessage "${PACKAGE} `gettext "isn't supported as version control system."`" --as-error-line - fi - - # Verify whether the related package is installed or not. - cli_checkFiles ${PACKAGE} --is-installed - - # Interpret arguments and options passed through command-line. - vcs_getOptions - - # Initialize function specific export id. - local EXPORTID="${CLI_FUNCDIRNAM}/$(cli_getRepoName ${PACKAGE} -d)/$(cli_getRepoName ${PACKAGE} -f)" - - # Export specific functionalities to the script environment. - cli_exportFunctions "${EXPORTID}" - - # Execute version control. - ${PACKAGE} - - # Unset specific functionalities from the script environment. - cli_unsetFunctions "${EXPORTID}" - -} diff --git a/Automation/Functions/Vcs/vcs_getOptions.sh b/Automation/Functions/Vcs/vcs_getOptions.sh deleted file mode 100755 index 3a0fcb6..0000000 --- a/Automation/Functions/Vcs/vcs_getOptions.sh +++ /dev/null @@ -1,117 +0,0 @@ -#!/bin/bash -# -# vcs_getOptions.sh -- This function interprets option parameters -# passed to `vcs' functionality and calls actions accordingly. This -# function serves as interface to Subversion and Git -# sub-functionalities. -# -# 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. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function vcs_getOptions { - - # Define short options we want to support. - local ARGSS="h,q" - - # Define long options we want to support. - local ARGSL="help,quiet,synchronize,update,commit,is-versioned,status,mkdir,copy,delete" - - # Redefine ARGUMENTS using getopt(1) command parser. - cli_parseArguments - - # Redefine positional parameters using ARGUMENTS variable. - eval set -- "$ARGUMENTS" - - # Look for options passed through command-line. - while true; do - - case "$1" in - - -h | --help ) - cli_runFnEnvironment help --read --format="texinfo" "tcar-fs::scripts:bash-functions-vcs" - shift 1 - exit - ;; - - -q | --quiet ) - FLAG_QUIET="true" - shift 1 - ;; - - --synchronize ) - ACTIONNAMS="${ACTIONNAMS} ${PACKAGE}_syncRepoChanges" - shift 1 - ;; - - --commit ) - ACTIONNAMS="${ACTIONNAMS} ${PACKAGE}_commitRepoChanges" - shift 1 - ;; - - --update ) - ACTIONNAMS="${ACTIONNAMS} ${PACKAGE}_updateRepoChanges" - shift 1 - ;; - - --is-versioned ) - ACTIONNAMS="${ACTIONNAMS} ${PACKAGE}_isVersioned" - shift 1 - ;; - - --status ) - ACTIONNAMS="${ACTIONNAMS} ${PACKAGE}_getRepoStatus" - shift 1 - ;; - - --copy ) - ACTIONNAMS="${ACTIONNAMS} ${PACKAGE}_copyRepoFile" - shift 1 - ;; - - --mkdir ) - ACTIONNAMS="${ACTIONNAMS} ${PACKAGE}_mkRepoDirectory" - shift 1 - ;; - - --delete ) - ACTIONNAMS="${ACTIONNAMS} ${PACKAGE}_deleteRepoFile" - shift 1 - ;; - - -- ) - # Remove the `--' argument from the list of arguments - # in order for processing non-option arguments - # correctly. At this point all option arguments have - # been processed already but the `--' argument still - # remains to mark ending of option arguments and - # beginning of non-option arguments. The `--' argument - # needs to be removed here in order to avoid - # centos-art.sh script to process it as a path inside - # the repository, which obviously is not. - shift 1 - break - ;; - esac - done - - # Redefine ARGUMENTS variable using current positional parameters. - cli_parseArgumentsReDef "$@" - -} diff --git a/Automation/centos-art.sh-docs.asciidoc b/Automation/centos-art.sh-docs.asciidoc new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Automation/centos-art.sh-docs.asciidoc diff --git a/Automation/centos-art.sh-l10n/centos-art.sh-docs-es_ES.po b/Automation/centos-art.sh-l10n/centos-art.sh-docs-es_ES.po new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Automation/centos-art.sh-l10n/centos-art.sh-docs-es_ES.po diff --git a/Automation/centos-art.sh-l10n/centos-art.sh-docs-es_ES.pot b/Automation/centos-art.sh-l10n/centos-art.sh-docs-es_ES.pot new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Automation/centos-art.sh-l10n/centos-art.sh-docs-es_ES.pot diff --git a/Automation/centos-art.sh-l10n/centos-art.sh-mods-es_ES.po b/Automation/centos-art.sh-l10n/centos-art.sh-mods-es_ES.po new file mode 100644 index 0000000..a1b0801 --- /dev/null +++ b/Automation/centos-art.sh-l10n/centos-art.sh-mods-es_ES.po @@ -0,0 +1,2272 @@ +# Spanish translations for centos-art-0.4 package +# Traducciones al español para el paquete centos-art-0.4. +# Copyright (C) 2013 The CentOS Project +# This file is distributed under the same license as the centos-art-0.4 package. +# Automatically generated, 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: centos-art-0.4\n" +"Report-Msgid-Bugs-To: Documentation SIG \n" +"POT-Creation-Date: 2013-05-30 23:31-0400\n" +"PO-Revision-Date: 2013-05-30 23:31-0400\n" +"Last-Translator: Documentation SIG\n" +"Language-Team: Español\n" +"MIME-Version: 1.0\n" +"Content-Type: textplain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: Scripts/Bash/Functions/Commons/cli.sh:73 +#, sh-format +msgid "The $FILE needs to have execution rights." +msgstr "El fichero $FILE necesita tener permiso de ejecución." + +#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:69 +msgid "isn't a directory." +msgstr "no es un directorio." + +#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:76 +msgid "doesn't exist." +msgstr "no existe." + +#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:83 +msgid "isn't a regular file." +msgstr "no es un fichero regular." + +#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:90 +msgid "isn't a symbolic link." +msgstr "no es un enlace simbólico." + +#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:97 +msgid "isn't an executable file." +msgstr "no es un fichero ejecutable." + +#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:105 +#, sh-format +msgid "isn't a \"$MIME\" file." +msgstr "isn't a \"$MIME\" file." + +#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:112 +#, sh-format +msgid "doesn't match its pattern." +msgstr "no coincide con su patrón." + +#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:126 +msgid "isn't installed in the system." +msgstr "no está instalado en el sistema." + +#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:176 +msgid "The condition command provided isn't supported." +msgstr "El comando condicional suministrado no está soportado." + +#: Scripts/Bash/Functions/Commons/cli_exportFunctions.sh:35 +msgid "The export id doesn't match its pattern." +msgstr "El identificador de exportación no coincide su patrón." + +#: Scripts/Bash/Functions/Commons/cli_exportFunctions.sh:70 +msgid "No function file was found." +msgstr "Ningún fichero de función fue encontrado." + +#: Scripts/Bash/Functions/Commons/cli_getConfigLines.sh:42 +msgid "The configuration section provided is incorrect." +msgstr "La sección de configuración suministrada es incorrecta." + +#: Scripts/Bash/Functions/Commons/cli_getTemporalFile.sh:38 +msgid "The first argument cannot be empty." +msgstr "El primer argumento no puede estar vacío." + +#: Scripts/Bash/Functions/Commons/cli_printCopyrightInfo.sh:44 +msgid "Creative Common Attribution-ShareAlike 3.0 License" +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_printCopyrightInfo.sh:104 +msgid "All rights reserved." +msgstr "Todos los derechos reservados." + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:33 +msgid "The message cannot be empty." +msgstr "El mensaje no puede estar vacío." + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:90 +msgid "To know more, run" +msgstr "Para conocer más, ejecute" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:97 +msgid "yes" +msgstr "sí" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:100 +msgid "no" +msgstr "no" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:187 +msgid "Cropping from" +msgstr "Recortando de" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:191 +msgid "Tuning-up" +msgstr "Afinado" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:195 +msgid "Checking" +msgstr "Comprobando" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:199 +msgid "Combining" +msgstr "Combinando" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:204 +msgid "Updating" +msgstr "Actualizando" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:206 +msgid "Creating" +msgstr "Creando" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:211 +msgid "Deleting" +msgstr "Eliminando" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:215 +msgid "Reading" +msgstr "Leyendo" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:219 +msgid "Saved as" +msgstr "Guardado como" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:223 +msgid "Linked to" +msgstr "Enlazado a" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:227 +msgid "Moved to" +msgstr "Movido a" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:231 +msgid "Translation" +msgstr "Traducción" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:235 +msgid "Validating" +msgstr "Validando" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:239 +msgid "Template" +msgstr "Plantilla" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:243 +msgid "Configuration" +msgstr "Configuración" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:247 +msgid "Palette" +msgstr "Paleta" + +#: Scripts/Bash/Functions/Commons/cli_unsetFunctions.sh:37 +msgid "The export id was not provided." +msgstr "El identificador de exportación no fue suministrado." + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo.sh:35 +#: Scripts/Bash/Functions/Help/help_getEntries.sh:116 +msgid "The documentation entry provided isn't supported." +msgstr "La entrada de documentación suministrada no está soportada." + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo.sh:91 +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_copyEntry.sh:70 +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_deleteEntry.sh:63 +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_renameEntry.sh:70 +msgid "The parameters you provided are not supported." +msgstr "Los parámetros que usted suministró no están soportados." + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_checkEntrySrcDst.sh:37 +msgid "The source location doesn't exist." +msgstr "La ubicación de origen no existe." + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_checkEntrySrcDst.sh:43 +msgid "The source and target locations cannot be the same." +msgstr "La ubicación de origen y destino no puden ser las mismas." + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_checkEntrySrcDst.sh:50 +msgid "The source location has pending changes." +msgstr "La ubicación de origen tiene cambios pendientes." + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_checkEntrySrcDst.sh:63 +msgid "The target location already exists." +msgstr "La ubicación de destino ya existe." + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_copyEntrySection.sh:51 +msgid "The location provided as target isn't valid." +msgstr "La ubicación suministrada como destino no es válida." + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_createChapter.sh:36 +msgid "The following documentation chapter doesn't exist:" +msgstr "El capítulo de documentación siguiente no existe:" + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_createChapter.sh:38 +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_createStructure.sh:38 +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_editEntry.sh:42 +msgid "Do you want to create it now?" +msgstr "¿Desea crearlo ahora?" + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_createChapter.sh:47 +msgid "Enter chapter's title" +msgstr "Entre el título del capítulo" + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_createStructure.sh:36 +#, sh-format +msgid "The following documentation manual doesn't exist:" +msgstr "El manual de documentación siguiente no existe:" + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_createStructure.sh:47 +msgid "Enter manual's title" +msgstr "Entre el título del manual" + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_createStructure.sh:49 +msgid "Enter manual's subtitle" +msgstr "Entre el subtítulo del manual" + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_createStructure.sh:51 +msgid "Enter manual's abstract" +msgstr "Entre el preámbulo del manual" + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_createStructure.sh:57 +msgid "The manual title cannot be empty." +msgstr "El título del manual no puede estar vacío." + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_deleteCrossReferences.sh:41 +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_getEntryNode.sh:33 +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_restoreCrossReferences.sh:45 +msgid "The first positional parameter cannot be empty." +msgstr "El primer argumento de posición no puede estar vacío." + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_deleteCrossReferences.sh:50 +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_deleteCrossReferences.sh:62 +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_renameCrossReferences.sh:38 +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_renameCrossReferences.sh:43 +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_restoreCrossReferences.sh:53 +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_restoreCrossReferences.sh:54 +msgid "Removed" +msgstr "Eliminando" + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_deleteEntryChapter.sh:41 +msgid "The chapter specified cannot be removed." +msgstr "El capítulo especificado no puede eliminarse." + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_editEntry.sh:40 +msgid "The following documentation section doesn't exist:" +msgstr "La sección de documentación siguiente no existe:" + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_updateLicenseLink.sh:52 +msgid "has an old directory structure." +msgstr "tiene una estructura de directorio vieja." + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_updateStructureSection.sh:114 +msgid "There wasn't any section for processing found." +msgstr "No se encontraron secciones para ser procesadas." + +#: Scripts/Bash/Functions/Help/help_getOptions.sh:79 +msgid "The documentation format provided is not supported." +msgstr "El formato de documentación suministrado no está soportado." + +#: Scripts/Bash/Functions/Locale/locale_combineLicenseMessages.sh:29 +msgid "One argument is required." +msgstr "Un argumento es necesario." + +#: Scripts/Bash/Functions/Locale/locale_editMessages.sh:32 +#: Scripts/Bash/Functions/Locale/locale_updateMessages.sh:36 +msgid "The English language cannot be localized to itself." +msgstr "El idioma Inglés no puede ser traducido a sí mismo." + +#: Scripts/Bash/Functions/Locale/locale_editMessages.sh:39 +#: Scripts/Bash/Functions/Locale/locale_editMessages.sh:69 +#: Scripts/Bash/Functions/Locale/locale_updateMessages.sh:43 +msgid "The path provided does not support localization." +msgstr "El camino suministrado no soporta la localización." + +#: Scripts/Bash/Functions/Locale/locale_editMessages.sh:74 +msgid "The path provided hasn't translations yet." +msgstr "El camino suministrado no tiene traducciones aún." + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:28 +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:28 +msgid "Unknown" +msgstr "Desconocido" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:33 +msgid "Andorra" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:36 +msgid "United Arab Emirates" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:39 +msgid "Afghanistan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:42 +msgid "Antigua and Barbuda" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:45 +msgid "Anguilla" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:48 +msgid "Albania" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:51 +msgid "Armenia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:54 +msgid "Netherlands Antilles" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:57 +msgid "Angola" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:60 +msgid "Antarctica" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:63 +msgid "Argentina" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:66 +msgid "Samoa (American)" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:69 +msgid "Austria" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:72 +msgid "Australia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:75 +msgid "Aruba" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:78 +msgid "Azerbaijan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:81 +msgid "Bosnia and Herzegovina" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:84 +msgid "Barbados" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:87 +msgid "Bangladesh" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:90 +msgid "Belgium" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:93 +msgid "Burkina Faso" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:96 +msgid "Bulgaria" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:99 +msgid "Bahrain" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:102 +msgid "Burundi" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:105 +msgid "Benin" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:108 +msgid "Bermuda" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:111 +msgid "Brunei" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:114 +msgid "Bolivia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:117 +msgid "Brazil" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:120 +msgid "Bahamas" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:123 +msgid "Bhutan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:126 +msgid "Bouvet Island" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:129 +msgid "Botswana" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:132 +msgid "Belarus" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:135 +msgid "Belize" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:138 +msgid "Canada" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:141 +msgid "Cocos (Keeling) Islands" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:144 +msgid "Congo (Dem. Rep.)" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:147 +msgid "Central African Rep." +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:150 +msgid "Congo (Rep.)" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:153 +msgid "Switzerland" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:156 +msgid "Co^te d'Ivoire" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:159 +msgid "Cook Islands" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:162 +msgid "Chile" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:165 +msgid "Cameroon" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:168 +msgid "China" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:171 +msgid "Colombia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:174 +msgid "Costa Rica" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:177 +msgid "Serbia and Montenegro" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:180 +msgid "Cuba" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:183 +msgid "Cape Verde" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:186 +msgid "Christmas Island" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:189 +msgid "Cyprus" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:192 +msgid "Czech Republic" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:195 +msgid "Germany" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:198 +msgid "Djibouti" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:201 +msgid "Denmark" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:204 +msgid "Dominica" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:207 +msgid "Dominican Republic" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:210 +msgid "Algeria" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:213 +msgid "Ecuador" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:216 +msgid "Estonia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:219 +msgid "Egypt" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:222 +msgid "Western Sahara" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:225 +msgid "Eritrea" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:228 +msgid "Spain" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:231 +msgid "Ethiopia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:234 +msgid "Finland" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:237 +msgid "Fiji" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:240 +msgid "Falkland Islands" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:243 +msgid "Micronesia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:246 +msgid "Faeroe Islands" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:249 +msgid "France" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:252 +msgid "Gabon" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:255 +msgid "Britain (UK)" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:258 +msgid "Grenada" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:261 +msgid "Georgia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:264 +msgid "French Guiana" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:267 +msgid "Ghana" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:270 +msgid "Gibraltar" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:273 +msgid "Greenland" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:276 +msgid "Gambia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:279 +msgid "Guinea" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:282 +msgid "Guadeloupe" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:285 +msgid "Equatorial Guinea" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:288 +msgid "Greece" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:291 +msgid "South Georgia and the South Sandwich Islands" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:294 +msgid "Guatemala" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:297 +msgid "Guam" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:300 +msgid "Guinea-Bissau" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:303 +msgid "Guyana" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:306 +msgid "Hong Kong" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:309 +msgid "Heard Island and McDonald Islands" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:312 +msgid "Honduras" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:315 +msgid "Croatia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:318 +msgid "Haiti" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:321 +msgid "Hungary" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:324 +msgid "Indonesia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:327 +msgid "Ireland" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:330 +msgid "Israel" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:333 +msgid "India" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:336 +msgid "British Indian Ocean Territory" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:339 +msgid "Iraq" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:342 +msgid "Iran" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:345 +msgid "Iceland" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:348 +msgid "Italy" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:351 +msgid "Jamaica" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:354 +msgid "Jordan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:357 +msgid "Japan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:360 +msgid "Kenya" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:363 +msgid "Kyrgyzstan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:366 +msgid "Cambodia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:369 +msgid "Kiribati" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:372 +msgid "Comoros" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:375 +msgid "St Kitts and Nevis" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:378 +msgid "Korea (North)" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:381 +msgid "Korea (South)" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:384 +msgid "Kuwait" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:387 +msgid "Cayman Islands" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:390 +msgid "Kazakhstan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:393 +msgid "Laos" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:396 +msgid "Lebanon" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:399 +msgid "St Lucia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:402 +msgid "Liechtenstein" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:405 +msgid "Sri Lanka" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:408 +msgid "Liberia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:411 +msgid "Lesotho" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:414 +msgid "Lithuania" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:417 +msgid "Luxembourg" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:420 +msgid "Latvia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:423 +msgid "Libya" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:426 +msgid "Morocco" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:429 +msgid "Monaco" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:432 +msgid "Moldova" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:435 +msgid "Madagascar" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:438 +msgid "Marshall Islands" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:441 +msgid "Macedonia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:444 +msgid "Mali" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:447 +msgid "Myanmar (Burma)" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:450 +msgid "Mongolia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:453 +msgid "Macao" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:456 +msgid "Northern Mariana Islands" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:459 +msgid "Martinique" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:462 +msgid "Mauritania" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:465 +msgid "Montserrat" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:468 +msgid "Malta" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:471 +msgid "Mauritius" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:474 +msgid "Maldives" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:477 +msgid "Malawi" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:480 +msgid "Mexico" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:483 +msgid "Malaysia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:486 +msgid "Mozambique" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:489 +msgid "Namibia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:492 +msgid "New Caledonia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:495 +msgid "Niger" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:498 +msgid "Norfolk Island" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:501 +msgid "Nigeria" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:504 +msgid "Nicaragua" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:507 +msgid "Netherlands" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:510 +msgid "Norway" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:513 +msgid "Nepal" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:516 +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:476 +msgid "Nauru" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:519 +msgid "Niue" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:522 +msgid "New Zealand" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:525 +msgid "Oman" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:528 +msgid "Panama" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:531 +msgid "Peru" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:534 +msgid "French Polynesia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:537 +msgid "Papua New Guinea" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:540 +msgid "Philippines" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:543 +msgid "Pakistan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:546 +msgid "Poland" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:549 +msgid "St Pierre and Miquelon" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:552 +msgid "Pitcairn" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:555 +msgid "Puerto Rico" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:558 +msgid "Palestine" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:561 +msgid "Portugal" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:564 +msgid "Palau" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:567 +msgid "Paraguay" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:570 +msgid "Qatar" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:573 +msgid "Reunion" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:576 +msgid "Romania" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:579 +msgid "Russia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:582 +msgid "Rwanda" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:585 +msgid "Saudi Arabia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:588 +msgid "Solomon Islands" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:591 +msgid "Seychelles" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:594 +msgid "Sudan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:597 +msgid "Sweden" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:600 +msgid "Singapore" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:603 +msgid "St Helena" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:606 +msgid "Slovenia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:609 +msgid "Svalbard and Jan Mayen" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:612 +msgid "Slovakia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:615 +msgid "Sierra Leone" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:618 +msgid "San Marino" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:621 +msgid "Senegal" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:624 +msgid "Somalia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:627 +msgid "Suriname" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:630 +msgid "Sao Tome and Principe" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:633 +msgid "El Salvador" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:636 +msgid "Syria" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:639 +msgid "Swaziland" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:642 +msgid "Turks and Caicos Islands" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:645 +msgid "Chad" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:648 +msgid "French Southern and Antarctic Lands" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:651 +msgid "Togo" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:654 +msgid "Thailand" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:657 +msgid "Tajikistan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:660 +msgid "Tokelau" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:663 +msgid "Timor-Leste" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:666 +msgid "Turkmenistan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:669 +msgid "Tunisia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:672 +msgid "Tonga" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:675 +msgid "Turkey" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:678 +msgid "Trinidad and Tobago" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:681 +msgid "Tuvalu" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:684 +msgid "Taiwan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:687 +msgid "Tanzania" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:690 +msgid "Ukraine" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:693 +msgid "Uganda" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:696 +msgid "US minor outlying islands" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:699 +msgid "United States" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:702 +msgid "Uruguay" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:705 +msgid "Uzbekistan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:708 +msgid "Vatican City" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:711 +msgid "St Vincent" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:714 +msgid "Venezuela" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:717 +msgid "Virgin Islands (UK)" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:720 +msgid "Virgin Islands (US)" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:723 +msgid "Vietnam" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:726 +msgid "Vanuatu" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:729 +msgid "Wallis and Futuna" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:732 +msgid "Samoa (Western)" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:735 +msgid "Yemen" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:738 +msgid "Mayotte" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:741 +msgid "South Africa" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:744 +msgid "Zambia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:747 +msgid "Zimbabwe" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:33 +msgid "Afar" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:37 +msgid "Abkhazian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:41 +msgid "Avestan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:45 +msgid "Afrikaans" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:49 +msgid "Akan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:53 +msgid "Amharic" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:57 +msgid "Aragonese" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:61 +msgid "Arabic" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:65 +msgid "Assamese" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:69 +msgid "Avaric" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:73 +msgid "Aymara" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:77 +msgid "Azerbaijani" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:81 +msgid "Bashkir" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:85 +msgid "Byelorussian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:89 +msgid "Bulgarian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:93 +msgid "Bihari" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:97 +msgid "Bislama" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:101 +msgid "Bambara" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:105 +msgid "Bengali" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:109 +msgid "Tibetan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:113 +msgid "Breton" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:117 +msgid "Bosnian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:121 +msgid "Catalan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:125 +msgid "Chechen" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:129 +msgid "Chamorro" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:133 +msgid "Corsican" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:137 +msgid "Cree" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:141 +msgid "Czech" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:145 +msgid "Church Slavic" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:149 +msgid "Chuvash" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:153 +msgid "Welsh" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:157 +msgid "Danish" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:161 +msgid "German" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:165 +msgid "Divehi" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:169 +msgid "Dzongkha" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:173 +msgid "E'we" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:177 +msgid "Greek" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:181 +msgid "English" +msgstr "Inglés" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:185 +msgid "Esperanto" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:189 +msgid "Spanish" +msgstr "Español" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:193 +msgid "Estonian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:197 +msgid "Basque" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:200 +msgid "Persian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:204 +msgid "Fulah" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:208 +msgid "Finnish" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:212 +msgid "Fijian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:216 +msgid "Faroese" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:220 +msgid "French" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:224 +msgid "Frisian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:228 +msgid "Irish" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:232 +msgid "Scots" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:236 +msgid "Gallegan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:240 +msgid "Guarani" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:244 +msgid "Gujarati" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:248 +msgid "Manx" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:252 +msgid "Hausa" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:256 +msgid "Hebrew" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:260 +msgid "Hindi" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:264 +msgid "Hiri Motu" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:268 +msgid "Croatian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:272 +msgid "Haitian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:276 +msgid "Hungarian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:280 +msgid "Armenian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:284 +msgid "Herero" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:288 +msgid "Interlingua" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:292 +msgid "Indonesian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:296 +msgid "Interlingue" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:300 +msgid "Igbo" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:304 +msgid "Sichuan Yi" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:308 +msgid "Inupiak" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:312 +msgid "Ido" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:316 +msgid "Icelandic" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:320 +msgid "Italian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:324 +msgid "Inuktitut" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:328 +msgid "Japanese" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:332 +msgid "Javanese" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:336 +msgid "Georgian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:340 +msgid "Kongo" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:344 +msgid "Kikuyu" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:348 +msgid "Kuanyama" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:352 +msgid "Kazakh" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:356 +msgid "Kalaallisut" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:360 +msgid "Khmer" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:364 +msgid "Kannada" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:368 +msgid "Korean" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:372 +msgid "Kanuri" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:376 +msgid "Kashmiri" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:380 +msgid "Kurdish" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:384 +msgid "Komi" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:388 +msgid "Cornish" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:392 +msgid "Kirghiz" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:396 +msgid "Latin" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:400 +msgid "Letzeburgesch" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:404 +msgid "Ganda" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:408 +msgid "Limburgish" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:412 +msgid "Lingala" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:416 +msgid "Lao" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:420 +msgid "Lithuanian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:424 +msgid "Luba-Katanga" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:428 +msgid "Latvian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:432 +msgid "Malagasy" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:436 +msgid "Marshall" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:440 +msgid "Maori" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:444 +msgid "Macedonian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:448 +msgid "Malayalam" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:452 +msgid "Mongolian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:456 +msgid "Moldavian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:460 +msgid "Marathi" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:464 +msgid "Malay" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:468 +msgid "Maltese" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:472 +msgid "Burmese" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:480 +msgid "Norwegian Bokmaal" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:484 +msgid "Ndebele, North" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:488 +msgid "Nepali" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:492 +msgid "Ndonga" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:496 +msgid "Dutch" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:500 +msgid "Norwegian Nynorsk" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:504 +msgid "Norwegian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:508 +msgid "Ndebele, South" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:512 +msgid "Navajo" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:516 +msgid "Chichewa" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:520 +msgid "Occitan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:524 +msgid "Ojibwa" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:528 +msgid "(Afan) Oromo" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:532 +msgid "Oriya" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:536 +msgid "Ossetian; Ossetic" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:540 +msgid "Panjabi; Punjabi" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:544 +msgid "Pali" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:548 +msgid "Polish" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:552 +msgid "Pashto, Pushto" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:556 +msgid "Portuguese" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:560 +msgid "Quechua" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:564 +msgid "Rhaeto-Romance" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:568 +msgid "Rundi" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:572 +msgid "Romanian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:576 +msgid "Russian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:580 +msgid "Kinyarwanda" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:584 +msgid "Sanskrit" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:588 +msgid "Sardinian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:592 +msgid "Sindhi" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:596 +msgid "Northern Sami" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:600 +msgid "Sango; Sangro" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:604 +msgid "Sinhalese" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:608 +msgid "Slovak" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:612 +msgid "Slovenian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:616 +msgid "Samoan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:620 +msgid "Shona" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:624 +msgid "Somali" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:628 +msgid "Albanian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:632 +msgid "Serbian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:636 +msgid "Swati; Siswati" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:640 +msgid "Sesotho; Sotho, Southern" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:644 +msgid "Sundanese" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:648 +msgid "Swedish" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:652 +msgid "Swahili" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:656 +msgid "Tamil" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:660 +msgid "Telugu" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:664 +msgid "Tajik" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:668 +msgid "Thai" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:672 +msgid "Tigrinya" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:676 +msgid "Turkmen" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:680 +msgid "Tagalog" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:684 +msgid "Tswana; Setswana" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:688 +msgid "Tonga (?)" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:692 +msgid "Turkish" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:696 +msgid "Tsonga" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:701 +msgid "Tatar" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:705 +msgid "Twi" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:709 +msgid "Tahitian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:713 +msgid "Uighur" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:717 +msgid "Ukrainian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:721 +msgid "Urdu" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:725 +msgid "Uzbek" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:729 +msgid "Venda" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:733 +msgid "Vietnamese" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:737 +msgid "Volapuk; Volapuk" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:741 +msgid "Walloon" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:745 +msgid "Wolof" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:749 +msgid "Xhosa" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:753 +msgid "Yiddish (formerly ji)" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:757 +msgid "Yoruba" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:761 +msgid "Zhuang" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:765 +msgid "Chinese" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:769 +msgid "Zulu" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getOptions.sh:116 +msgid "You need to provide one action at least." +msgstr "Es necesario que suministre una acción al menos." + +#: Scripts/Bash/Functions/Locale/locale_prepareWorkingDirectory.sh:46 +msgid "The variable L10N_WORKDIR cannot be empty." +msgstr "La variable L10N_WORKDIR no puede estar vacía." + +#: Scripts/Bash/Functions/Locale/locale_updateMessages.sh:73 +msgid "The path provided doesn't support localization." +msgstr "El camino suministrado no soporta la localización." + +#: Scripts/Bash/Functions/Prepare/prepare_getEnvars.sh:41 +#: Scripts/Bash/Functions/Prepare/prepare_seeEnvironment.sh:42 +msgid "Default text editor" +msgstr "Editor de texto predeterminado" + +#: Scripts/Bash/Functions/Prepare/prepare_getEnvars.sh:42 +#: Scripts/Bash/Functions/Prepare/prepare_seeEnvironment.sh:43 +msgid "Default time zone representation" +msgstr "Representación de la zona horaria predeterminada" + +#: Scripts/Bash/Functions/Prepare/prepare_getEnvars.sh:43 +#: Scripts/Bash/Functions/Prepare/prepare_seeEnvironment.sh:44 +msgid "Default domain used to retrieve translated messages" +msgstr "Dominio predeterminado para recuperar los mensajes traducidos" + +#: Scripts/Bash/Functions/Prepare/prepare_getEnvars.sh:44 +#: Scripts/Bash/Functions/Prepare/prepare_seeEnvironment.sh:45 +msgid "Default directory used to retrive translated messages" +msgstr "Directorio predeterminado usado para recuperar los mensajes traducidos" + +#: Scripts/Bash/Functions/Prepare/prepare_getEnvars.sh:45 +#: Scripts/Bash/Functions/Prepare/prepare_seeEnvironment.sh:46 +msgid "Default locale information" +msgstr "Información de idioma predeterminada" + +#: Scripts/Bash/Functions/Prepare/prepare_seeEnvironment.sh:47 +msgid "Default path to your working copy" +msgstr "Camino predeterminado a su copia de trabajo." + +#: Scripts/Bash/Functions/Prepare/prepare_updateEnvironment.sh:35 +msgid "" +"To set environment variables you should run centos-art.sh using its " +"abosolute path." +msgstr "" +"Para fijar las variables de entorno usted debe ejecutar centos-art.sh usando " +"su camino absoluto." + +#: Scripts/Bash/Functions/Render/Docbook/docbook.sh:65 +msgid "Validation failed." +msgstr "La validación falló." + +#: Scripts/Bash/Functions/Render/Docbook/docbook_convertToPdfFromXml.sh:110 +msgid "Cannot produce the PDF file." +msgstr "No se pudo producir el fichero PDF." + +#: Scripts/Bash/Functions/Render/Docbook/docbook_convertToText.sh:67 +msgid "No way to convert from XHTML to plain-text found." +msgstr "No se encontró una forma para convertir de XHTML a texto." + +#: Scripts/Bash/Functions/Render/Docbook/docbook_expandLicenses.sh:59 +msgid "Licenses" +msgstr "Licencias" + +#: Scripts/Bash/Functions/Render/Svg/svg.sh:57 +msgid "Area" +msgstr "Área" + +#: Scripts/Bash/Functions/Render/Svg/svg.sh:59 +msgid "Background" +msgstr "Fondo" + +#: Scripts/Bash/Functions/Render/Svg/svg_checkColorAmount.sh:38 +msgid "The palette does not have the correct number of colors." +msgstr "La paleta no tiene el número correcto de colores." + +#: Scripts/Bash/Functions/Render/Svg/svg_checkColorFormats.sh:84 +#, sh-format +msgid "The \"$COLOR\" string is not a valid color code." +msgstr "La cadena \"$COLOR\" no es un código de color válido." + +#: Scripts/Bash/Functions/Render/Svg/svg_checkModelExportId.sh:36 +msgid "The export id value cannot be empty." +msgstr "El identificador de exportación no puede estar vacío." + +#: Scripts/Bash/Functions/Render/Svg/svg_checkModelExportId.sh:42 +#, sh-format +msgid "There is not export id ($EXPORTID) inside \"$TEMPLATE\"." +msgstr "El identificador de exrtación ($EXPORTID) no existe en \"$TEMPLATE\"." + +#: Scripts/Bash/Functions/Render/Svg/svg_convertPngToDm.sh:54 +msgid "There is no resolution information to process." +msgstr "No hay información de resolución a procesar." + +#: Scripts/Bash/Functions/Render/Svg/svg_convertPngToDm.sh:118 +#, sh-format +msgid "The \"$DM\" display manager is not supported yet." +msgstr "El administrador de monitor \"$DM\" no está soportado aún." + +#: Scripts/Bash/Functions/Render/Svg/svg_convertPngToGrub.sh:76 +#: Scripts/Bash/Functions/Render/Svg/svg_convertPngToSyslinux.sh:85 +#, sh-format +msgid "The \"$OPTION\" option is already used." +msgstr "La opción \"$OPTION\" ya se encuentra en uso." + +#: Scripts/Bash/Functions/Render/Svg/svg_doPostActions.sh:35 +msgid "Created in CentOS Artwork Repository" +msgstr "Creado en Repositorio Artístico de CentOS" + +#: Scripts/Bash/Functions/Render/Svg/svg_getTTFont.sh:68 +msgid "The font provided doesn't exist." +msgstr "La fuente suministrada no existe." + +#: Scripts/Bash/Functions/Render/render.sh:125 +msgid "The path provided doesn't support rendition." +msgstr "El camino suministrado no soporta la producción." + +#: Scripts/Bash/Functions/Render/render_doBaseActions.sh:61 +#, sh-format +msgid "The \"$RENDER_EXTENSION\" file extension is not supported yet." +msgstr "La extensión de ficheros \"$RENDER_EXTENSION\" no está soportado aún." + +#: Scripts/Bash/Functions/Render/render_getConfigOption.sh:42 +msgid "There is no action string to work with." +msgstr "No hay cadena de acción con la cual trabajar." + +#: Scripts/Bash/Functions/Render/render_getConfigOption.sh:48 +msgid "The field definition is not valid." +msgstr "La definición del campo no es válida." + +#: Scripts/Bash/Functions/Render/render_getOptions.sh:84 +msgid "The architecture provided is not supported." +msgstr "La arquitectura suministrada no está soportada." + +#: Scripts/Bash/Functions/Render/render_getOptions.sh:92 +msgid "The release version provided is not supported." +msgstr "La versión de la entrega suministrada no está soportada." + +#: Scripts/Bash/Functions/Tuneup/Xhtml/xhtml_doToc.sh:139 +msgid "Table of contents" +msgstr "Tabla de contenidos" + +#: Scripts/Bash/Functions/Vcs/Git/git_commitRepoChanges.sh:43 +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:47 +msgid "Checking changes in the working copy" +msgstr "Comprobando cambios en la copia de trabajo" + +#: Scripts/Bash/Functions/Vcs/Git/git_commitRepoChanges.sh:67 +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:80 +msgid "Modified" +msgstr "Modificados" + +#: Scripts/Bash/Functions/Vcs/Git/git_commitRepoChanges.sh:68 +msgid "Untracked" +msgstr "Sin rastrear" + +#: Scripts/Bash/Functions/Vcs/Git/git_commitRepoChanges.sh:69 +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:82 +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_updateRepoChanges.sh:60 +msgid "Deleted" +msgstr "Eliminado" + +#: Scripts/Bash/Functions/Vcs/Git/git_commitRepoChanges.sh:70 +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:83 +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_updateRepoChanges.sh:59 +msgid "Added" +msgstr "Adicionado" + +#: Scripts/Bash/Functions/Vcs/Git/git_commitRepoChanges.sh:71 +msgid "Staged" +msgstr "Indexado" + +#: Scripts/Bash/Functions/Vcs/Git/git_commitRepoChanges.sh:91 +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:103 +msgid "file in the working copy" +msgid_plural "files in the working copy" +msgstr[0] "fichero en la copia de trabajo" +msgstr[1] "ficheros en la copia de trabajo" + +#: Scripts/Bash/Functions/Vcs/Git/git_commitRepoChanges.sh:103 +msgid "Do you want to stage files?" +msgstr "¿Desea indexar los ficheros?" + +#: Scripts/Bash/Functions/Vcs/Git/git_commitRepoChanges.sh:107 +msgid "Do you want to see staged files differences?" +msgstr "¿Desea ver las diferencias de los ficheros indexados?" + +#: Scripts/Bash/Functions/Vcs/Git/git_commitRepoChanges.sh:111 +msgid "Do you want to commit staged files differences?" +msgstr "¿Desea registrar las diferencias indexadas?" + +#: Scripts/Bash/Functions/Vcs/Git/git_commitRepoChanges.sh:115 +msgid "Do you want to push committed files?" +msgstr "¿Desea enviar los cambios registrados?" + +#: Scripts/Bash/Functions/Vcs/Git/git_isVersioned.sh:44 +msgid " contains untracked files." +msgstr " contiene ficheros sin rastrear." + +#: Scripts/Bash/Functions/Vcs/Git/git_updateRepoChanges.sh:29 +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_updateRepoChanges.sh:46 +msgid "Bringing changes from the repository into the working copy" +msgstr "Acarreando cambios desde el repositorio hacia la copia de trabajo" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:81 +msgid "Unversioned" +msgstr "Sin versionar" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:119 +msgid "Do you want to see changes now?" +msgstr "¿Desea ver los cambios ahora?" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:123 +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:140 +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:150 +msgid "Do you want to commit changes now?" +msgstr "¿Desea enviar los cambios ahora?" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:134 +msgid "Do you want to add unversioned files now?" +msgstr "¿Desea adicionar ficheros sin versionar ahora?" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_updateRepoChanges.sh:61 +msgid "Updated" +msgstr "Actualizado" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_updateRepoChanges.sh:62 +msgid "Conflicted" +msgstr "En conflicto" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_updateRepoChanges.sh:63 +msgid "Merged" +msgstr "Mezclado" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_updateRepoChanges.sh:83 +msgid "file from the repository" +msgid_plural "files from the repository" +msgstr[0] "fichero desde el repositorio" +msgstr[1] "ficheros desde el repositorio" + +#: Scripts/Bash/Functions/Vcs/vcs.sh:59 +msgid "isn't supported as version control system." +msgstr "no está soportado como sistema de control de versión." + +#~ msgid "Updating chapter menus and nodes inside manual structure." +#~ msgstr "Actualizando menús y nodos en la estructura del manual." + +#~ msgid "Creating chapter files." +#~ msgstr "Creando los ficheros del capítulo" + +#~ msgid "Updating chapter menu and nodes inside manual structure." +#~ msgstr "Actualizando menú y nodos dentro de la estructura del manual." + +#~ msgid "Manual Title" +#~ msgstr "Título del manual" + +#~ msgid "Creating manual structure in texinfo format." +#~ msgstr "Creando la estructura del manual en formato texinfo." + +#~ msgid "Updating output files" +#~ msgstr "Actualizando los ficheros de salida" + +#~ msgid "Updating section menus, nodes and cross references" +#~ msgstr "Actualizando menús, nodos y referencias cruzadas de sectión." + +#~ msgid "No section entry found to process." +#~ msgstr "No hay entrada de sección que procesar." + +#~ msgid "The source location isn't under version control." +#~ msgstr "La ubicación de origen no está bajo control de versiones." + +#~ msgid "is not under version control." +#~ msgstr "no está bajo control de versión." + +#~ msgid "isn't under version control." +#~ msgstr "no está bajo control de versión." + +#~ msgid "Select one of the following documentation formats:" +#~ msgstr "Seleccione uno de los siguientes formatos de documentación:" + +#~ msgid "The template file doesn't exist." +#~ msgstr "El fichero plantilla no existe." diff --git a/Automation/centos-art.sh-l10n/centos-art.sh-mods-es_ES.pot b/Automation/centos-art.sh-l10n/centos-art.sh-mods-es_ES.pot new file mode 100644 index 0000000..1eb45aa --- /dev/null +++ b/Automation/centos-art.sh-l10n/centos-art.sh-mods-es_ES.pot @@ -0,0 +1,2234 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR The CentOS Project +# This file is distributed under the same license as the centos-art-0.4 package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: centos-art-0.4\n" +"Report-Msgid-Bugs-To: Documentation SIG \n" +"POT-Creation-Date: 2013-05-30 23:32-0400\n" +"PO-Revision-Date: 2013-05-30 23:32-0400\n" +"Last-Translator: Documentation SIG\n" +"Language-Team: Espaol\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: Scripts/Bash/Functions/Prepare/prepare_getEnvars.sh:41 +#: Scripts/Bash/Functions/Prepare/prepare_seeEnvironment.sh:42 +msgid "Default text editor" +msgstr "" + +#: Scripts/Bash/Functions/Prepare/prepare_getEnvars.sh:42 +#: Scripts/Bash/Functions/Prepare/prepare_seeEnvironment.sh:43 +msgid "Default time zone representation" +msgstr "" + +#: Scripts/Bash/Functions/Prepare/prepare_getEnvars.sh:43 +#: Scripts/Bash/Functions/Prepare/prepare_seeEnvironment.sh:44 +msgid "Default domain used to retrieve translated messages" +msgstr "" + +#: Scripts/Bash/Functions/Prepare/prepare_getEnvars.sh:44 +#: Scripts/Bash/Functions/Prepare/prepare_seeEnvironment.sh:45 +msgid "Default directory used to retrive translated messages" +msgstr "" + +#: Scripts/Bash/Functions/Prepare/prepare_getEnvars.sh:45 +#: Scripts/Bash/Functions/Prepare/prepare_seeEnvironment.sh:46 +msgid "Default locale information" +msgstr "" + +#: Scripts/Bash/Functions/Prepare/prepare_seeEnvironment.sh:47 +msgid "Default path to your working copy" +msgstr "" + +#: Scripts/Bash/Functions/Prepare/prepare_updateEnvironment.sh:35 +msgid "" +"To set environment variables you should run centos-art.sh using its " +"abosolute path." +msgstr "" + +#: Scripts/Bash/Functions/Render/Docbook/docbook.sh:65 +msgid "Validation failed." +msgstr "" + +#: Scripts/Bash/Functions/Render/Docbook/docbook_convertToPdfFromXml.sh:110 +msgid "Cannot produce the PDF file." +msgstr "" + +#: Scripts/Bash/Functions/Render/Docbook/docbook_convertToText.sh:67 +msgid "No way to convert from XHTML to plain-text found." +msgstr "" + +#: Scripts/Bash/Functions/Render/Docbook/docbook_expandLicenses.sh:59 +msgid "Licenses" +msgstr "" + +#: Scripts/Bash/Functions/Render/Svg/svg.sh:57 +msgid "Area" +msgstr "" + +#: Scripts/Bash/Functions/Render/Svg/svg.sh:59 +msgid "Background" +msgstr "" + +#: Scripts/Bash/Functions/Render/Svg/svg.sh:61 +msgid "Saved as" +msgstr "" + +#: Scripts/Bash/Functions/Render/Svg/svg_checkColorAmount.sh:38 +msgid "The palette does not have the correct number of colors." +msgstr "" + +#: Scripts/Bash/Functions/Render/Svg/svg_checkColorFormats.sh:84 +#, sh-format +msgid "The \"$COLOR\" string is not a valid color code." +msgstr "" + +#: Scripts/Bash/Functions/Render/Svg/svg_checkModelExportId.sh:36 +msgid "The export id value cannot be empty." +msgstr "" + +#: Scripts/Bash/Functions/Render/Svg/svg_checkModelExportId.sh:42 +#, sh-format +msgid "There is not export id ($EXPORTID) inside \"$TEMPLATE\"." +msgstr "" + +#: Scripts/Bash/Functions/Render/Svg/svg_convertPngToDm.sh:54 +msgid "There is no resolution information to process." +msgstr "" + +#: Scripts/Bash/Functions/Render/Svg/svg_convertPngToDm.sh:118 +#, sh-format +msgid "The \"$DM\" display manager is not supported yet." +msgstr "" + +#: Scripts/Bash/Functions/Render/Svg/svg_convertPngToGrub.sh:76 +#: Scripts/Bash/Functions/Render/Svg/svg_convertPngToSyslinux.sh:85 +#, sh-format +msgid "The \"$OPTION\" option is already used." +msgstr "" + +#: Scripts/Bash/Functions/Render/Svg/svg_doPostActions.sh:35 +msgid "Created in CentOS Artwork Repository" +msgstr "" + +#: Scripts/Bash/Functions/Render/Svg/svg_getTTFont.sh:68 +msgid "The font provided doesn't exist." +msgstr "" + +#: Scripts/Bash/Functions/Render/render.sh:125 +msgid "The path provided doesn't support rendition." +msgstr "" + +#: Scripts/Bash/Functions/Render/render_doBaseActions.sh:61 +#, sh-format +msgid "The \"$RENDER_EXTENSION\" file extension is not supported yet." +msgstr "" + +#: Scripts/Bash/Functions/Render/render_getConfigOption.sh:42 +msgid "There is no action string to work with." +msgstr "" + +#: Scripts/Bash/Functions/Render/render_getConfigOption.sh:48 +msgid "The field definition is not valid." +msgstr "" + +#: Scripts/Bash/Functions/Render/render_getOptions.sh:84 +msgid "The architecture provided is not supported." +msgstr "" + +#: Scripts/Bash/Functions/Render/render_getOptions.sh:92 +msgid "The release version provided is not supported." +msgstr "" + +#: Scripts/Bash/Functions/Tuneup/Xhtml/xhtml_doToc.sh:139 +msgid "Table of contents" +msgstr "" + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo.sh:35 +#: Scripts/Bash/Functions/Help/help_getEntries.sh:116 +msgid "The documentation entry provided isn't supported." +msgstr "" + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo.sh:91 +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_copyEntry.sh:70 +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_deleteEntry.sh:63 +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_renameEntry.sh:70 +msgid "The parameters you provided are not supported." +msgstr "" + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_checkEntrySrcDst.sh:37 +msgid "The source location doesn't exist." +msgstr "" + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_checkEntrySrcDst.sh:43 +msgid "The source and target locations cannot be the same." +msgstr "" + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_checkEntrySrcDst.sh:50 +msgid "The source location has pending changes." +msgstr "" + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_checkEntrySrcDst.sh:63 +msgid "The target location already exists." +msgstr "" + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_copyEntrySection.sh:51 +msgid "The location provided as target isn't valid." +msgstr "" + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_createChapter.sh:36 +msgid "The following documentation chapter doesn't exist:" +msgstr "" + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_createChapter.sh:38 +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_createStructure.sh:38 +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_editEntry.sh:42 +msgid "Do you want to create it now?" +msgstr "" + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_createChapter.sh:47 +msgid "Enter chapter's title" +msgstr "" + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_createStructure.sh:36 +#, sh-format +msgid "The following documentation manual doesn't exist:" +msgstr "" + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_createStructure.sh:47 +msgid "Enter manual's title" +msgstr "" + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_createStructure.sh:49 +msgid "Enter manual's subtitle" +msgstr "" + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_createStructure.sh:51 +msgid "Enter manual's abstract" +msgstr "" + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_createStructure.sh:57 +msgid "The manual title cannot be empty." +msgstr "" + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_deleteCrossReferences.sh:41 +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_getEntryNode.sh:33 +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_restoreCrossReferences.sh:45 +msgid "The first positional parameter cannot be empty." +msgstr "" + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_deleteCrossReferences.sh:50 +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_deleteCrossReferences.sh:62 +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_renameCrossReferences.sh:38 +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_renameCrossReferences.sh:43 +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_restoreCrossReferences.sh:53 +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_restoreCrossReferences.sh:54 +msgid "Removed" +msgstr "" + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_deleteEntryChapter.sh:41 +msgid "The chapter specified cannot be removed." +msgstr "" + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_editEntry.sh:40 +msgid "The following documentation section doesn't exist:" +msgstr "" + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_updateLicenseLink.sh:52 +msgid "has an old directory structure." +msgstr "" + +#: Scripts/Bash/Functions/Help/Texinfo/texinfo_updateStructureSection.sh:114 +msgid "There wasn't any section for processing found." +msgstr "" + +#: Scripts/Bash/Functions/Help/help_getOptions.sh:79 +msgid "The documentation format provided is not supported." +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_combineLicenseMessages.sh:29 +msgid "One argument is required." +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_editMessages.sh:32 +#: Scripts/Bash/Functions/Locale/locale_updateMessages.sh:36 +msgid "The English language cannot be localized to itself." +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_editMessages.sh:39 +#: Scripts/Bash/Functions/Locale/locale_editMessages.sh:69 +#: Scripts/Bash/Functions/Locale/locale_updateMessages.sh:43 +msgid "The path provided does not support localization." +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_editMessages.sh:74 +msgid "The path provided hasn't translations yet." +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:28 +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:28 +msgid "Unknown" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:33 +msgid "Andorra" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:36 +msgid "United Arab Emirates" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:39 +msgid "Afghanistan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:42 +msgid "Antigua and Barbuda" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:45 +msgid "Anguilla" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:48 +msgid "Albania" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:51 +msgid "Armenia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:54 +msgid "Netherlands Antilles" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:57 +msgid "Angola" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:60 +msgid "Antarctica" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:63 +msgid "Argentina" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:66 +msgid "Samoa (American)" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:69 +msgid "Austria" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:72 +msgid "Australia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:75 +msgid "Aruba" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:78 +msgid "Azerbaijan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:81 +msgid "Bosnia and Herzegovina" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:84 +msgid "Barbados" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:87 +msgid "Bangladesh" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:90 +msgid "Belgium" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:93 +msgid "Burkina Faso" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:96 +msgid "Bulgaria" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:99 +msgid "Bahrain" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:102 +msgid "Burundi" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:105 +msgid "Benin" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:108 +msgid "Bermuda" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:111 +msgid "Brunei" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:114 +msgid "Bolivia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:117 +msgid "Brazil" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:120 +msgid "Bahamas" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:123 +msgid "Bhutan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:126 +msgid "Bouvet Island" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:129 +msgid "Botswana" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:132 +msgid "Belarus" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:135 +msgid "Belize" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:138 +msgid "Canada" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:141 +msgid "Cocos (Keeling) Islands" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:144 +msgid "Congo (Dem. Rep.)" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:147 +msgid "Central African Rep." +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:150 +msgid "Congo (Rep.)" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:153 +msgid "Switzerland" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:156 +msgid "Co^te d'Ivoire" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:159 +msgid "Cook Islands" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:162 +msgid "Chile" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:165 +msgid "Cameroon" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:168 +msgid "China" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:171 +msgid "Colombia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:174 +msgid "Costa Rica" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:177 +msgid "Serbia and Montenegro" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:180 +msgid "Cuba" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:183 +msgid "Cape Verde" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:186 +msgid "Christmas Island" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:189 +msgid "Cyprus" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:192 +msgid "Czech Republic" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:195 +msgid "Germany" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:198 +msgid "Djibouti" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:201 +msgid "Denmark" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:204 +msgid "Dominica" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:207 +msgid "Dominican Republic" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:210 +msgid "Algeria" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:213 +msgid "Ecuador" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:216 +msgid "Estonia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:219 +msgid "Egypt" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:222 +msgid "Western Sahara" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:225 +msgid "Eritrea" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:228 +msgid "Spain" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:231 +msgid "Ethiopia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:234 +msgid "Finland" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:237 +msgid "Fiji" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:240 +msgid "Falkland Islands" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:243 +msgid "Micronesia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:246 +msgid "Faeroe Islands" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:249 +msgid "France" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:252 +msgid "Gabon" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:255 +msgid "Britain (UK)" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:258 +msgid "Grenada" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:261 +msgid "Georgia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:264 +msgid "French Guiana" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:267 +msgid "Ghana" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:270 +msgid "Gibraltar" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:273 +msgid "Greenland" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:276 +msgid "Gambia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:279 +msgid "Guinea" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:282 +msgid "Guadeloupe" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:285 +msgid "Equatorial Guinea" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:288 +msgid "Greece" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:291 +msgid "South Georgia and the South Sandwich Islands" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:294 +msgid "Guatemala" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:297 +msgid "Guam" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:300 +msgid "Guinea-Bissau" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:303 +msgid "Guyana" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:306 +msgid "Hong Kong" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:309 +msgid "Heard Island and McDonald Islands" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:312 +msgid "Honduras" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:315 +msgid "Croatia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:318 +msgid "Haiti" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:321 +msgid "Hungary" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:324 +msgid "Indonesia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:327 +msgid "Ireland" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:330 +msgid "Israel" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:333 +msgid "India" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:336 +msgid "British Indian Ocean Territory" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:339 +msgid "Iraq" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:342 +msgid "Iran" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:345 +msgid "Iceland" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:348 +msgid "Italy" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:351 +msgid "Jamaica" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:354 +msgid "Jordan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:357 +msgid "Japan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:360 +msgid "Kenya" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:363 +msgid "Kyrgyzstan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:366 +msgid "Cambodia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:369 +msgid "Kiribati" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:372 +msgid "Comoros" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:375 +msgid "St Kitts and Nevis" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:378 +msgid "Korea (North)" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:381 +msgid "Korea (South)" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:384 +msgid "Kuwait" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:387 +msgid "Cayman Islands" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:390 +msgid "Kazakhstan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:393 +msgid "Laos" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:396 +msgid "Lebanon" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:399 +msgid "St Lucia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:402 +msgid "Liechtenstein" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:405 +msgid "Sri Lanka" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:408 +msgid "Liberia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:411 +msgid "Lesotho" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:414 +msgid "Lithuania" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:417 +msgid "Luxembourg" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:420 +msgid "Latvia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:423 +msgid "Libya" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:426 +msgid "Morocco" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:429 +msgid "Monaco" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:432 +msgid "Moldova" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:435 +msgid "Madagascar" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:438 +msgid "Marshall Islands" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:441 +msgid "Macedonia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:444 +msgid "Mali" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:447 +msgid "Myanmar (Burma)" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:450 +msgid "Mongolia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:453 +msgid "Macao" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:456 +msgid "Northern Mariana Islands" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:459 +msgid "Martinique" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:462 +msgid "Mauritania" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:465 +msgid "Montserrat" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:468 +msgid "Malta" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:471 +msgid "Mauritius" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:474 +msgid "Maldives" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:477 +msgid "Malawi" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:480 +msgid "Mexico" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:483 +msgid "Malaysia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:486 +msgid "Mozambique" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:489 +msgid "Namibia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:492 +msgid "New Caledonia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:495 +msgid "Niger" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:498 +msgid "Norfolk Island" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:501 +msgid "Nigeria" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:504 +msgid "Nicaragua" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:507 +msgid "Netherlands" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:510 +msgid "Norway" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:513 +msgid "Nepal" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:516 +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:476 +msgid "Nauru" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:519 +msgid "Niue" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:522 +msgid "New Zealand" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:525 +msgid "Oman" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:528 +msgid "Panama" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:531 +msgid "Peru" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:534 +msgid "French Polynesia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:537 +msgid "Papua New Guinea" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:540 +msgid "Philippines" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:543 +msgid "Pakistan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:546 +msgid "Poland" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:549 +msgid "St Pierre and Miquelon" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:552 +msgid "Pitcairn" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:555 +msgid "Puerto Rico" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:558 +msgid "Palestine" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:561 +msgid "Portugal" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:564 +msgid "Palau" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:567 +msgid "Paraguay" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:570 +msgid "Qatar" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:573 +msgid "Reunion" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:576 +msgid "Romania" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:579 +msgid "Russia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:582 +msgid "Rwanda" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:585 +msgid "Saudi Arabia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:588 +msgid "Solomon Islands" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:591 +msgid "Seychelles" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:594 +msgid "Sudan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:597 +msgid "Sweden" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:600 +msgid "Singapore" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:603 +msgid "St Helena" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:606 +msgid "Slovenia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:609 +msgid "Svalbard and Jan Mayen" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:612 +msgid "Slovakia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:615 +msgid "Sierra Leone" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:618 +msgid "San Marino" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:621 +msgid "Senegal" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:624 +msgid "Somalia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:627 +msgid "Suriname" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:630 +msgid "Sao Tome and Principe" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:633 +msgid "El Salvador" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:636 +msgid "Syria" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:639 +msgid "Swaziland" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:642 +msgid "Turks and Caicos Islands" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:645 +msgid "Chad" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:648 +msgid "French Southern and Antarctic Lands" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:651 +msgid "Togo" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:654 +msgid "Thailand" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:657 +msgid "Tajikistan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:660 +msgid "Tokelau" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:663 +msgid "Timor-Leste" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:666 +msgid "Turkmenistan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:669 +msgid "Tunisia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:672 +msgid "Tonga" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:675 +msgid "Turkey" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:678 +msgid "Trinidad and Tobago" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:681 +msgid "Tuvalu" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:684 +msgid "Taiwan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:687 +msgid "Tanzania" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:690 +msgid "Ukraine" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:693 +msgid "Uganda" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:696 +msgid "US minor outlying islands" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:699 +msgid "United States" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:702 +msgid "Uruguay" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:705 +msgid "Uzbekistan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:708 +msgid "Vatican City" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:711 +msgid "St Vincent" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:714 +msgid "Venezuela" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:717 +msgid "Virgin Islands (UK)" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:720 +msgid "Virgin Islands (US)" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:723 +msgid "Vietnam" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:726 +msgid "Vanuatu" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:729 +msgid "Wallis and Futuna" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:732 +msgid "Samoa (Western)" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:735 +msgid "Yemen" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:738 +msgid "Mayotte" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:741 +msgid "South Africa" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:744 +msgid "Zambia" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getCountryName.sh:747 +msgid "Zimbabwe" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:33 +msgid "Afar" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:37 +msgid "Abkhazian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:41 +msgid "Avestan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:45 +msgid "Afrikaans" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:49 +msgid "Akan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:53 +msgid "Amharic" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:57 +msgid "Aragonese" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:61 +msgid "Arabic" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:65 +msgid "Assamese" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:69 +msgid "Avaric" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:73 +msgid "Aymara" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:77 +msgid "Azerbaijani" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:81 +msgid "Bashkir" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:85 +msgid "Byelorussian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:89 +msgid "Bulgarian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:93 +msgid "Bihari" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:97 +msgid "Bislama" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:101 +msgid "Bambara" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:105 +msgid "Bengali" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:109 +msgid "Tibetan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:113 +msgid "Breton" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:117 +msgid "Bosnian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:121 +msgid "Catalan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:125 +msgid "Chechen" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:129 +msgid "Chamorro" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:133 +msgid "Corsican" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:137 +msgid "Cree" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:141 +msgid "Czech" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:145 +msgid "Church Slavic" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:149 +msgid "Chuvash" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:153 +msgid "Welsh" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:157 +msgid "Danish" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:161 +msgid "German" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:165 +msgid "Divehi" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:169 +msgid "Dzongkha" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:173 +msgid "E'we" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:177 +msgid "Greek" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:181 +msgid "English" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:185 +msgid "Esperanto" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:189 +msgid "Spanish" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:193 +msgid "Estonian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:197 +msgid "Basque" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:200 +msgid "Persian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:204 +msgid "Fulah" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:208 +msgid "Finnish" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:212 +msgid "Fijian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:216 +msgid "Faroese" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:220 +msgid "French" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:224 +msgid "Frisian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:228 +msgid "Irish" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:232 +msgid "Scots" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:236 +msgid "Gallegan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:240 +msgid "Guarani" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:244 +msgid "Gujarati" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:248 +msgid "Manx" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:252 +msgid "Hausa" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:256 +msgid "Hebrew" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:260 +msgid "Hindi" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:264 +msgid "Hiri Motu" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:268 +msgid "Croatian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:272 +msgid "Haitian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:276 +msgid "Hungarian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:280 +msgid "Armenian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:284 +msgid "Herero" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:288 +msgid "Interlingua" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:292 +msgid "Indonesian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:296 +msgid "Interlingue" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:300 +msgid "Igbo" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:304 +msgid "Sichuan Yi" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:308 +msgid "Inupiak" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:312 +msgid "Ido" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:316 +msgid "Icelandic" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:320 +msgid "Italian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:324 +msgid "Inuktitut" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:328 +msgid "Japanese" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:332 +msgid "Javanese" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:336 +msgid "Georgian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:340 +msgid "Kongo" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:344 +msgid "Kikuyu" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:348 +msgid "Kuanyama" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:352 +msgid "Kazakh" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:356 +msgid "Kalaallisut" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:360 +msgid "Khmer" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:364 +msgid "Kannada" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:368 +msgid "Korean" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:372 +msgid "Kanuri" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:376 +msgid "Kashmiri" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:380 +msgid "Kurdish" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:384 +msgid "Komi" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:388 +msgid "Cornish" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:392 +msgid "Kirghiz" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:396 +msgid "Latin" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:400 +msgid "Letzeburgesch" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:404 +msgid "Ganda" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:408 +msgid "Limburgish" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:412 +msgid "Lingala" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:416 +msgid "Lao" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:420 +msgid "Lithuanian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:424 +msgid "Luba-Katanga" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:428 +msgid "Latvian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:432 +msgid "Malagasy" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:436 +msgid "Marshall" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:440 +msgid "Maori" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:444 +msgid "Macedonian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:448 +msgid "Malayalam" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:452 +msgid "Mongolian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:456 +msgid "Moldavian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:460 +msgid "Marathi" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:464 +msgid "Malay" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:468 +msgid "Maltese" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:472 +msgid "Burmese" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:480 +msgid "Norwegian Bokmaal" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:484 +msgid "Ndebele, North" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:488 +msgid "Nepali" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:492 +msgid "Ndonga" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:496 +msgid "Dutch" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:500 +msgid "Norwegian Nynorsk" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:504 +msgid "Norwegian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:508 +msgid "Ndebele, South" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:512 +msgid "Navajo" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:516 +msgid "Chichewa" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:520 +msgid "Occitan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:524 +msgid "Ojibwa" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:528 +msgid "(Afan) Oromo" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:532 +msgid "Oriya" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:536 +msgid "Ossetian; Ossetic" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:540 +msgid "Panjabi; Punjabi" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:544 +msgid "Pali" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:548 +msgid "Polish" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:552 +msgid "Pashto, Pushto" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:556 +msgid "Portuguese" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:560 +msgid "Quechua" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:564 +msgid "Rhaeto-Romance" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:568 +msgid "Rundi" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:572 +msgid "Romanian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:576 +msgid "Russian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:580 +msgid "Kinyarwanda" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:584 +msgid "Sanskrit" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:588 +msgid "Sardinian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:592 +msgid "Sindhi" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:596 +msgid "Northern Sami" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:600 +msgid "Sango; Sangro" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:604 +msgid "Sinhalese" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:608 +msgid "Slovak" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:612 +msgid "Slovenian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:616 +msgid "Samoan" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:620 +msgid "Shona" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:624 +msgid "Somali" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:628 +msgid "Albanian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:632 +msgid "Serbian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:636 +msgid "Swati; Siswati" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:640 +msgid "Sesotho; Sotho, Southern" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:644 +msgid "Sundanese" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:648 +msgid "Swedish" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:652 +msgid "Swahili" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:656 +msgid "Tamil" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:660 +msgid "Telugu" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:664 +msgid "Tajik" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:668 +msgid "Thai" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:672 +msgid "Tigrinya" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:676 +msgid "Turkmen" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:680 +msgid "Tagalog" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:684 +msgid "Tswana; Setswana" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:688 +msgid "Tonga (?)" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:692 +msgid "Turkish" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:696 +msgid "Tsonga" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:701 +msgid "Tatar" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:705 +msgid "Twi" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:709 +msgid "Tahitian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:713 +msgid "Uighur" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:717 +msgid "Ukrainian" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:721 +msgid "Urdu" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:725 +msgid "Uzbek" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:729 +msgid "Venda" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:733 +msgid "Vietnamese" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:737 +msgid "Volapuk; Volapuk" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:741 +msgid "Walloon" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:745 +msgid "Wolof" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:749 +msgid "Xhosa" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:753 +msgid "Yiddish (formerly ji)" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:757 +msgid "Yoruba" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:761 +msgid "Zhuang" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:765 +msgid "Chinese" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getLanguageName.sh:769 +msgid "Zulu" +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_getOptions.sh:116 +msgid "You need to provide one action at least." +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_prepareWorkingDirectory.sh:46 +msgid "The variable L10N_WORKDIR cannot be empty." +msgstr "" + +#: Scripts/Bash/Functions/Locale/locale_updateMessages.sh:73 +msgid "The path provided doesn't support localization." +msgstr "" + +#: Scripts/Bash/Functions/Vcs/Git/git_commitRepoChanges.sh:43 +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:47 +msgid "Checking changes in the working copy" +msgstr "" + +#: Scripts/Bash/Functions/Vcs/Git/git_commitRepoChanges.sh:67 +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:80 +msgid "Modified" +msgstr "" + +#: Scripts/Bash/Functions/Vcs/Git/git_commitRepoChanges.sh:68 +msgid "Untracked" +msgstr "" + +#: Scripts/Bash/Functions/Vcs/Git/git_commitRepoChanges.sh:69 +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:82 +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_updateRepoChanges.sh:60 +msgid "Deleted" +msgstr "" + +#: Scripts/Bash/Functions/Vcs/Git/git_commitRepoChanges.sh:70 +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:83 +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_updateRepoChanges.sh:59 +msgid "Added" +msgstr "" + +#: Scripts/Bash/Functions/Vcs/Git/git_commitRepoChanges.sh:71 +msgid "Staged" +msgstr "" + +#: Scripts/Bash/Functions/Vcs/Git/git_commitRepoChanges.sh:91 +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:103 +msgid "file in the working copy" +msgid_plural "files in the working copy" +msgstr[0] "" +msgstr[1] "" + +#: Scripts/Bash/Functions/Vcs/Git/git_commitRepoChanges.sh:103 +msgid "Do you want to stage files?" +msgstr "" + +#: Scripts/Bash/Functions/Vcs/Git/git_commitRepoChanges.sh:107 +msgid "Do you want to see staged files differences?" +msgstr "" + +#: Scripts/Bash/Functions/Vcs/Git/git_commitRepoChanges.sh:111 +msgid "Do you want to commit staged files differences?" +msgstr "" + +#: Scripts/Bash/Functions/Vcs/Git/git_commitRepoChanges.sh:115 +msgid "Do you want to push committed files?" +msgstr "" + +#: Scripts/Bash/Functions/Vcs/Git/git_isVersioned.sh:44 +msgid " contains untracked files." +msgstr "" + +#: Scripts/Bash/Functions/Vcs/Git/git_updateRepoChanges.sh:29 +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_updateRepoChanges.sh:46 +msgid "Bringing changes from the repository into the working copy" +msgstr "" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:81 +msgid "Unversioned" +msgstr "" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:119 +msgid "Do you want to see changes now?" +msgstr "" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:123 +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:140 +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:150 +msgid "Do you want to commit changes now?" +msgstr "" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:134 +msgid "Do you want to add unversioned files now?" +msgstr "" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_isVersioned.sh:41 +msgid "isn't under version control." +msgstr "" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_updateRepoChanges.sh:61 +msgid "Updated" +msgstr "" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_updateRepoChanges.sh:62 +msgid "Conflicted" +msgstr "" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_updateRepoChanges.sh:63 +msgid "Merged" +msgstr "" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_updateRepoChanges.sh:83 +msgid "file from the repository" +msgid_plural "files from the repository" +msgstr[0] "" +msgstr[1] "" + +#: Scripts/Bash/Functions/Vcs/vcs.sh:59 +msgid "isn't supported as version control system." +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli.sh:73 +#, sh-format +msgid "The $FILE needs to have execution rights." +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:69 +msgid "isn't a directory." +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:76 +msgid "doesn't exist." +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:83 +msgid "isn't a regular file." +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:90 +msgid "isn't a symbolic link." +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:97 +msgid "isn't an executable file." +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:105 +#, sh-format +msgid "isn't a \"$MIME\" file." +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:112 +#, sh-format +msgid "doesn't match its pattern." +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:126 +msgid "isn't installed in the system." +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:176 +msgid "The condition command provided isn't supported." +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_exportFunctions.sh:35 +msgid "The export id doesn't match its pattern." +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_exportFunctions.sh:70 +msgid "No function file was found." +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_getConfigLines.sh:42 +msgid "The configuration section provided is incorrect." +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_getTemporalFile.sh:38 +msgid "The first argument cannot be empty." +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_printCopyrightInfo.sh:44 +msgid "Creative Common Attribution-ShareAlike 3.0 License" +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_printCopyrightInfo.sh:104 +msgid "All rights reserved." +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:33 +msgid "The message cannot be empty." +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:90 +msgid "To know more, run" +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:97 +msgid "yes" +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:100 +msgid "no" +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:187 +msgid "Cropping from" +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:191 +msgid "Tuning-up" +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:195 +msgid "Checking" +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:199 +msgid "Combining" +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:204 +msgid "Updating" +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:206 +msgid "Creating" +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:211 +msgid "Deleting" +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:215 +msgid "Reading" +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:223 +msgid "Linked to" +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:227 +msgid "Moved to" +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:231 +msgid "Translation" +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:235 +msgid "Validating" +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:239 +msgid "Template" +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:243 +msgid "Configuration" +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_printMessage.sh:247 +msgid "Palette" +msgstr "" + +#: Scripts/Bash/Functions/Commons/cli_unsetFunctions.sh:37 +msgid "The export id was not provided." +msgstr "" diff --git a/Automation/centos-art.sh-mods/Commons/cli.sh b/Automation/centos-art.sh-mods/Commons/cli.sh new file mode 100755 index 0000000..9d9a17d --- /dev/null +++ b/Automation/centos-art.sh-mods/Commons/cli.sh @@ -0,0 +1,136 @@ +#!/bin/bash +# +# cli.sh -- This function initiates the centos-art.sh script +# command-line interface. Variables defined in this function are +# accesible by all other functions. The cli function is the first +# script executed by centos-art.sh, onces executed in a terminal. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function cli { + + # Initialize global variables. + local CLI_FUNCNAME='' + local CLI_FUNCDIRNAM='' + local CLI_FUNCSCRIPT='' + local ARGUMENTS='' + + # Initialize default value to filter flag. The filter flag + # (--filter) is used mainly to reduce the number of files to + # process. The value of this variable is interpreted as + # egrep-posix regular expression. By default, when the --filter + # option is not provided, all paths in the working copy must match + # except files under hidden directories like `.svn'. We do this in + # conjunction with `cli_getFilesList', when building the list of + # files that will be processed. + local FLAG_FILTER='[[:alnum:]_/-]+' + + # Initialize default value to verbosity flag. The verbosity flag + # (-v | --verbose) controls whether centos-art.sh script prints + # messages or not. By default, all messages are suppressed except + # those directed to standard error. + local FLAG_QUIET='false' + + # Initialize default value to answer flag. The answer flag + # (--answer-yes) controls whether centos-art.sh script does or + # does not pass confirmation request points. By default, it + # doesn't. + local FLAG_ANSWER='false' + + # Initialize default value to commit changes flag. This flag + # (--synchronize) controls whether version control system is + # triggered or not after realizing changes to source files under + # version control. + local FLAG_SYNCHRONIZE='false' + + # Initialize list of common functionalities to load. + local FILES=$(ls ${CLI_FUNCDIR}/Commons/*.sh) + + # Initialize common functionalities. + for FILE in ${FILES};do + if [[ -x ${FILE} ]];then + . ${FILE} + export -f $(grep '^function ' ${FILE} | cut -d' ' -f2) + else + echo "`eval_gettext "The \\\$FILE needs to have execution rights."`" + exit + fi + done + + # Trap signals in order to terminate the script execution + # correctly (e.g., removing all temporal files before leaving). + # Trapping the exit signal seems to be enough by now, since it is + # always present as part of the script execution flow. Each time + # the centos-art.sh script is executed it will inevitably end with + # an EXIT signal at some point of its execution, even if it is + # interrupted in the middle of its execution (e.g., through + # `Ctrl+C'). + trap cli_terminateScriptExecution 0 + + # Redefine ARGUMENTS variable using current positional parameters. + cli_parseArgumentsReDef "$@" + + # Check function name. The function name is critical for + # centos-art.sh script to do something coherent. If it is not + # provided, execute the help functionality and end script + # execution. + if [[ ! "$1" ]] || [[ ! "$1" =~ '^[[:alpha:]]' ]];then + cli_runFnEnvironment help --read --format="texinfo" tcar-fs::: + exit + fi + + # Define function name (CLI_FUNCNAME) using the first argument in + # the command-line. + CLI_FUNCNAME=$(cli_getRepoName $1 -f | cut -d '-' -f1) + + # Define function directory. + CLI_FUNCDIRNAM=$(cli_getRepoName $CLI_FUNCNAME -d) + + # Define function file name. + CLI_FUNCSCRIPT=${CLI_FUNCDIR}/${CLI_FUNCDIRNAM}/${CLI_FUNCNAME}.sh + + # Check function script execution rights. + cli_checkFiles -x "${CLI_FUNCSCRIPT}" + + # Remove the first argument passed to centos-art.sh command-line + # in order to build optional arguments inside functionalities. We + # start counting from second argument (inclusive) on. + shift 1 + + # Redefine ARGUMENTS using current positional parameters. + cli_parseArgumentsReDef "$@" + + # Define default text editors used by centos-art.sh script. + if [[ ! "$EDITOR" =~ '/usr/bin/(vim|emacs|nano)' ]];then + EDITOR='/usr/bin/vim' + fi + + # Check text editor execution rights. + cli_checkFiles -x ${EDITOR} + + # Go for function initialization. Keep the cli_exportFunctions + # function calling after all variables and arguments definitions. + cli_exportFunctions "${CLI_FUNCDIRNAM}/${CLI_FUNCNAME}" + + # Execute function. + $CLI_FUNCNAME + +} diff --git a/Automation/centos-art.sh-mods/Commons/cli_checkFiles.sh b/Automation/centos-art.sh-mods/Commons/cli_checkFiles.sh new file mode 100755 index 0000000..3c65ed4 --- /dev/null +++ b/Automation/centos-art.sh-mods/Commons/cli_checkFiles.sh @@ -0,0 +1,187 @@ +#!/bin/bash +# +# cli_checkFiles.sh -- This function standardizes the way file +# conditional expressions are applied inside centos-art.sh script. +# Here is where we answer questions like: is the file a regular file +# or a directory? Or, is it a symbolic link? Or even, does it have +# execution rights, etc. If the verification fails somehow at any +# point, an error message is output and centos-art.sh script finishes +# its execution. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function cli_checkFiles { + + # Define short options. + local ARGSS='i:,r,m:,n,d,e,f,h,x' + + # Define long options. + local ARGSL='mime:,is-versioned,match:,is-installed' + + # Initialize array variables. + local -a CONDITION_COMMAND + local -a CONDITION_PATTERN + local -a CONDITION_MESSAGE + + # Initialize array variable counter. + local COUNTER=0 + + # Initialize arguments with an empty value and set it as local + # variable to this function scope. Doing this is very important to + # avoid any clash with higher execution environments. + local ARGUMENTS='' + + # Prepare ARGUMENTS for getopt. + cli_parseArgumentsReDef "$@" + + # Redefine ARGUMENTS using getopt(1) command parser. + cli_parseArguments + + # Redefine positional parameters using ARGUMENTS variable. + eval set -- "$ARGUMENTS" + + # Look for options passed through positional parameters. + while true; do + + case "$1" in + + -d ) + CONDITION_COMMAND[((++${#CONDITION_COMMAND[*]}))]='test' + CONDITION_PATTERN[((++${#CONDITION_PATTERN[*]}))]='-d' + CONDITION_MESSAGE[((++${#CONDITION_MESSAGE[*]}))]="`gettext "isn't a directory."`" + shift 1 + ;; + + -e ) + CONDITION_COMMAND[((++${#CONDITION_COMMAND[*]}))]='test' + CONDITION_PATTERN[((++${#CONDITION_PATTERN[*]}))]='-e' + CONDITION_MESSAGE[((++${#CONDITION_MESSAGE[*]}))]="`gettext "doesn't exist."`" + shift 1 + ;; + + -f ) + CONDITION_COMMAND[((++${#CONDITION_COMMAND[*]}))]='test' + CONDITION_PATTERN[((++${#CONDITION_PATTERN[*]}))]='-f' + CONDITION_MESSAGE[((++${#CONDITION_MESSAGE[*]}))]="`gettext "isn't a regular file."`" + shift 1 + ;; + + -h ) + CONDITION_COMMAND[((++${#CONDITION_COMMAND[*]}))]='test' + CONDITION_PATTERN[((++${#CONDITION_PATTERN[*]}))]='-h' + CONDITION_MESSAGE[((++${#CONDITION_MESSAGE[*]}))]="`gettext "isn't a symbolic link."`" + shift 1 + ;; + + -x ) + CONDITION_COMMAND[((++${#CONDITION_COMMAND[*]}))]='test' + CONDITION_PATTERN[((++${#CONDITION_PATTERN[*]}))]='-x' + CONDITION_MESSAGE[((++${#CONDITION_MESSAGE[*]}))]="`gettext "isn't an executable file."`" + shift 1 + ;; + + -i | --mime ) + local MIME=$2 + CONDITION_COMMAND[((++${#CONDITION_COMMAND[*]}))]='file' + CONDITION_PATTERN[((++${#CONDITION_PATTERN[*]}))]='-bi' + CONDITION_MESSAGE[((++${#CONDITION_MESSAGE[*]}))]="`eval_gettext "isn't a \\\"\\\$MIME\\\" file."`" + shift 2 + ;; + + -m | --match ) + CONDITION_COMMAND[((++${#CONDITION_COMMAND[*]}))]='match' + CONDITION_PATTERN[((++${#CONDITION_PATTERN[*]}))]="$2" + CONDITION_MESSAGE[((++${#CONDITION_MESSAGE[*]}))]="`eval_gettext "doesn't match its pattern."`" + shift 2 + ;; + + -r | --is-versioned ) + CONDITION_COMMAND[((++${#CONDITION_COMMAND[*]}))]="centos-art" + CONDITION_PATTERN[((++${#CONDITION_PATTERN[*]}))]="vcs --is-versioned" + CONDITION_MESSAGE[((++${#CONDITION_MESSAGE[*]}))]="" + shift 1 + ;; + + -n | --is-installed ) + CONDITION_COMMAND[((++${#CONDITION_COMMAND[*]}))]="rpm" + CONDITION_PATTERN[((++${#CONDITION_PATTERN[*]}))]="-q --quiet" + CONDITION_MESSAGE[((++${#CONDITION_MESSAGE[*]}))]="`gettext "isn't installed in the system."`" + shift 1 + ;; + + -- ) + shift 1 + break + ;; + + esac + done + + # Define list of files we want to apply verifications to, now that + # all option-like arguments have been removed from positional + # parameters list so we are free to go with the verifications. + local FILE='' + local FILES=$@ + + for FILE in $FILES;do + + until [[ ${COUNTER} -eq ${#CONDITION_PATTERN[*]} ]];do + + case ${CONDITION_COMMAND[$COUNTER]} in + + "test" | "rpm" ) + ${CONDITION_COMMAND[$COUNTER]} ${CONDITION_PATTERN[$COUNTER]} ${FILE} \ + || cli_printMessage "${FILE} ${CONDITION_MESSAGE[$COUNTER]}" --as-error-line + ;; + + "centos-art" ) + # Don't create another level for error messages here + # (that would duplicate them unnecessarily). Instead, + # set error messages inside specific functionalities + # and use them directly from there. + cli_runFnEnvironment ${CONDITION_PATTERN[$COUNTER]} ${FILE} + ;; + + "file" ) + if [[ ! $(${CONDITION_COMMAND[$COUNTER]} ${CONDITION_PATTERN[$COUNTER]} ${FILE}) == "$MIME" ]];then + cli_printMessage "${FILE} ${CONDITION_MESSAGE[$COUNTER]}" --as-error-line + fi + ;; + + "match" ) + if [[ ! ${FILE} =~ "${CONDITION_PATTERN[$COUNTER]}" ]];then + cli_printMessage "${FILE} ${CONDITION_MESSAGE[$COUNTER]}" --as-error-line + fi + ;; + + * ) + cli_printMessage "`gettext "The condition command provided isn't supported."`" --as-error-line + ;; + + esac + + COUNTER=$(($COUNTER + 1)) + + done + + done + +} diff --git a/Automation/centos-art.sh-mods/Commons/cli_checkRepoDirSource.sh b/Automation/centos-art.sh-mods/Commons/cli_checkRepoDirSource.sh new file mode 100755 index 0000000..c7a299a --- /dev/null +++ b/Automation/centos-art.sh-mods/Commons/cli_checkRepoDirSource.sh @@ -0,0 +1,89 @@ +#!/bin/bash +# +# cli_checkRepoDirSource.sh -- This function standardizes the path +# construction to directories inside the working copy, using absolute +# paths. This function transforms relative paths passed as non-option +# arguments to centos-art.sh script command-line into absolute paths +# inside the working copy based on whether you are using Subversion or +# Git as version control system. Further verifications, (e.g., whether +# they really exist as directories inside the working copy or not) +# should be realized outside this function. +# +# NOTE: Transforming relative paths into absolute paths before +# processing them is very useful when you need to execute the +# centos-art.sh script as command (e.g., `centos-art') anywhere +# inside the workstation. +# +# Use this function whenever you need to be sure that non-option +# arguments passed to centos-art.sh script command-line will always +# point to directories inside the working copy. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function cli_checkRepoDirSource { + + local LOCATION=${1} + + # Remove any dot from arguments passed to centos-art.sh script. + # This way it is possible to use a single dot to reflect the + # current location from which centos-art.sh was executed. Notice + # that using a dot as argument is optional (e.g.: when you pass no + # argument to centos-art command-line, the current location is + # used as default location). However, it might be useful to use a + # dot as argument when you want to include the current location in + # a list of arguments to process. + LOCATION=$(echo "$LOCATION" | sed -r "s,^\.$,$(pwd),g") + + # Remove the working directory absolute path from location to + # avoid path duplications here. + LOCATION=$(echo "$LOCATION" | sed "s,${TCAR_WORKDIR}/,,g") + + # When we use Git as version control system, there isn't a need of + # using the `trunk', `branches', `tags' convention we were using + # for Subversion. The working copy begins directly with the + # content of our repository (e.g., Documentation, Scripts, + # Identity and Locales). + # + # When we use Subversion as version control system, we follow the + # `trunk', `branches', `tags' convention to organize files inside + # the repository and need to redefine the source path in order to + # build the repository absolute path from the repository top level + # on. As convention, when you prepare your working copy through + # centos-art.sh script, the absolute path to the `trunk/' + # directory is used as working copy. This is, path arguments + # provided to centos-art.sh script will be interpreted from trunk/ + # directory level on. For example, the following command should + # work correctly in both Subversion and Git repositories: + # + # centos-art render Documentation/Manuals/Docbook/Tcar-ug + # + # There isn't a need of verifying the paths built here. This is + # something we do later, using the cli_checkFiles function. We + # don't do the file verification here to avoid malformed error + # messages when we reassign variable values using this function as + # reference (e.g., in order to prevent error messages from being + # stored inside variables.). + LOCATION=${TCAR_WORKDIR}/${LOCATION} + + # Output the absolute path to location. + echo "${LOCATION}" + +} diff --git a/Automation/centos-art.sh-mods/Commons/cli_expandTMarkers.sh b/Automation/centos-art.sh-mods/Commons/cli_expandTMarkers.sh new file mode 100755 index 0000000..d8b6806 --- /dev/null +++ b/Automation/centos-art.sh-mods/Commons/cli_expandTMarkers.sh @@ -0,0 +1,194 @@ +#!/bin/bash +# +# cli_expandTMarkers.sh -- This function standardizes construction of +# translation markers and their related expansion. As convention, +# translation markers must be set inside source files (e.g., Docbook, +# Svg, etc.) and expanded inside temporal instances used to produce +# final contents. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function cli_expandTMarkers { + + # Initialize variables. + local -a SRC + local -a DST + local COUNT=0 + local COUNTSRC=0 + local COUNTDST=0 + + # Define source location on which sed replacements take place. + local LOCATION="$1" + + # Verify that source location does exist. + cli_checkFiles -e ${LOCATION} + + # Define copyright translation markers. + SRC[((++${#SRC[*]}))]='=COPYRIGHT_YEAR(_LAST)?=' + DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --year)" + SRC[((++${#SRC[*]}))]='=COPYRIGHT_YEAR(S)?_LIST=' + DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --years-list)" + SRC[((++${#SRC[*]}))]='=COPYRIGHT_HOLDER=' + DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --holder)" + SRC[((++${#SRC[*]}))]='=COPYRIGHT_HOLDER_PREDICATE=' + DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --holder-predicate)" + + # Define name of branding files. This files are mainly used under + # Identity/(Images|Models)/Brands/ directory structure. These + # file names may vary from one project to another so we use this + # variable to control the name of such files. + SRC[((++${#SRC[*]}))]='=BRAND=' + DST[((++${#DST[*]}))]="${TCAR_BRAND}" + + # Define license translation markers. + SRC[((++${#SRC[*]}))]='=LICENSE=' + DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --license)" + SRC[((++${#SRC[*]}))]='=LICENSE_URL=' + DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --license-url)" + + # Define theme translation markers. + SRC[((++${#SRC[*]}))]='=THEME=' + DST[((++${#DST[*]}))]="$(cli_getPathComponent $OUTPUT --motif)" + SRC[((++${#SRC[*]}))]='=THEMENAME=' + DST[((++${#DST[*]}))]="$(cli_getPathComponent $OUTPUT --motif-name)" + SRC[((++${#SRC[*]}))]='=THEMERELEASE=' + DST[((++${#DST[*]}))]="$(cli_getPathComponent $OUTPUT --motif-release)" + + # Define release-specific translation markers. + SRC[((++${#SRC[*]}))]='=RELEASE=' + DST[((++${#DST[*]}))]="$FLAG_RELEASEVER" + SRC[((++${#SRC[*]}))]='=MAJOR_RELEASE=' + DST[((++${#DST[*]}))]="$(echo $FLAG_RELEASEVER | cut -d'.' -f1)" + SRC[((++${#SRC[*]}))]='=MINOR_RELEASE=' + DST[((++${#DST[*]}))]="$(echo $FLAG_RELEASEVER | cut -d'.' -f2)" + + # Define architectures translation markers. + SRC[((++${#SRC[*]}))]='=ARCH=' + DST[((++${#DST[*]}))]="$(cli_getPathComponent $FLAG_BASEARCH --architecture)" + + # Define url translation markers. + SRC[((++${#SRC[*]}))]='=URL=' + DST[((++${#DST[*]}))]=$(cli_printUrl '--home' '--with-locale') + SRC[((++${#SRC[*]}))]='=URL_WIKI=' + DST[((++${#DST[*]}))]=$(cli_printUrl '--wiki' '--with-locale') + SRC[((++${#SRC[*]}))]='=URL_LISTS=' + DST[((++${#DST[*]}))]=$(cli_printUrl '--lists' '--with-locale') + SRC[((++${#SRC[*]}))]='=URL_FORUMS=' + DST[((++${#DST[*]}))]=$(cli_printUrl '--forums' '--with-locale') + SRC[((++${#SRC[*]}))]='=URL_MIRRORS=' + DST[((++${#DST[*]}))]=$(cli_printUrl '--mirrors' '--with-locale') + SRC[((++${#SRC[*]}))]='=URL_DOCS=' + DST[((++${#DST[*]}))]=$(cli_printUrl '--docs' '--with-locale') + SRC[((++${#SRC[*]}))]='=URL_PROJECTS=' + DST[((++${#DST[*]}))]=$(cli_printUrl '--projects' '--with-locale') + SRC[((++${#SRC[*]}))]='=URL_BUGS=' + DST[((++${#DST[*]}))]=$(cli_printUrl '--bugs' '--with-locale') + SRC[((++${#SRC[*]}))]='=URL_SVN=' + DST[((++${#DST[*]}))]=$(cli_printUrl '--svn' '--with-locale') + SRC[((++${#SRC[*]}))]='=URL_TRAC=' + DST[((++${#DST[*]}))]=$(cli_printUrl '--trac' '--with-locale') + SRC[((++${#SRC[*]}))]='=URL_PLANET=' + DST[((++${#DST[*]}))]=$(cli_printUrl '--planet' '--with-locale') + + # Define emails translation markers. + SRC[((++${#SRC[*]}))]='=MAIL_DOCS=' + DST[((++${#DST[*]}))]="$(cli_printMailingList --docs)" + + # Define locale translation markers. + SRC[((++${#SRC[*]}))]='=LOCALE=' + DST[((++${#DST[*]}))]="${CLI_LANG_LC}" + SRC[((++${#SRC[*]}))]='=LOCALE_LL=' + DST[((++${#DST[*]}))]="${CLI_LANG_LL}" + SRC[((++${#SRC[*]}))]='=LOCALE_CC=' + DST[((++${#DST[*]}))]="${CLI_LANG_CC}" + + # Define domain translation markers for domains. + SRC[((++${#SRC[*]}))]='=DOMAIN_LL=' + if [[ ! ${CLI_LANG_LL} =~ '^en' ]];then + DST[((++${#DST[*]}))]="${CLI_LANG_LL}" + else + DST[((++${#DST[*]}))]="" + fi + + # Define repository translation markers. + SRC[((++${#SRC[*]}))]='=(REPO_TLDIR|REPO_HOME|TCAR_WORKDIR)=' + DST[((++${#DST[*]}))]="${TCAR_WORKDIR}" + + # Do replacement of nested translation markers. + while [[ $COUNTDST -lt ${#DST[@]} ]];do + + # Verify existence of translation markers. If there is no + # translation marker on replacement, continue with the next + # one in the list. + if [[ ! ${DST[$COUNTDST]} =~ '=[A-Z_]+=' ]];then + # Increment destination counter. + COUNTDST=$(($COUNTDST + 1)) + # The current replacement value doesn't have translation + # marker inside, so skip it and evaluate the next + # replacement value in the list. + continue + fi + + while [[ $COUNTSRC -lt ${#SRC[*]} ]];do + + # Update replacements. + DST[$COUNTDST]=$(echo ${DST[$COUNTDST]} \ + | sed -r "s!${SRC[$COUNTSRC]}!${DST[$COUNTSRC]}!g") + + # Increment source counter. + COUNTSRC=$(($COUNTSRC + 1)) + + done + + # Reset source counter + COUNTSRC=0 + + # Increment destination counter. + COUNTDST=$(($COUNTDST + 1)) + + done + + # Apply replacements for translation markers. + while [[ ${COUNT} -lt ${#SRC[*]} ]];do + + # Use sed to replace translation markers inside the design + # model instance. + sed -r -i "s!${SRC[$COUNT]}!${DST[$COUNT]}!g" ${LOCATION} + + # Increment counter. + COUNT=$(($COUNT + 1)) + + done + + # Remove escaped character from translation markers. This is one + # of the reasons why translation marker should be expanded in + # source files instances not the source files themselves. + # Escaping translation markers provides a way of talking about + # them without expanding them. + sed -r -i 's/(=)\\([A-Z_]+=)/\1\2/g' ${LOCATION} + + # Unset specific translation markers and specific replacement + # variables in order to clean them up. Otherwise, undesired values + # may remain from one file to another. + unset SRC + unset DST + +} diff --git a/Automation/centos-art.sh-mods/Commons/cli_exportFunctions.sh b/Automation/centos-art.sh-mods/Commons/cli_exportFunctions.sh new file mode 100755 index 0000000..1af3c72 --- /dev/null +++ b/Automation/centos-art.sh-mods/Commons/cli_exportFunctions.sh @@ -0,0 +1,96 @@ +#!/bin/bash +# +# cli_exportFunctions.sh -- This function standardizes the way +# specific functionalities are exported to centos-art.sh script +# environment. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function cli_exportFunctions { + + # Retrieve export identifier for the function we want to export. + local EXPORTID="$1" + + # Verify the export identification existence. This argument must + # be passed as first argument and match a relative path format. + if [[ ! $EXPORTID =~ '^[A-Z][[:alpha:]]+(/[[:alpha:]_]+)+$' ]];then + cli_printMessage "`gettext "The export id doesn't match its pattern."`" --as-error-line + fi + + # Define the source location where function files are placed in. + local LOCATION=${CLI_FUNCDIR}/$(dirname ${EXPORTID}) + + # Define suffix used to retrieve function files. + local SUFFIX=$(basename "$EXPORTID") + + # Verify the suffix value used to retrieve function files. + # Assuming no suffix value is passed as second argument to this + # function, use the function name value (CLI_FUNCNAME) as default + # value. + if [[ $SUFFIX == '' ]];then + SUFFIX="${CLI_FUNCNAME}" + fi + + # Redefine suffix to match all related function files inside the + # related function directory. + SUFFIX=${SUFFIX}'[[:alpha:]_]*' + + # Define the pattern used to retrieve function names from function + # files. + local PATTERN="^function[[:space:]]+${SUFFIX}[[:space:]]+{[[:space:]]*$" + + # Define the list of files. + local FUNCFILE='' + local FUNCFILES=$(cli_getFilesList ${LOCATION} --pattern="${LOCATION}/${SUFFIX}\.sh$" \ + --maxdepth='1' --mindepth='1' --type='f') + + # Verify the list of files. If no function file exists for the + # location specified stop the script execution. Otherwise the + # script will surely try to execute a function that haven't been + # exported yet and report an error about it. + if [[ $FUNCFILES == '' ]];then + cli_printMessage "${FUNCNAME}: `gettext "No function file was found."`" --as-error-line + fi + + # Process the list of files. + for FUNCFILE in $FUNCFILES;do + + # Verify the execution rights for function file. + cli_checkFiles -x ${FUNCFILE} + + # Verify that function files have not been already exported. + # If they have been already exported don't export them again. + # Instead, continue with the next function file in the list. + declare -F | gawk '{ print $3 }' | egrep "^${FUNCFILE}$" > /dev/null + if [[ $? -eq 0 ]];then + continue + fi + + # Initialize the function file. + . ${FUNCFILE} + + # Export the function names inside the file to current shell + # script environment. + export -f $(egrep "${PATTERN}" ${FUNCFILE} | gawk '{ print $2 }') + + done + +} diff --git a/Automation/centos-art.sh-mods/Commons/cli_getConfigLines.sh b/Automation/centos-art.sh-mods/Commons/cli_getConfigLines.sh new file mode 100755 index 0000000..2d9b636 --- /dev/null +++ b/Automation/centos-art.sh-mods/Commons/cli_getConfigLines.sh @@ -0,0 +1,67 @@ +#!/bin/bash +# +# cli_getConfigLines.sh -- This function standardizes the way +# configuration lines are retrieved form configuration files. As +# arguments, the configuration file absolute path, the configuration +# section name, and the configuration option name must be provided. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function cli_getConfigLines { + + # Initialize absolute path to configuration file. + local CONFIG_ABSPATH="$1" + + # Verify that configuration file does exist. + cli_checkFiles -e ${CONFIG_ABSPATH} + + # Initialize configuration section name where the variable value + # we want to to retrieve is set in. + local CONFIG_SECTION="$2" + + # Be sure the configuration section name has the correct format. + if [[ ! $CONFIG_SECTION =~ '^[[:alnum:]._-]+$' ]];then + cli_printMessage "`gettext "The configuration section provided is incorrect."`" --as-error-line + fi + + # Initialize variable name we want to retrieve value from. + local CONFIG_OPTION="$3" + + # Verify configuration variable name. When no variable name is + # provided print all configuration lines that can be considered as + # well-formed paths. Be sure configuration variable name starts + # just at the beginning of the line. + if [[ ! $CONFIG_OPTION =~ '^[[:alnum:]_./-]+$' ]];then + CONFIG_OPTION='[[:alnum:]_./-]+[[:space:]]*=' + fi + + # Retrieve configuration lines from configuration file. + local CONFIG_LINES=$(cat ${CONFIG_ABSPATH} \ + | egrep -v '^#' \ + | egrep -v '^[[:space:]]*$' \ + | sed -r -n "/^\[${CONFIG_SECTION}\][[:space:]]*$/,/^\[/p" \ + | egrep -v '^\[' | sort | uniq \ + | egrep "^${CONFIG_OPTION}") + + # Output value related to variable name. + echo "$CONFIG_LINES" + +} diff --git a/Automation/centos-art.sh-mods/Commons/cli_getConfigSectionNames.sh b/Automation/centos-art.sh-mods/Commons/cli_getConfigSectionNames.sh new file mode 100755 index 0000000..a280736 --- /dev/null +++ b/Automation/centos-art.sh-mods/Commons/cli_getConfigSectionNames.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# +# cli_getConfigSectionNames.sh -- This function standardizes the way +# section names are retrieved from configuration files. Once section +# names are retrieved they are printed to standard output for further +# processing. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function cli_getConfigSectionNames { + + # Define absolute path to configuration file we want to retrieve + # section names from. + local CONF_FILE=$1 + + # Verify existence of configuration file. + cli_checkFiles $CONF_FILE -f + + # Output all section names without brackets, one per line. + egrep '^\[[[:alnum:]._-]+\][[:space:]]*$' $CONF_FILE \ + | sed -r 's/\[(.+)\]/\1/' + +} diff --git a/Automation/centos-art.sh-mods/Commons/cli_getConfigValue.sh b/Automation/centos-art.sh-mods/Commons/cli_getConfigValue.sh new file mode 100755 index 0000000..08065ae --- /dev/null +++ b/Automation/centos-art.sh-mods/Commons/cli_getConfigValue.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# +# cli_getConfigValue.sh -- This function standardizes the way configuration +# files are retrieved from configuration files. As arguments, the +# configuration file absolute path, the configuration section name, and the +# configuration option name must be provided. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function cli_getConfigValue { + + # Initialize absolute path to configuration file. + local CONFIG_ABSPATH="$1" + + # Initialize configuration section name where the variable value + # we want to to retrieve is set in. + local CONFIG_SECTION="$2" + + # Initialize variable name we want to retrieve value from. + local CONFIG_OPTION="$3" + + # Retrieve configuration lines from configuration file. + local CONFIG_LINES=$(cli_getConfigLines \ + "$CONFIG_ABSPATH" "$CONFIG_SECTION" "$CONFIG_OPTION") + + # Parse configuration lines to retrieve the values of variable + # names. + local CONFIG_VALUE=$(echo $CONFIG_LINES \ + | cut -d= -f2- \ + | sed -r -e 's/"//g' -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' ) + + # Output values related to variable name. + echo "$CONFIG_VALUE" + +} diff --git a/Automation/centos-art.sh-mods/Commons/cli_getFilesList.sh b/Automation/centos-art.sh-mods/Commons/cli_getFilesList.sh new file mode 100755 index 0000000..8a6e42b --- /dev/null +++ b/Automation/centos-art.sh-mods/Commons/cli_getFilesList.sh @@ -0,0 +1,125 @@ +#!/bin/bash +# +# cli_getFilesList.sh -- This function standardizes the way list of +# files are built inside centos-art.sh script. This function outputs a +# sorted and unique list of files based on the options and locations +# passed as argument. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function cli_getFilesList { + + # Define short options. + local ARGSS='' + + # Define long options. + local ARGSL='pattern:,mindepth:,maxdepth:,type:,uid:' + + # Initialize pattern used to reduce the find output. + local PATTERN="$FLAG_FILTER" + + # Initialize options used with find command. + local OPTIONS='' + + # Initialize arguments with an empty value and set it as local + # variable to this function scope. Doing this is very important to + # avoid any clash with higher execution environments. + local ARGUMENTS='' + + # Prepare ARGUMENTS for getopt. + cli_parseArgumentsReDef "$@" + + # Redefine ARGUMENTS using getopt(1) command parser. + cli_parseArguments + + # Redefine positional parameters using ARGUMENTS variable. + eval set -- "$ARGUMENTS" + + while true;do + case "$1" in + + --pattern ) + PATTERN="$2" + shift 2 + ;; + + --maxdepth ) + OPTIONS="$OPTIONS -maxdepth $2" + shift 2 + ;; + + --mindepth ) + OPTIONS="$OPTIONS -mindepth $2" + shift 2 + ;; + + --type ) + OPTIONS="$OPTIONS -type $2" + shift 2 + ;; + + --uid ) + OPTIONS="$OPTIONS -uid $2" + shift 2 + ;; + + -- ) + shift 1 + break + ;; + esac + done + + # At this point all options arguments have been processed and + # removed from positional parameters. Only non-option arguments + # remain so we use them as source location for find command to + # look files for. + local LOCATIONS=$@ + + # Verify that locations does exist. + cli_checkFiles -e ${LOCATIONS} + + # Redefine pattern as regular expression. When we use regular + # expressions with find, regular expressions are evaluated against + # the whole file path. This way, when the regular expression is + # specified, we need to build it in a way that matches the whole + # path we are using. Doing so, every time we pass the `--filter' + # option in the command-line could be a tedious task. Instead, in + # the sake of reducing some typing, we prepare the regular + # expression here to match the whole path using the regular + # expression provided by the user as pattern. Do not use LOCATION + # variable as part of regular expression so it could be possible + # to use path expansion. Using path expansion reduce the amount + # of places to find out things and so the time required to finish + # the task. + # + # Don't do such path expansion here. Instead, do it when you call + # this function. Otherwise you would be prohibiting the + # application of exact patterns. + #PATTERN="^/.*${PATTERN}$" + + # Define list of files to process. At this point we cannot verify + # whether the LOCATION is a directory or a file since path + # expansion could be introduced to it. The best we can do is + # verifying exit status and go on. + find ${LOCATIONS} -regextype posix-egrep ${OPTIONS} -regex "${PATTERN}" | sort | uniq + +} diff --git a/Automation/centos-art.sh-mods/Commons/cli_getLocalizationDir.sh b/Automation/centos-art.sh-mods/Commons/cli_getLocalizationDir.sh new file mode 100755 index 0000000..42c4456 --- /dev/null +++ b/Automation/centos-art.sh-mods/Commons/cli_getLocalizationDir.sh @@ -0,0 +1,58 @@ +#!/bin/bash +# +# cli_getLocalizationDir.sh -- This function standardizes the way +# localization paths are created. The first argument of this function +# must be a path pointing a directory inside the repository. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function cli_getLocalizationDir { + + # Sanitate non-option arguments to be sure they match the + # directory conventions established by centos-art.sh script + # against source directory locations in the working copy. + LOCATION=$(cli_checkRepoDirSource "${1}") + + # In case the location specified would be a file, remove the file + # part from the path so only its parent directory remains. + if [[ -f ${LOCATION} ]];then + LOCATION=$(dirname ${LOCATION}) + fi + + # Make path transformation. + case "${2}" in + + '--no-lang' ) + LOCATION=$(echo "${LOCATION}" \ + | sed -r -e "s!(Identity|Scripts|Documentation)!Locales/\1!") + ;; + + * ) + LOCATION=$(echo "${LOCATION}" \ + | sed -r -e "s!(Identity|Scripts|Documentation)!Locales/\1!")/${CLI_LANG_LC} + ;; + + esac + + # Output transformed path. + echo "${LOCATION}" + +} diff --git a/Automation/centos-art.sh-mods/Commons/cli_getPathComponent.sh b/Automation/centos-art.sh-mods/Commons/cli_getPathComponent.sh new file mode 100755 index 0000000..cb262dd --- /dev/null +++ b/Automation/centos-art.sh-mods/Commons/cli_getPathComponent.sh @@ -0,0 +1,140 @@ +#!/bin/bash +# +# cli_getPathComponent.sh -- This function standardizes the way +# directory structures are organized inside the working copy of CentOS +# Artwork Repository. You can use this function to retrieve +# information from paths (e.g., releases, architectures and theme +# artistic motifs) or the patterns used to build the paths. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function cli_getPathComponent { + + # Define short options. + local ARGSS='' + + # Define long options. + local ARGSL='release,release-major,release-minor,release-pattern,architecture,architecture-pattern,motif,motif-name,motif-release,motif-pattern,repo-dir' + + # Define release pattern. + local RELEASE="(([[:digit:]]+)(\.([[:digit:]]+))?)" + + # Define architecture pattern. Make it match the architectures the + # CentOS distribution is able to be installed on. + local ARCHITECTURE="(i386|x86_64)" + + # Define regular expression pattern that match the theme artistic + # motif component inside the path strings. + local THEME_MOTIF="Identity/Images/Themes/(([[:alnum:]]+)/(${RELEASE}))" + + # Initialize arguments with an empty value and set it as local + # variable to this function scope. Doing this is very important to + # avoid any clash with higher execution environments. + local ARGUMENTS='' + + # Prepare ARGUMENTS variable for getopt. + cli_parseArgumentsReDef "$@" + + # Redefine ARGUMENTS using getopt(1) command parser. + cli_parseArguments + + # Redefine positional parameters using ARGUMENTS variable. + eval set -- "$ARGUMENTS" + + # Define location we want to apply verifications to. + local LOCATION=$(echo $@ | sed -r 's!^.*--[[:space:]](.+)$!\1!') + + # Look for options passed through positional parameters. + while true;do + + case "$1" in + + --release ) + echo "$LOCATION" | egrep "${RELEASE}" | sed -r "s!.*/${RELEASE}/.*!\1!" + shift 1 + break + ;; + + --release-major ) + echo "$LOCATION" | egrep "${RELEASE}" | sed -r "s!.*/${RELEASE}/.*!\2!" + shift 1 + break + ;; + + --release-minor ) + echo "$LOCATION" | egrep "${RELEASE}" | sed -r "s!.*/${RELEASE}/.*!\4!" + shift 1 + break + ;; + + --release-pattern ) + echo "${RELEASE}" + shift 1 + break + ;; + + --architecture ) + echo "$LOCATION" | egrep "${ARCHITECTURE}" | sed -r "s!${ARCHITECTURE}!\1!" + shift 1 + break + ;; + + --architecture-pattern ) + echo "${ARCHITECTURE}" + shift 1 + break + ;; + + --motif ) + echo "$LOCATION" | egrep "${THEME_MOTIF}" | sed -r "s!.*${THEME_MOTIF}.*!\1!" + shift 1 + break + ;; + + --motif-name ) + echo "$LOCATION" | egrep "${THEME_MOTIF}" | sed -r "s!.*${THEME_MOTIF}.*!\2!" + shift 1 + break + ;; + + --motif-release ) + echo "$LOCATION" | egrep "${THEME_MOTIF}" | sed -r "s!.*${THEME_MOTIF}.*!\3!" + shift 1 + break + ;; + + --motif-pattern ) + echo "${THEME_MOTIF}" + shift 1 + break + ;; + + --repo-dir ) + echo "${LOCATION}" | sed "s,${TCAR_WORKDIR}/,," + shift 1 + break + ;; + + esac + + done + +} diff --git a/Automation/centos-art.sh-mods/Commons/cli_getRepoName.sh b/Automation/centos-art.sh-mods/Commons/cli_getRepoName.sh new file mode 100755 index 0000000..3680252 --- /dev/null +++ b/Automation/centos-art.sh-mods/Commons/cli_getRepoName.sh @@ -0,0 +1,133 @@ +#!/bin/bash +# +# cli_getRepoName.sh -- This function standardizes files and +# directories name convection inside the working copy of CentOS +# Artowrk Repository. As convection, regular files are written in +# lower-case and directories are written capitalized. Use this +# function to sanitate the name of regular files and directories on +# paths you work with. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function cli_getRepoName { + + # Define the name we want to apply verifications to. + local NAME="$1" + + # Avoid using options as it were names. When name value is empty + # but an option is provided, the option becomes the first + # positional argument and is evaluated as it were a name which is + # something we need to prevent from happening. + if [[ $NAME =~ '^-' ]];then + return + fi + + # Look for options passed through positional parameters. + case "$2" in + + -f|--basename ) + + # Reduce the path passed to use just the non-directory + # part of it (i.e., the last component in the path; _not_ + # the last "real" directory in the path). + NAME=$(basename $NAME) + + # Clean value. + NAME=$(echo $NAME \ + | tr -s ' ' '_' \ + | tr '[:upper:]' '[:lower:]') + ;; + + -d|--dirname ) + + local DIR='' + local DIRS='' + local CLEANDIRS='' + local PREFIXDIR='' + + # In order to sanitate each directory in a path, it is + # required to break off the path string so each component + # can be worked out individually and later combine them + # back to create a clean path string. + + # Reduce path information passed to use the directory part + # of it only. Of course, this is applied if there is a + # directory part in the path. Assuming there is no + # directory part but a non-empty value in the path, use + # that value as directory part and clean it up. + if [[ $NAME =~ '.+/.+' ]];then + + # When path information is reduced, we need to + # consider that absolute paths contain some + # directories outside the working copy directory + # structure that shouldn't be sanitized (e.g., /home, + # /home/centos, /home/centos/artwork, + # /home/centos/artwork/turnk, trunk, etc.) So, we keep + # them unchanged for later use. + PREFIXDIR=$(echo $NAME \ + | sed -r "s,^((${TCAR_WORKDIR}/)?(trunk|branches|tags)/)?.+$,\1,") + + # ... and remove them from the path information we do + # want to sanitate. + DIRS=$(dirname "$NAME" \ + | sed -r "s!^${PREFIXDIR}!!" \ + | tr '/' ' ') + + else + + # At this point, there is not directory part in the + # information passed, so use the value passed as + # directory part as such. + DIRS=$NAME + + fi + + for DIR in $DIRS;do + + # Sanitate directory component. + if [[ $DIR =~ '^[a-z]' ]];then + DIR=$(echo ${DIR} \ + | tr -s ' ' '_' \ + | tr '[:upper:]' '[:lower:]' \ + | sed -r 's/^([[:alpha:]])/\u\1/') + fi + + # Rebuild path using sanitized values. + CLEANDIRS="${CLEANDIRS}/$DIR" + + done + + # Redefine path using sanitized values. + NAME=$(echo ${CLEANDIRS} | sed -r "s!^/!!") + + # Add prefix directory information to sanitate path + # information. + if [[ "$PREFIXDIR" != '' ]];then + NAME=${PREFIXDIR}${NAME} + fi + ;; + + esac + + # Print out the clean path string. + echo $NAME + +} diff --git a/Automation/centos-art.sh-mods/Commons/cli_getTemporalFile.sh b/Automation/centos-art.sh-mods/Commons/cli_getTemporalFile.sh new file mode 100755 index 0000000..73849ce --- /dev/null +++ b/Automation/centos-art.sh-mods/Commons/cli_getTemporalFile.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# +# cli_getTemporalFile.sh -- This function returns the absolute path +# you need to use to create temporal files. Use this function whenever +# you need to create temporal files inside centos-art.sh script. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function cli_getTemporalFile { + + # Define base name for temporal file. This is required when svg + # instances are created previous to be parsed by inkscape in order + # to be exported as png. In such cases .svg file extension is + # required in order to avoid complains from inkscape. + local NAME="$(cli_getRepoName $1 -f)" + + # Check default base name for temporal file, it can't be an empty + # value. + if [[ "$NAME" == '' ]];then + cli_printMessage "`gettext "The first argument cannot be empty."`" --as-error-line + fi + + # Define absolute path for temporal file. + local TEMPFILE="${TMPDIR}/${NAME}" + + # Output absolute path to final temporal file. + echo $TEMPFILE + +} diff --git a/Automation/centos-art.sh-mods/Commons/cli_parseArguments.sh b/Automation/centos-art.sh-mods/Commons/cli_parseArguments.sh new file mode 100755 index 0000000..d583ac6 --- /dev/null +++ b/Automation/centos-art.sh-mods/Commons/cli_parseArguments.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# +# cli_parseArguments.sh -- This function redefines arguments +# (ARGUMENTS) global variable using getopt(1) output. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function cli_parseArguments { + + # Reset positional parameters using optional arguments. + eval set -- "$ARGUMENTS" + + # Parse optional arguments using getopt. + ARGUMENTS=$(getopt -o "$ARGSS" -l "$ARGSL" -n "$CLI_NAME (${FUNCNAME[1]})" -- "$@") + + # Be sure getout parsed arguments successfully. Otherwise, finish + # script execution with a to know more line. + if [[ $? != 0 ]]; then + cli_printMessage "${CLI_FUNCDIRNAM}" --as-toknowmore-line + exit + fi + +} diff --git a/Automation/centos-art.sh-mods/Commons/cli_parseArgumentsReDef.sh b/Automation/centos-art.sh-mods/Commons/cli_parseArgumentsReDef.sh new file mode 100755 index 0000000..6cb7f77 --- /dev/null +++ b/Automation/centos-art.sh-mods/Commons/cli_parseArgumentsReDef.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# +# cli_parseArgumentsReDef.sh -- This function initiates/reset and +# sanitizes positional parameters passed to this function and creates +# the list of arguments that getopt will process. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function cli_parseArgumentsReDef { + + local ARG + + # Clean up arguments global variable. + ARGUMENTS='' + + # Fill up arguments global variable with current positional + # parameter information. To avoid interpretation problems, use + # single quotes to enclose each argument (ARG) from command-line + # individually. + for ARG in "$@"; do + + # Remove any single quote from arguments passed to + # centos-art.sh script. We will use single quotes for grouping + # option values so white space can be passed through them. + ARG=$(echo "$ARG" | tr -d "'") + + # Concatenate arguments and enclose them to let getopt to + # process them when they have spaces inside. + ARGUMENTS="$ARGUMENTS '$ARG'" + + done + + # Verify non-option arguments passed to command-line. If there + # isn't any or dot is provided, redefine the ARGUMENTS variable to + # use the current location the centos-art.sh script was called + # from. + if [[ -z $ARGUMENTS ]];then + ARGUMENTS=${PWD} + fi + +} diff --git a/Automation/centos-art.sh-mods/Commons/cli_printCopyrightInfo.sh b/Automation/centos-art.sh-mods/Commons/cli_printCopyrightInfo.sh new file mode 100755 index 0000000..078bc05 --- /dev/null +++ b/Automation/centos-art.sh-mods/Commons/cli_printCopyrightInfo.sh @@ -0,0 +1,116 @@ +#!/bin/bash +# +# cli_printCopyrightInfo.sh -- This function standardizes the +# copyright information printed on content produced by centos-art.sh +# script. +# +# As far as I understand, the copyright exists to make people create +# more. The copyright gives creators the legal power over their +# creations and so the freedom to distribute them under the ethical +# terms the creator considers better. At this moment I don't feel +# very confident about this legal affairs and their legal +# implications, but I need to decide what copyright information the +# centos-art.sh script will print out when it be requested about it. +# So, in that sake, I'll assume the same copyright information used by +# The CentOS Wiki (http://wiki.centos.org/) as reference. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function cli_printCopyrightInfo { + + case "$1" in + + --license ) + + # Print the license name. + echo "`gettext "Creative Common Attribution-ShareAlike 3.0 License"`" + ;; + + --license-url ) + + # Print the url related to license name. + cli_printUrl --cc-sharealike + ;; + + --first-year ) + + # The former year when I (as collaborator of The CentOS + # Project) started to consolidate The CentOS Project + # Corporate Visual Identity through the CentOS Artwork + # Repository. + echo '2009' + ;; + + --year|--last-year) + + # The last year when The CentOS Project stopped working in + # its Corporate Visual Identity through the CentOS Artwork + # Repository. That is something that I hope never happens, + # so assume the current year as last working year. + date +%Y + ;; + + --years-range ) + + local FIRST_YEAR=$(cli_printCopyrightInfo --first-year) + local LAST_YEAR=$(cli_printCopyrightInfo --last-year) + echo "${FIRST_YEAR}-${LAST_YEAR}" + ;; + + --years-list ) + + local FIRST_YEAR=$(cli_printCopyrightInfo --first-year) + local LAST_YEAR=$(cli_printCopyrightInfo --last-year) + + # Define full copyright year string based on first and + # last year. + local FULL_YEAR=$(\ + while [[ ${FIRST_YEAR} -le ${LAST_YEAR} ]];do + echo -n "${FIRST_YEAR}, " + FIRST_YEAR=$(($FIRST_YEAR + 1)) + done) + + # Prepare full copyright year string and print it out. + echo "${FULL_YEAR}" | sed 's!, *$!!' + ;; + + --holder ) + + # Print centos-art.sh script default copyright holder. + echo "The CentOS Project" + ;; + + --holder-predicate ) + + local HOLDER=$(cli_printCopyrightInfo --holder) + echo "${HOLDER}. `gettext "All rights reserved."`" + ;; + + * ) + + local YEAR=$(cli_printCopyrightInfo --last-year) + local HOLDER=$(cli_printCopyrightInfo --holder) + echo "Copyright © ${YEAR} ${HOLDER}" + ;; + + esac + +} diff --git a/Automation/centos-art.sh-mods/Commons/cli_printMailingList.sh b/Automation/centos-art.sh-mods/Commons/cli_printMailingList.sh new file mode 100755 index 0000000..b6053d7 --- /dev/null +++ b/Automation/centos-art.sh-mods/Commons/cli_printMailingList.sh @@ -0,0 +1,76 @@ +#!/bin/bash +# +# cli_printMailingList.sh -- This function standardize the way mailing +# list addresses are printed on content produced by centos-art.sh +# script. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function cli_printMailingList { + + local MAILADDRS='' + + # Define short options. + local ARGSS='' + + # Define long options. + local ARGSL='as-html-link:,docs' + + # Initialize arguments with an empty value and set it as local + # variable to this function scope. Doing this is very important to + # avoid any clash with higher execution environments. + local ARGUMENTS='' + + # Prepare ARGUMENTS for getopt. + cli_parseArgumentsReDef "$@" + + # Redefine ARGUMENTS using getopt(1) command parser. + cli_parseArguments + + # Redefine positional parameters using ARGUMENTS variable. + eval set -- "$ARGUMENTS" + + # Look for options passed through command-line. + while true; do + case "$1" in + + --docs ) + MAILADDRS="${TCAR_BRAND}-docs@$(cli_printUrl --domain)" + shift 1 + ;; + + --as-html-link ) + MAILADDRS="${2}" + shift 2 + ;; + + -- ) + + shift 1 + break + ;; + esac + done + + # Print mail address. + echo "$MAILADDRS" + +} diff --git a/Automation/centos-art.sh-mods/Commons/cli_printMessage.sh b/Automation/centos-art.sh-mods/Commons/cli_printMessage.sh new file mode 100755 index 0000000..e4cdd4d --- /dev/null +++ b/Automation/centos-art.sh-mods/Commons/cli_printMessage.sh @@ -0,0 +1,285 @@ +#!/bin/bash +# +# cli_printMessage.sh -- This function standardizes the way messages +# are printed by centos-art.sh script. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function cli_printMessage { + + local MESSAGE="$1" + local FORMAT="$2" + + # Verify message variable, it cannot have an empty value. + if [[ $MESSAGE == '' ]];then + cli_printMessage "`gettext "The message cannot be empty."`" --as-error-line + fi + + # Define message horizontal width. This is the max number of + # horizontal characters the message will use to be displayed on + # the screen. + local MESSAGE_WIDTH=66 + + # Remove empty spaces from message. + MESSAGE=$(echo $MESSAGE | sed -r -e 's!^[[:space:]]+!!') + + # Print messages that will always be printed no matter what value + # the FLAG_QUIET variable has. + case "$FORMAT" in + + --as-stdout-line ) + + # Default printing format. This is the format used when no + # other specification is passed to this function. As + # convenience, we transform absolute paths into relative + # paths in order to free horizontal space on final output + # messages. + echo "$MESSAGE" | sed -r \ + -e "s!${TCAR_WORKDIR}/!!g" \ + -e "s!> /!> !g" \ + -e "s!/{2,}!/!g" \ + | awk 'BEGIN { FS=": " } + { + if ( $0 ~ /^-+$/ ) + print $0 + else + printf "%-15s\t%s\n", $1, $2 + } + END {}' + ;; + + --as-error-line ) + + # Define where the error was originated inside the + # centos-art.sh script. Print out the function name and + # line from the caller. + local ORIGIN="$(caller 1 | gawk '{ print $2 " L." $1 }')" + + # Build the error message. + cli_printMessage "${CLI_NAME} (${ORIGIN}):" --as-stdout-line + cli_printMessage "${MESSAGE}" --as-response-line + cli_printMessage "${CLI_FUNCNAME}" --as-toknowmore-line + + # Finish script execution with exit status 1 (SIGHUP) to + # imply the script finished because an error. We are + # using this as convention to finish the script execution. + # So, don't remove the following line, please. + exit 1 + ;; + + --as-suggestion-line ) + + # Define where the error was originated inside the + # centos-art.sh script. Print out the function name and + # line from the caller. + local ORIGIN="$(caller 1 | gawk '{ print $2 " L." $1 }')" + + # Build the error message. + cli_printMessage "${CLI_NAME} (${ORIGIN}):" --as-stdout-line + cli_printMessage "`gettext "The path provided cannot be processed the way you entered it."`" --as-stdout-line + cli_printMessage "`gettext "Instead, try the following equivalence:"`" --as-stdout-line + cli_printMessage "${MESSAGE}" --as-response-line + cli_printMessage "${CLI_FUNCNAME}" --as-toknowmore-line + + # Finish script execution with exit status 1 (SIGHUP) to + # imply the script finished because an error. We are + # using this as convention to finish the script execution. + # So, don't remove the following line, please. + exit 1 + ;; + + --as-toknowmore-line ) + cli_printMessage '-' --as-separator-line + cli_printMessage "`gettext "To know more, run"` ${CLI_NAME} ${MESSAGE} --help" --as-stdout-line + cli_printMessage '-' --as-separator-line + ;; + + --as-yesornorequest-line ) + + # Define positive answer. + local Y="`gettext "yes"`" + + # Define negative answer. + local N="`gettext "no"`" + + # Define default answer. + local ANSWER=${N} + + if [[ $FLAG_ANSWER == 'true' ]];then + + ANSWER=${Y} + + else + + # Print the question to standard error. + cli_printMessage "$MESSAGE [${Y}/${N}]" --as-request-line + + # Redefine default answer based on user's input. + read ANSWER + + fi + + # Verify user's answer. Only positive answer let the + # script flow to continue. Otherwise, if something + # different from positive answer is passed, the script + # terminates its execution immediately. + if [[ ! ${ANSWER} =~ "^${Y}" ]];then + exit + fi + ;; + + --as-selection-line ) + # Create selection based on message. + local NAME='' + select NAME in ${MESSAGE};do + echo $NAME + break + done + ;; + + --as-response-line ) + cli_printMessage "--> $MESSAGE" --as-stdout-line + ;; + + --as-request-line ) + cli_printMessage "${MESSAGE}:\040" --as-notrailingnew-line + ;; + + --as-notrailingnew-line ) + echo -e -n "${MESSAGE}" | sed -r \ + -e "s!${TCAR_WORKDIR}/!!g" + ;; + + --as-stderr-line ) + echo "$MESSAGE" | sed -r \ + -e "s!${TCAR_WORKDIR}/!!g" 1>&2 + ;; + + esac + + # Verify verbose option. The verbose option controls whether + # messages are printed or not. + if [[ "$FLAG_QUIET" == 'true' ]];then + return + fi + + # Print messages that will be printed only when the FLAG_QUIET + # variable is provided to centos-art.sh script. + case "$FORMAT" in + + --as-separator-line ) + + # Build the separator line. + MESSAGE=$(\ + until [[ $MESSAGE_WIDTH -eq 0 ]];do + echo -n "$(echo $MESSAGE | sed -r 's!(.).*!\1!')" + MESSAGE_WIDTH=$(($MESSAGE_WIDTH - 1)) + done) + + # Draw the separator line. + echo "$MESSAGE" + ;; + + --as-banner-line ) + cli_printMessage '-' --as-separator-line + cli_printMessage "$MESSAGE" --as-stdout-line + cli_printMessage '-' --as-separator-line + ;; + + --as-processing-line ) + cli_printMessage "`gettext "Processing"`: $MESSAGE" --as-stdout-line + ;; + + --as-cropping-line ) + cli_printMessage "`gettext "Cropping from"`: $MESSAGE" --as-stdout-line + ;; + + --as-tuningup-line ) + cli_printMessage "`gettext "Tuning-up"`: $MESSAGE" --as-stdout-line + ;; + + --as-checking-line ) + cli_printMessage "`gettext "Checking"`: $MESSAGE" --as-stdout-line + ;; + + --as-combining-line ) + cli_printMessage "`gettext "Combining"`: $MESSAGE" --as-stdout-line + ;; + + --as-creating-line | --as-updating-line ) + if [[ -a "$MESSAGE" ]];then + cli_printMessage "`gettext "Updating"`: $MESSAGE" --as-stdout-line + else + cli_printMessage "`gettext "Creating"`: $MESSAGE" --as-stdout-line + fi + ;; + + --as-deleting-line ) + cli_printMessage "`gettext "Deleting"`: $MESSAGE" --as-stdout-line + ;; + + --as-reading-line ) + cli_printMessage "`gettext "Reading"`: $MESSAGE" --as-stdout-line + ;; + + --as-savedas-line ) + cli_printMessage "`gettext "Saved as"`: $MESSAGE" --as-stdout-line + ;; + + --as-linkto-line ) + cli_printMessage "`gettext "Linked to"`: $MESSAGE" --as-stdout-line + ;; + + --as-movedto-line ) + cli_printMessage "`gettext "Moved to"`: $MESSAGE" --as-stdout-line + ;; + + --as-translation-line ) + cli_printMessage "`gettext "Translation"`: $MESSAGE" --as-stdout-line + ;; + + --as-translating-line ) + cli_printMessage "`gettext "Translating"`: $MESSAGE" --as-stdout-line + ;; + + --as-validating-line ) + cli_printMessage "`gettext "Validating"`: $MESSAGE" --as-stdout-line + ;; + + --as-template-line ) + cli_printMessage "`gettext "Template"`: $MESSAGE" --as-stdout-line + ;; + + --as-configuration-line ) + cli_printMessage "`gettext "Configuration"`: $MESSAGE" --as-stdout-line + ;; + + --as-palette-line ) + cli_printMessage "`gettext "Palette"`: $MESSAGE" --as-stdout-line + ;; + + --as-inkscape-line ) + cli_printMessage "$MESSAGE" --as-stdout-line + ;; + + esac + +} diff --git a/Automation/centos-art.sh-mods/Commons/cli_printUrl.sh b/Automation/centos-art.sh-mods/Commons/cli_printUrl.sh new file mode 100755 index 0000000..2a6ce80 --- /dev/null +++ b/Automation/centos-art.sh-mods/Commons/cli_printUrl.sh @@ -0,0 +1,149 @@ +#!/bin/bash +# +# cli_printUrl.sh -- This function standardizes the way URLs are +# printed by centos-art.sh script. This function describes the +# domain organization of The CentOS Project through its URLs and +# provides a way to print them out when needed. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function cli_printUrl { + + local URL='' + + # Define short options. + local ARGSS='' + + # Define long options. + local ARGSL='domain,home,lists,wiki,forums,bugs,planet,docs,mirrors,projects,svn,trac,irc,cc-sharealike,with-locale,as-html-link' + + # Initialize arguments with an empty value and set it as local + # variable to this function scope. Doing this is very important to + # avoid any clash with higher execution environments. + local ARGUMENTS='' + + # Prepare ARGUMENTS for getopt. + cli_parseArgumentsReDef "$@" + + # Redefine ARGUMENTS using getopt(1) command parser. + cli_parseArguments + + # Redefine positional parameters using ARGUMENTS variable. + eval set -- "$ARGUMENTS" + + # Look for options passed through command-line. + while true; do + case "$1" in + + --domain ) + URL="${TCAR_BRAND}.org" + shift 1 + ;; + + --home ) + URL="http://www.$(cli_printUrl --domain)/" + shift 1 + ;; + + --lists ) + URL="http://lists.$(cli_printUrl --domain)/" + shift 1 + ;; + + --wiki ) + URL="http://wiki.$(cli_printUrl --domain)/" + shift 1 + ;; + + --forums ) + URL="http://forums.$(cli_printUrl --domain)/" + shift 1 + ;; + + --bugs ) + URL="http://bugs.$(cli_printUrl --domain)/" + shift 1 + ;; + + --projects ) + URL="https://projects.$(cli_printUrl --domain)/" + shift 1 + ;; + + --svn ) + URL="$(cli_printUrl --projects)svn/" + shift 1 + ;; + + --trac ) + URL="$(cli_printUrl --projects)trac/" + shift 1 + ;; + + --planet ) + URL="http://planet.$(cli_printUrl --domain)/" + shift 1 + ;; + + --docs ) + URL="http://docs.$(cli_printUrl --domain)/" + shift 1 + ;; + + --mirrors ) + URL="http://mirrors.$(cli_printUrl --domain)/" + shift 1 + ;; + + --irc ) + URL="http://$(cli_printUrl --home)modules/tinycontent/index.php?id=8" + shift 1 + ;; + + --cc-sharealike ) + URL="http://creativecommons.org/licenses/by-sa/3.0/" + shift 1 + ;; + + --with-locale ) + if [[ ! ${LANG} =~ '^en' ]];then + URL="${URL}${CLI_LANG_LL}/" + fi + shift 1 + ;; + + --as-html-link ) + URL="${URL}" + shift 1 + ;; + + -- ) + + shift 1 + break + ;; + esac + done + + # Print Url. + echo "$URL" + +} diff --git a/Automation/centos-art.sh-mods/Commons/cli_runFnEnvironment.sh b/Automation/centos-art.sh-mods/Commons/cli_runFnEnvironment.sh new file mode 100755 index 0000000..5b9641d --- /dev/null +++ b/Automation/centos-art.sh-mods/Commons/cli_runFnEnvironment.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# +# cli_runFnEnvironment.sh -- This function standardizes the way +# centos-art.sh script is called to itself. The main purpose of this +# somehow own interface is to control the parent script flow based on +# specific function environments exit status. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function cli_runFnEnvironment { + + # Execute specific function environment. + ${CLI_NAME} $@ + + # Retrieve exit status. + local STATUS=$? + + # Finish script execution based on exit status. + if [[ ${STATUS} -ne 0 ]];then + exit ${STATUS} + fi + +} diff --git a/Automation/centos-art.sh-mods/Commons/cli_synchronizeRepoChanges.sh b/Automation/centos-art.sh-mods/Commons/cli_synchronizeRepoChanges.sh new file mode 100755 index 0000000..5bfb877 --- /dev/null +++ b/Automation/centos-art.sh-mods/Commons/cli_synchronizeRepoChanges.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# +# cli_synchronizeRepoChanges.sh -- This function standardizes the way +# changes are synchronized between the working copy and the central +# repository. This function is an interface to the Svn functionality +# of the centos-art.sh script. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function cli_synchronizeRepoChanges { + + # Verify synchronization flag. + if [[ ! $FLAG_SYNCHRONIZE == 'true' ]];then + return + fi + + # Verify existence of locations passed to this function. + cli_checkFiles -e $@ + + # Synchronize changes. + cli_runFnEnvironment vcs --synchronize $@ + +} diff --git a/Automation/centos-art.sh-mods/Commons/cli_terminateScriptExecution.sh b/Automation/centos-art.sh-mods/Commons/cli_terminateScriptExecution.sh new file mode 100755 index 0000000..cf855ed --- /dev/null +++ b/Automation/centos-art.sh-mods/Commons/cli_terminateScriptExecution.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# +# cli_terminateScriptExecution.sh -- This function standardizes the +# actions that must be realized just before leaving the script +# execution (e.g., cleaning temporal files). This function is the one +# called when interruption signals like EXIT, SIGHUP, SIGINT and +# SIGTERM are detected. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function cli_terminateScriptExecution { + + # Remove temporal directory. + rm -r ${TMPDIR} + + # NOTE: Don't specify an exit status here. As convenction we do + # this when error messages are triggerd. See `--as-error-line' + # option from `cli_printMessage' functionality. + +} diff --git a/Automation/centos-art.sh-mods/Commons/cli_unsetFunctions.sh b/Automation/centos-art.sh-mods/Commons/cli_unsetFunctions.sh new file mode 100755 index 0000000..8a31dff --- /dev/null +++ b/Automation/centos-art.sh-mods/Commons/cli_unsetFunctions.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# +# cli_unsetFunctions.sh -- This function unsets functionalities from +# `centos-art.sh' script execution environment. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function cli_unsetFunctions { + + # Define export id used to retrive function files. This is the + # same export id used to export functions without the directory + # part. + local EXPORTID=$(basename "$1") + + # Verify suffix value used to retrive function files. Assuming no + # suffix value is passed as second argument to this function, use + # the function name value (CLI_FUNCNAME) as default value. + if [[ $EXPORTID == '' ]];then + cli_printMessage "`gettext "The export id was not provided."`" --as-error-line + fi + + # Define list of format-specific functionalities. This is the + # list of function definitions previously exported by + # `cli_exportFunctions'. Be sure to limit the list to function + # names that start with the suffix specified only. + local FUNCDEF='' + local FUNCDEFS=$(declare -F | gawk '{ print $3 }' | egrep "^${EXPORTID}") + + # Unset function names from current execution environment. + for FUNCDEF in $FUNCDEFS;do + unset -f $FUNCDEF + done + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo.sh new file mode 100755 index 0000000..8e5951f --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo.sh @@ -0,0 +1,136 @@ +#!/bin/bash +# +# texinfo.sh -- This function initializes Texinfo documentation format +# used by `centos-art.sh' script to produce and maintain documentation +# manuals written in Texinfo format, inside the working copy of The +# CentOS Artwork Repository. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo { + + # Verify documentation entry to be sure it coincides with + # Texinfo's supported structuring (e.g., texinfo-4.8 doesn't + # support structuring through parts, but chapters and sections + # only). + if [[ $MANUAL_PART_NAME != '' ]];then + cli_printMessage "`gettext "The documentation entry provided isn't supported."`" --as-error-line + fi + + # Verify documentation format based on file type. + if [[ -f ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} ]];then + cli_checkFiles -i "text/x-texinfo" ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} + fi + + # Define absolute path to template directory. This is the place + # where we store locale directories (e.g., en_US, es_ES, etc.) + # used to build manuals in texinfo format. + MANUAL_TEMPLATE=${MANUAL_TLDIR}/$(cli_getRepoName ${FLAG_FORMAT} -d)/Default + + # Define absolute path to language-specific template directory. + # This is the place where we store locale-specific files used to + # build manuals in texinfo format. + MANUAL_TEMPLATE_L10N=${MANUAL_TEMPLATE}/${MANUAL_L10N} + + # Verify absolute path to language-specific template directory. + # If it doesn't exist, use English language as default location to + # retrieve template files. + if [[ ! -d $MANUAL_TEMPLATE_L10N ]];then + MANUAL_TEMPLATE_L10N=${MANUAL_TEMPLATE}/en_US + fi + + # Initialize document structure for new manuals. + texinfo_createStructure + + # Define documentation entry default values. To build the + # documentation entry, we combine the manual's name, part, chapter + # and section information retrieved from the command-line. + if [[ $MANUAL_CHAPTER_NAME == '' ]];then + + # When chapter option is not provided, discard the section + # name and define documentation entry based on manual's main + # definition file. + MANUAL_ENTRY="${MANUAL_BASEFILE}.${MANUAL_EXTENSION}" + + elif [[ $MANUAL_CHAPTER_NAME != '' ]] && [[ $MANUAL_SECTION_NAME == '' ]];then + + # When chapter option is provided without a section name, + # verify chapter's directory inside the manual, + texinfo_createChapter + + # and define documentation entry based on chapter's main + # definition file. + MANUAL_ENTRY="${MANUAL_BASEDIR_L10N}/${MANUAL_CHAPTER_NAME}.${MANUAL_EXTENSION}" + + elif [[ $MANUAL_CHAPTER_NAME != '' ]] && [[ $MANUAL_SECTION_NAME != '' ]];then + + # When both the chapter option and non-option arguments are + # provided, define documentation entries based on manual, + # chapter and non-option arguments. + MANUAL_ENTRY="$(texinfo_getEntry "$MANUAL_SECTION_NAME")" + + else + cli_printMessage "`gettext "The parameters you provided are not supported."`" --as-error-line + fi + + # Execute action names. Notice that we've separated execution of + # action names in order to control and save differences among + # them. + if [[ $ACTIONNAM == "" ]];then + + # When no action name is provided to `centos-art.sh' script, + # read manual's info output in order to provide a way for + # people to get oriented about The CentOS Artwork Repository + # and its automation too. Be sure the manual and its info + # output file do exist. Later, once the reading is done, + # terminate the script execution. + + # Update manual's output files. + texinfo_updateOutputFiles + + # Read manual's Top node from its info output file. + info --node="Top" --file="${MANUAL_OUTPUT_BASEFILE}.info.bz2" + + elif [[ $ACTIONNAM =~ "^(copy|rename|delete)Entry$" ]];then + + # Both `--copy' and `--rename' actions interpret non-option + # arguments passed to `centos-art.sh' script in a special way. + # In this configuration, only two non-option arguments are + # processed in the first loop of their interpretation. + texinfo_${ACTIONNAM} + + # Rebuild output files to propagate recent changes, if any. + texinfo_updateOutputFiles + + # Break interpretation of non-option arguments to prevent the + # second and further non-option arguments from being + # considered as source location. + break + + else + + # Execute action names as part of normal help command's + # execution flow, without any extra modification. + texinfo_${ACTIONNAM} + + fi + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_checkEntrySrcDst.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_checkEntrySrcDst.sh new file mode 100755 index 0000000..3bb829d --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_checkEntrySrcDst.sh @@ -0,0 +1,66 @@ +#!/bin/bash +# +# texinfo_checkEntrySrcDst.sh -- This function standardizes +# verification actions of source and target locations for tasks like +# copying and renaming. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_checkEntrySrcDst { + + # Initialize entry source absolute path. + local MANUAL_ENTRY_SRC="$1" + + # Initialize entry target absolute path. + local MANUAL_ENTRY_DST="$2" + + # Verify existence of source location. + if [[ ! -a ${MANUAL_ENTRY_SRC} ]];then + cli_printMessage "`gettext "The source location doesn't exist."`" --as-error-line + fi + + # Verify source and target locations to be sure they are different + # one another. We cannot copy a source location to itself. + if [[ $MANUAL_ENTRY_SRC == $MANUAL_ENTRY_DST ]];then + cli_printMessage "`gettext "The source and target locations cannot be the same."`" --as-error-line + fi + + # Verify source location to be sure it is under version control + # and there isn't pending change to be committed first. + cli_checkFiles ${MANUAL_ENTRY_SRC} --is-versioned + if [[ $(cli_runFnEnvironment vcs --status ${MANUAL_ENTRY_SRC}) != '' ]];then + cli_printMessage "`gettext "The source location has pending changes."`" --as-error-line + fi + + # Verify target directory where the source will be duplicated in. + # The target directory must exist before copying the source + # location into it. If it doesn't exist, use subversion to create + # it it. + if [[ ! -d $(dirname ${MANUAL_ENTRY_DST}) ]];then + cli_runFnEnvironment vcs --mkdir $(dirname ${MANUAL_ENTRY_DST}) + fi + + # Verify existence of target location. + if [[ -a ${MANUAL_ENTRY_DST} ]];then + cli_printMessage "`gettext "The target location already exists."`" --as-error-line + fi + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_copyEntry.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_copyEntry.sh new file mode 100755 index 0000000..8bedf1e --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_copyEntry.sh @@ -0,0 +1,73 @@ +#!/bin/bash +# +# texinfo_copyEntry.sh -- This function standardizes the duplication +# actions related to manuals written in texinfo format. This function +# duplicates manuals, chapters inside manuals, and sections inside +# chapters. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_copyEntry { + + # Initialize source and target locations. + local MANUAL_ENTRY_SRC='' + local MANUAL_ENTRY_DST='' + + # Execute copying action based on documentation entries passed as + # non-option arguments to `centos-art.sh' script in the + # command-line. + if [[ ${MANUAL_SECT[${MANUAL_DOCENTRY_ID}]} != '' ]];then + + # In this configuration, the section name is specified in + # first non-option argument and optionally in the second + # non-option argument. + texinfo_copyEntrySection + + elif [[ ${MANUAL_CHAP[${MANUAL_DOCENTRY_ID}]} != '' ]] \ + && [[ ${MANUAL_CHAP[((${MANUAL_DOCENTRY_ID} + 1))]} != '' ]];then + + # In this configuration, the section name wasn't specified + # neither in first or second non-option argument. So, we + # perform a copying action for the chapter directory itself. + # In this configuration, the whole chapter directory and all + # the content inside are duplicated from source to target. + texinfo_copyEntryChapter + + elif [[ ${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]} != '' ]] \ + && [[ ${MANUAL_DIRN[((${MANUAL_DOCENTRY_ID} + 1))]} != '' ]];then + + # In this configuration, the chapter name wasn't specified + # neither in first or second non-option argument. So, we + # perform copying actions on manual directory itself. Notice + # that, in this configuration, the whole manual is duplicated. + texinfo_copyEntryManual + + # In this configuration, there is no need to update section + # menus, nodes and cross references. The section definition + # files were copied from the source manual with any change so + # the manual should build without any problem. Be sure such + # verification will never happen. + + else + cli_printMessage "`gettext "The parameters you provided are not supported."`" --as-error-line + fi + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_copyEntryChapter.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_copyEntryChapter.sh new file mode 100755 index 0000000..191be20 --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_copyEntryChapter.sh @@ -0,0 +1,75 @@ +#!/bin/bash +# +# texinfo_copyEntryChapter.sh -- This function standardizes chapter +# duplication inside manuals written in texinfo format. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_copyEntryChapter { + + # Redefine documentation entry source's location. + MANUAL_ENTRY_SRC=${MANUAL_BASEDIR_L10N}/${MANUAL_CHAP[${MANUAL_DOCENTRY_ID}]} + + # Redefine documentation entry target's location. + MANUAL_ENTRY_DST=${MANUAL_BASEDIR_L10N}/${MANUAL_CHAP[((${MANUAL_DOCENTRY_ID} + 1))]} + + # Verify entry source and target locations. + texinfo_checkEntrySrcDst "${MANUAL_ENTRY_SRC}" "${MANUAL_ENTRY_DST}" + + # When we are copying chapters, document structure actualization + # needs to be performed against the target chapter not the source + # one used to create the duplication. To achieve this goal, + # define both chapter's directory and chapter's name at this + # point. + local MANUAL_CHAPTER_DIR=$MANUAL_ENTRY_DST + local MANUAL_CHAPTER_NAME=${MANUAL_CHAP[((${MANUAL_DOCENTRY_ID} + 1))]} + + # When we are copying chapters, the chapter itself cannot be + # copied as we regularly do with sections. Instead, the target + # chapter must be created as a new chapter and then sections from + # source chapter must be copied one by one to the recently created + # chapter. At this point then, is when menu, nodes and cross + # references for the new chapter are updated. + texinfo_createChapter + + # Create list of sections from source chapter that need to be + # copied to target chapter. Don't include chapter's main + # definition files. + local MANUAL_ENTRIES=$(cli_getFilesList $MANUAL_ENTRY_SRC \ + --pattern="^.+\.${MANUAL_EXTENSION}$" | egrep -v '/chapter') + + for MANUAL_ENTRY in $MANUAL_ENTRIES;do + + # Copy sections from source chapter to target chapter. + cli_runFnEnvironment vcs --copy $MANUAL_ENTRY $MANUAL_ENTRY_DST + + # Update section menu, nodes and cross reference definitions + # to all sections inside the documentation manual. + texinfo_updateStructureSection "${MANUAL_ENTRY_DST}/$(basename ${MANUAL_ENTRY})" + + done + + # Update chapter menu and node definitions inside the manual + # structure. + texinfo_updateChapterMenu + texinfo_updateChapterNodes + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_copyEntryManual.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_copyEntryManual.sh new file mode 100755 index 0000000..423b4b9 --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_copyEntryManual.sh @@ -0,0 +1,75 @@ +#!/bin/bash +# +# texinfo_copyEntryChapter.sh -- This function standardizes +# duplication of manuals written in texinfo format. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_copyEntryManual { + + # Define list of chapters inside source manual excluding those + # created from template, rendition output and subversion. + local MANUAL_CHAPTER='' + local MANUAL_CHAPTERS=$(cli_getFilesList ${MANUAL_BASEDIR_L10N} \ + --maxdepth=1 --mindepth=1 --type="d" --pattern='^.+$' \ + | egrep -v "(Licenses|\.svn)") + + # Redefine manual name using manual name passed to `centos-art.sh' + # script as second non-option argument. + local MANUAL_NAME=${MANUAL_SLFN[((${MANUAL_DOCENTRY_ID} + 1))]} + + # Redefine absolute path to manual directory using manual name + # passed to `centos-art.sh' script as second non-option argument. + local MANUAL_BASEDIR="$(echo $MANUAL_BASEDIR \ + | sed -r "s!${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]}!${MANUAL_DIRN[((${MANUAL_DOCENTRY_ID} + 1))]}!")" + + # Redefine absolute path to manual directory using manual name + # passed to `centos-art.sh' script as second non-option argument. + local MANUAL_BASEDIR_L10N="${MANUAL_BASEDIR}/${MANUAL_L10N}" + + # Redefine absolute path to base file using manual name passed to + # `centos-art.sh' script as second non-option argument. + local MANUAL_BASEFILE="${MANUAL_BASEDIR_L10N}/${MANUAL_NAME}" + + # Create manual structure + texinfo_createStructure + + # Loop through list of chapters. + for MANUAL_CHAPTER in ${MANUAL_CHAPTERS};do + + # Print action name. + cli_printMessage "${MANUAL_BASEDIR_L10N}" --as-creating-line + + # Copy chapter directory from source to target using + # subversion. + cli_runFnEnvironment vcs --copy ${MANUAL_CHAPTER} ${MANUAL_BASEDIR_L10N} + + # Define manual chapter name. + local MANUAL_CHAPTER_NAME=$(basename ${MANUAL_CHAPTER}) + + # Update chapter information inside the manual's texinfo + # structure. + texinfo_updateChapterMenu + texinfo_updateChapterNodes + + done + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_copyEntrySection.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_copyEntrySection.sh new file mode 100755 index 0000000..1698dcc --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_copyEntrySection.sh @@ -0,0 +1,82 @@ +#!/bin/bash +# +# texinfo_copyEntrySection.sh -- This function standardizes section +# duplication inside manuals written in texinfo format. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_copyEntrySection { + + # Define absolute path to section source and target locations + # based on non-option arguments passed to `centos-art.sh' script. + if [[ ${MANUAL_SECT[((${MANUAL_DOCENTRY_ID} + 1))]} != '' ]];then + + # When the section name is specified in first and second + # non-option arguments, source and target are set as specified + # in first and second non-option arguments respectively. + MANUAL_ENTRY_SRC=$(texinfo_getEntry ${MANUAL_SECT[${MANUAL_DOCENTRY_ID}]}) + MANUAL_ENTRY_DST=$(texinfo_getEntry ${MANUAL_SECT[((${MANUAL_DOCENTRY_ID} + 1))]}) + + elif [[ ${MANUAL_SECT[((${MANUAL_DOCENTRY_ID} + 1))]} == '' ]] \ + && [[ ${MANUAL_CHAP[((${MANUAL_DOCENTRY_ID} + 1))]} != '' ]];then + + # When the section name is specified only in the first + # non-option argument and the chapter name has been provided + # in the second non-option argument, use the section name + # passed in first argument to build the section name that will + # be used as target. + MANUAL_ENTRY_SRC=$(texinfo_getEntry ${MANUAL_SECT[${MANUAL_DOCENTRY_ID}]}) + MANUAL_ENTRY_DST=$(echo $MANUAL_ENTRY_SRC \ + | sed -r "s!${MANUAL_CHAP[${MANUAL_DOCENTRY_ID}]}!${MANUAL_CHAP[((${MANUAL_DOCENTRY_ID} + 1))]}!") + + else + cli_printMessage "`gettext "The location provided as target isn't valid."`" --as-error-line + fi + + # Print separator line along with action message. + cli_printMessage '-' --as-separator-line + cli_printMessage "${MANUAL_ENTRY_DST}" --as-creating-line + + # Verify entry source and target locations. + texinfo_checkEntrySrcDst "${MANUAL_ENTRY_SRC}" "${MANUAL_ENTRY_DST}" + + # Copy section entry from source to target using subversion. + cli_runFnEnvironment vcs --quiet --copy "${MANUAL_ENTRY_SRC}" "${MANUAL_ENTRY_DST}" + + # Redefine chapter name using chapter name passed to + # `centos-art.sh' script as second non-option argument. + local MANUAL_CHAPTER_NAME=${MANUAL_CHAP[((${MANUAL_DOCENTRY_ID} + 1))]} + + # Redefine chapter directory to use the chapter provided to + # `centos-art.sh' script as second non-option argument. This is + # required in order to update the `chapter-menu.texinfo' file + # inside the target chapter where section entry was copied to, not + # the source chapter where the section entry was taken from. This + # is particularly useful section entries are copied from one + # chapter into another different. + local MANUAL_CHAPTER_DIR=$(dirname ${MANUAL_ENTRY_DST}) + + # At this point, all copying actions and chapter related + # redefinitions have took place. It is time, then, to update the + # document structure using the information collected so far. + texinfo_updateStructureSection "${MANUAL_ENTRY_DST}" + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_createChapter.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_createChapter.sh new file mode 100755 index 0000000..66cb08e --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_createChapter.sh @@ -0,0 +1,120 @@ +#!/bin/bash +# +# texinfo_createChapter.sh -- This function standardizes chapter +# creation insdie the manual structure. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_createChapter { + + # Verify chapter directory inside the manual structure. The + # chapter directory is where chapter-specific information (e.g., + # chapter definition files and sections) are stored in. If this + # directory already exist, assume it was created correctly in the + # past. Otherwise, request confirmation for creating it. + if [[ -d $MANUAL_CHAPTER_DIR ]];then + return + else + cli_printMessage "`gettext "The following documentation chapter doesn't exist:"`" --as-stdout-line + cli_printMessage "${MANUAL_CHAPTER_DIR}.${MANUAL_EXTENSION}" --as-response-line + cli_printMessage "`gettext "Do you want to create it now?"`" --as-yesornorequest-line + fi + + # Initialize chapter node, chapter index and chapter title. + local MANUAL_CHAPTER_NODE='' + local MANUAL_CHAPTER_TITLE='' + local MANUAL_CHAPTER_CIND='' + + # Request the user to enter a chapter title. + cli_printMessage "`gettext "Enter chapter's title"`" --as-request-line + read MANUAL_CHAPTER_TITLE + + # Sanitate chapter node, chapter index and chapter title. + MANUAL_CHAPTER_NODE=$(texinfo_getEntryNode "$MANUAL_CHAPTER_NAME") + MANUAL_CHAPTER_CIND=$(texinfo_getEntryIndex "$MANUAL_CHAPTER_TITLE") + MANUAL_CHAPTER_TITLE=$(texinfo_getEntryTitle "$MANUAL_CHAPTER_TITLE") + + # Define list of template files used to build the chapter main + # definition files. + local FILE='' + local FILES=$(cli_getFilesList "${MANUAL_TEMPLATE_L10N}" \ + --maxdepth='1' \ + --pattern="^.+/Chapters(-menu|-nodes)?\.${MANUAL_EXTENSION}$") + + # Create chapter directory using version control. This is the + # place where all chapter-specific files will be stored in. + if [[ ! -d ${MANUAL_CHAPTER_DIR} ]];then + cli_printMessage "${MANUAL_CHAPTER_DIR}" --as-creating-line + cli_runFnEnvironment vcs --quiet --mkdir ${MANUAL_CHAPTER_DIR} + fi + + # Create chapter-specific files using template files as reference. + for FILE in $FILES;do + + # Verify texinfo templates used as based to build the chapter + # structure. Be sure they are inside the working copy of The + # CentOS Artwork Repository (-w) and under version control + # (-n), too. + cli_checkFiles ${FILE} + + # Redefine the chapter file using the correct name. + local MANUAL_CHAPTER_FILE=${MANUAL_CHAPTER_DIR}$(basename ${FILE} \ + | sed -r 's,Chapters,,') + + # Print action name. + cli_printMessage "${MANUAL_CHAPTER_FILE}" --as-creating-line + + # Copy template files into the chapter directory. + cli_runFnEnvironment vcs --quiet --copy ${FILE} ${MANUAL_CHAPTER_FILE} + + done + + # Before expanding chapter information, be sure the slash (/) + # character be escaped. Otherwise, if the slashes aren't scape, + # they will be interpreted as sed's separator and might provoke + # sed to complain. + MANUAL_CHAPTER_NODE=$(echo "$MANUAL_CHAPTER_NODE" | sed -r 's/\//\\\//g') + MANUAL_CHAPTER_CIND=$(echo "$MANUAL_CHAPTER_CIND" | sed -r 's/\//\\\//g') + MANUAL_CHAPTER_TITLE=$(echo "$MANUAL_CHAPTER_TITLE" | sed -r 's/\//\\\//g') + MANUAL_CHAPTER_NAME=$(echo "$MANUAL_CHAPTER_NAME" | sed -r 's/\//\\\//g') + + # Expand translation markers inside chapter main definition file. + sed -i -r \ + -e "s/=CHAPTER_NODE=/${MANUAL_CHAPTER_NODE}/" \ + -e "s/=CHAPTER_TITLE=/${MANUAL_CHAPTER_TITLE}/" \ + -e "s/=CHAPTER_CIND=/${MANUAL_CHAPTER_CIND}/" \ + -e "s/=CHAPTER_NAME=/${MANUAL_CHAPTER_NAME}/" \ + ${MANUAL_CHAPTER_DIR}.${MANUAL_EXTENSION} + + # Remove content from `chapter-nodes.texinfo' file to start with a + # clean node structure. This file is also used to create new + # documentation entries, but we don't need that information right + # now (when the chapter structure is created), just an empty copy + # of the file. The node structure of chapter is created + # automatically based on action value. + echo "" > ${MANUAL_CHAPTER_DIR}-nodes.${MANUAL_EXTENSION} + + # Update chapter information inside the manual's texinfo + # structure. + texinfo_updateChapterMenu + texinfo_updateChapterNodes + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_createStructure.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_createStructure.sh new file mode 100755 index 0000000..6338aa3 --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_createStructure.sh @@ -0,0 +1,118 @@ +#!/bin/bash +# +# texinfo_createStructure.sh -- This function creates the +# documentation structure of a manual using the current language as +# reference. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_createStructure { + + # Verify manual main definition file. If it already exist, assume + # it was correctly created in the past. Otherwise try to create + # it. Don't use the manual base directory here, it would prevent + # documentation manuals from being created on different languages. + if [[ -f ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} ]];then + return + else + cli_printMessage "`eval_gettext "The following documentation manual doesn't exist:"`" --as-stdout-line + cli_printMessage "${MANUAL_BASEFILE}.${MANUAL_EXTENSION}" --as-response-line + cli_printMessage "`gettext "Do you want to create it now?"`" --as-yesornorequest-line + fi + + # Initialize manual's information (e.g., title, subtitle, abstract). + local MANUAL_TITLE='' + local MANUAL_SUBTITLE='' + local MANUAL_ABSTRACT='' + + # Retrieve manual's information from standard input. + cli_printMessage "`gettext "Enter manual's title"`" --as-request-line + read MANUAL_TITLE + cli_printMessage "`gettext "Enter manual's subtitle"`" --as-request-line + read MANUAL_SUBTITLE + cli_printMessage "`gettext "Enter manual's abstract"`" --as-request-line + read MANUAL_ABSTRACT + + # Verify manual's information. The title information must be + # non-empty value. + if [[ $MANUAL_TITLE == '' ]];then + cli_printMessage "`gettext "The manual title cannot be empty."`" --as-error-line + fi + + # Create manual's top-level directory using default version + # control system. This is the place where all texinfo + # documentation manuals are stored in. + if [[ ! -d ${MANUAL_BASEDIR} ]];then + cli_printMessage "${MANUAL_BASEDIR}" --as-creating-line + cli_runFnEnvironment vcs --quiet --mkdir ${MANUAL_BASEDIR} + fi + + # Create manual's base directory. This is the place where + # language-specific documentation source files are stored in. + cli_printMessage "${MANUAL_BASEDIR_L10N}" --as-creating-line + cli_runFnEnvironment vcs --quiet --mkdir ${MANUAL_BASEDIR_L10N} + + # Define file names required to build the manual. + local FILE='' + local FILES=$(cli_getFilesList "${MANUAL_TEMPLATE_L10N}" \ + --maxdepth='1' \ + --pattern="^.+/manual((-menu|-nodes|-index)?\.${MANUAL_EXTENSION}|\.conf)$") + + # Verify manual base file. The manual base file is where the + # documentation manual is defined in the format format. Assuming + # no file exists (e.g., a new language-specific manual is being + # created), use texinfo templates for it. + for FILE in $FILES;do + if [[ ! -f ${MANUAL_BASEDIR_L10N}/$(basename ${FILE}) ]];then + + # Be sure the file is inside the working copy and under + # version control. + cli_checkFiles ${FILE} --is-versioned + + # Define target file. + local DST=${MANUAL_BASEDIR_L10N}/$(basename ${FILE} \ + | sed -r "s!manual!${MANUAL_NAME}!") + + # Print action name. + cli_printMessage "${DST}" --as-creating-line + + # Copy using subversion to register this action. + cli_runFnEnvironment vcs --quiet --copy ${FILE} ${DST} + + # Expand common translation markers inside target file. + cli_expandTMarkers ${DST} + + # Expand specific translation markers inside target file. + sed -r -i -e "s!=MANUAL_NAME=!${MANUAL_NAME}!g" \ + -e "s!=MANUAL_TITLE=!${MANUAL_TITLE}!g" \ + -e "s!=MANUAL_SUBTITLE=!${MANUAL_SUBTITLE}!g" \ + -e "s!=MANUAL_ABSTRACT=!${MANUAL_ABSTRACT}!g" $DST + + fi + done + + # Initialize chapter structure inside the manual. + texinfo_createStructureChapters + + # Redefine absolute path to changed directory. + MANUAL_CHANGED_DIRS=${MANUAL_BASEDIR} + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_createStructureChapters.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_createStructureChapters.sh new file mode 100755 index 0000000..8356255 --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_createStructureChapters.sh @@ -0,0 +1,73 @@ +#!/bin/bash +# +# texinfo_createStructureChapters.sh -- This function initiates the +# chapter documentation structure of a manual, using the current +# language and template files as reference. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_createStructureChapters { + + local MANUAL_CHAPTER_DIR='' + + # Define list of chapter templates files used to build the + # documentation manual. Do not include the `Chapters' and + # `Licenses' directory here. The Chapters directory is used to + # build chapters based on value of `--chapter' option passed + # through the command-line. The `Licenses' directory is linked + # from its default template directory. + local FILE='' + local FILES=$(cli_getFilesList ${MANUAL_TEMPLATE_L10N} \ + --pattern="^.+/Chapters(-menu|-nodes)?\.${MANUAL_EXTENSION}$" --mindepth='1' \ + | egrep -v '/(Chapters|Licenses)/') + + # Loop through chapter structures and create them inside the + # manual. + for FILE in $FILES;do + + # Redefine manual's chapter directory based on template files. + MANUAL_CHAPTER_DIR=${MANUAL_BASEDIR_L10N}/$(basename $(dirname ${FILE})) + + # Verify texinfo templates used as based to build the chapter. + # Be sure they are inside the working copy of CentOS Artwork + # Repository and under version control, too. + cli_checkFiles ${FILE} --is-versioned + + # Print action name. + cli_printMessage "${MANUAL_CHAPTER_DIR}/$(basename ${FILE})" --as-creating-line + + # Verify chapter's directory. If it doesn't exist, create it. + if [[ ! -d ${MANUAL_CHAPTER_DIR} ]];then + cli_runFnEnvironment vcs --quiet --mkdir ${MANUAL_CHAPTER_DIR} + fi + + # Copy template files into chapter's directory. + cli_runFnEnvironment vcs --quiet --copy ${FILE} ${MANUAL_CHAPTER_DIR} + + done + + # Create link to `Licenses' default template directory. There + # isn't a need to duplicate this information. In fact it is + # important not to have it duplicated so we can centralize such + # information for all documentation manuals. + texinfo_updateLicenseLink + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_deleteCrossReferences.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_deleteCrossReferences.sh new file mode 100755 index 0000000..0793e56 --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_deleteCrossReferences.sh @@ -0,0 +1,86 @@ +#!/bin/bash +# +# texinfo_deleteCrossReferences.sh -- This function looks inside +# texinfo source files, from section level on, and removes all cross +# reference definitions related to a documentation entry. Use this +# function in coordination with texinfo_deleteEntry function, in order +# to keep cross reference information, inside the documentation +# manual, synchronized. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_deleteCrossReferences { + + local -a PATTERN + local -a REPLACE + + # Define documentation entry. + local MANUAL_ENTRY="$1" + + # Verify documentation entry. If documentation entry is empty, + # stop script execution with an error message. + if [[ $MANUAL_ENTRY == '' ]];then + cli_printMessage "`gettext "The first positional parameter cannot be empty."`" --as-error-line + fi + + # Build the node string using entry location. + local NODE="$(texinfo_getEntryNode "$MANUAL_ENTRY")" + + # Define regular expression patterns for texinfo cross reference + # commands. + PATTERN[0]="@(pxref|xref|ref)\{(${NODE})\}" + REPLACE[0]='--- @strong{'`gettext "Removed"`'}(\1:\2) ---' + + # Define replacement string for missing entries. It is convenient + # to keep missing entries in documentation for documentation team + # to know. Removing the missing cross reference may introduce + # confusion. Imagine that you are spending lots of hours in an + # article and suddenly one of your cross references disappears + # with no visible reason, with the next working copy update you + # perform. That's frustrating. Instead, when centos-art.sh script + # finds a missing cross reference it removes the link and remark + # the issue for you to act on it. + PATTERN[1]="^(\* ${NODE}:(.*):(.*))$" + REPLACE[1]='\@comment --- '`gettext "Removed"`'(\1) ---' + + # Define list of entries to process. + local MANUAL_ENTRIES=$(cli_getFilesList ${MANUAL_BASEDIR_L10N} \ + --pattern="^.+\.${MANUAL_EXTENSION}$" \ + | egrep -v "(${MANUAL_NAME}|chapter)-(menu|nodes|index)") + + # Update node-related cross references. The node-related cross + # reference definition, long ones specially, could require more + # than one line to be set. By default, GNU sed does not matches + # newline characters in the pattern space, so we need to make use + # of `label' feature and the `N' command in order to build a + # pattern space that includes the newline character in it. Here we + # use the `a' letter to name the label we use, followed by N + # command to add a newline to the pattern space, the s command to + # make the pattern replacement using the `g' flag to make it + # global and finally the command `b' to branch label named `a'. + sed -r -i ":a;N;s!${PATTERN[0]}!${REPLACE[0]}!g;ba" ${MANUAL_ENTRIES} + + # Update menu-related cross references. Menu-related cross + # references hardly appear in more than one line, so there is no + # need to complicate much the replacement command. + sed -r -i "s!${PATTERN[1]}!${REPLACE[1]}!" ${MANUAL_ENTRIES} + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_deleteEntry.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_deleteEntry.sh new file mode 100755 index 0000000..b700804 --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_deleteEntry.sh @@ -0,0 +1,67 @@ +#!/bin/bash +# +# texinfo_deleteEntry.sh -- This function removes a documentation +# manuals, chapters or sections from the working copy. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_deleteEntry { + + # Remove manual, chapter or section based on documentation entry + # provided as non-option argument to `centos-art.sh' script. + if [[ ${MANUAL_SECT[$MANUAL_DOCENTRY_ID]} != '' ]];then + + # When a section is deleted, documentation entry points to a + # section name. In this configuration, documentation entry is + # deleted through subversion in order to register the change. + # Once the documentation entry is deleted, the section menu + # and nodes definition files are updated to keep manual in a + # consistent state. + texinfo_deleteEntrySection + + elif [[ ${MANUAL_CHAP[$MANUAL_DOCENTRY_ID]} != '' ]];then + + # When a chapter is deleted, documentation entry doesn't point + # to a section name but a chapter name. In this configuration, + # it is necessary to build a list of all the section entries + # available inside the chapter before deleting it. Once the + # chapter has been marked for deletion, it is time to update + # chapter definition files and later section definition files + # using the list of section entries previously defined. + # Actualization of section definition files must be done one + # at a time because menu entries related to section + # definitions are updated one at a time. + texinfo_deleteEntryChapter + + elif [[ ${MANUAL_DIRN[$MANUAL_DOCENTRY_ID]} != '' ]];then + + # When a manual is deleted, documentation entry doesnt' point + # to either a section or chapter but a manual name only. In + # this configuration the entire manual directory is marked for + # deletion, and that way processed. + texinfo_deleteEntryManual + + else + cli_printMessage "`gettext "The parameters you provided are not supported."`" --as-error-line + fi + + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_deleteEntryChapter.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_deleteEntryChapter.sh new file mode 100755 index 0000000..6cc2350 --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_deleteEntryChapter.sh @@ -0,0 +1,73 @@ +#!/bin/bash +# +# texinfo_deleteEntryChapter.sh -- This function standardizes chapter +# deletion inside the manual structure. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_deleteEntryChapter { + + # Verify existence of documentation entry before deleting it. + # We cannot delete an entry which doesn't exist. + cli_checkFiles "${MANUAL_CHAPTER_DIR}" -d + cli_checkFiles "${MANUAL_CHAPTER_DIR}-menu.${MANUAL_EXTENSION}" -f + cli_checkFiles "${MANUAL_CHAPTER_DIR}-nodes.${MANUAL_EXTENSION}" -f + cli_checkFiles "${MANUAL_CHAPTER_DIR}.${MANUAL_EXTENSION}" -f + + # Define list of chapters that shouldn't be removed. + local SPECIAL_CHAPTERS='/(Licenses|Index)$' + + # Verify list of chapters that shouldn't be removed against the + # current chapter directory being removed. + if [[ $MANUAL_CHAPTER_DIR =~ $SPECIAL_CHAPTERS ]];then + cli_printMessage "`gettext "The chapter specified cannot be removed."`" --as-error-line + fi + + # Build list of section entries inside the chapter. This is + # required to delete cross references from other section entries + # that point to section entries inside the chapter that will be + # deleted. Take care don't include the chapter definition files. + local MANUAL_ENTRIES=$(cli_getFilesList $MANUAL_CHAPTER_DIR \ + --pattern="^/.+\.${MANUAL_EXTENSION}$") + + # Remove chapter directory and related files using version control + # to register the change. + cli_runFnEnvironment vcs --delete ${MANUAL_CHAPTER_DIR} + cli_runFnEnvironment vcs --delete ${MANUAL_CHAPTER_DIR}-menu.${MANUAL_EXTENSION} + cli_runFnEnvironment vcs --delete ${MANUAL_CHAPTER_DIR}-nodes.${MANUAL_EXTENSION} + cli_runFnEnvironment vcs --delete ${MANUAL_CHAPTER_DIR}.${MANUAL_EXTENSION} + + # Update chapter menu and nodes inside manual structure. + texinfo_updateChapterMenu --delete-entry + texinfo_updateChapterNodes + + # Loop through section entries retrieved from chapter, before + # deleting it, in order to remove cross references pointing to + # those section entries. Since the chapter and all its sections + # have been removed, cross references pointing them will point to + # non-existent section entries. This way, all cross references + # pointing to non-existent section entries will be transformed in + # order for documenters to advertise the section entry state. + for MANUAL_ENTRY in $MANUAL_ENTRIES;do + texinfo_deleteCrossReferences ${MANUAL_ENTRY} + done + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_deleteEntryManual.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_deleteEntryManual.sh new file mode 100755 index 0000000..84d2bad --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_deleteEntryManual.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# +# texinfo_deleteEntryManual.sh -- This function standardized manual +# deletion inside the working copy. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_deleteEntryManual { + + # Verify existence of documentation entry before deleting it. We + # cannot delete an entry which doesn't exist. + cli_checkFiles "$MANUAL_ENTRY" -f + + # Remove locale-specific documentation manual directory from the + # working copy. Using subversion to register the change. Be sure + # that related output files are removed too. + cli_runFnEnvironment vcs --quiet --delete ${MANUAL_BASEDIR_L10N} + + # Verify manual base directory. When the locale-specific + # documentation manual is the last one inside the manual base + # directory, remove the manual base directory from the working + # copy. There is no need to have an empty manual base directories + # inside the working copy. + if [[ $(ls -1 $MANUAL_BASEDIR | wc -l) -le 1 ]];then + + # Remove manual base directory. + cli_runFnEnvironment vcs --delete ${MANUAL_BASEDIR} + + # Redefine absolute paths to changed directory. This is + # required in order for `(git|subversion)_commitRepoChanges' + # to be aware that we are deleting MANUAL_BASEDIR, not + # MANUAL_BASEDIR_L10N. + MANUAL_CHANGED_DIRS="${MANUAL_BASEDIR}" + + fi + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_deleteEntrySection.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_deleteEntrySection.sh new file mode 100755 index 0000000..cc96ba4 --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_deleteEntrySection.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# +# texinfo_deleteEntrySection.sh -- This function standardized section +# deletion inside the manual structure. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_deleteEntrySection { + + # Verify documentation entry existence. We cannot remove a + # documentation entry which doesn't exist. + cli_checkFiles ${MANUAL_ENTRY} -f + + # Remove documentation entry using subversion to register the + # change. + cli_runFnEnvironment vcs --delete "${MANUAL_ENTRY}" + + # Update section menu, nodes and cross references. + texinfo_updateStructureSection "${MANUAL_ENTRY}" --delete + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_editEntry.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_editEntry.sh new file mode 100755 index 0000000..6acce79 --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_editEntry.sh @@ -0,0 +1,80 @@ +#!/bin/bash +# +# texinfo_editEntry.sh -- This function implements the edition flow of +# documentation entries inside the working copy. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_editEntry { + + # Verify section definition inside chapters. + if [[ ! -f $MANUAL_ENTRY ]];then + + # Verify chapter related to documentation entry. Inside + # manuals, all documentation entries are stored directly under + # its chapter directory. There is no more levels deep so it is + # possible to perform a direct chapter verification here. + if [[ ! -a $(dirname $MANUAL_ENTRY).${MANUAL_EXTENSION} ]];then + texinfo_createChapter + fi + + # Print confirmation question. + cli_printMessage "`gettext "The following documentation section doesn't exist:"`" --as-stdout-line + cli_printMessage "$MANUAL_ENTRY" --as-response-line + cli_printMessage "`gettext "Do you want to create it now?"`" --as-yesornorequest-line + + # Print action message. + cli_printMessage "$MANUAL_ENTRY" --as-updating-line + + # Update section menu, nodes and cross references based on + # changes in order for manual structure to remain consistent. + texinfo_updateStructureSection "$MANUAL_ENTRY" + + # Use default text editor to write changes on documentation entry. + $EDITOR $MANUAL_ENTRY + + else + + # Print action message. + cli_printMessage "$MANUAL_ENTRY" --as-updating-line + + # Rebuild section menu definitions before editing the + # documentation entry. This way, if there is any change in the + # section menu definition, it will be visible to you on + # edition. + texinfo_makeSeeAlso "$MANUAL_ENTRY" + + # Use default text editor to write changes on documentation entry. + $EDITOR $MANUAL_ENTRY + + # Rebuild section menu definitions after editing the + # documentation entry. This way, if there is any change or + # expansion to realize in the section menu definition, it be + # applied right now. Don't see a reason for waiting until the + # next edition for expansions to happen. + texinfo_makeSeeAlso "$MANUAL_ENTRY" + + fi + + # Rebuild output files to propagate recent changes, if any. + texinfo_updateOutputFiles + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_getEntry.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_getEntry.sh new file mode 100755 index 0000000..00b2f97 --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_getEntry.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# +# texinfo_getEntry.sh -- This function builds a documentation entry +# based on location specified as first positional parameter. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_getEntry { + + local MANUAL_ENTRY='' + local MANUAL_SECTION_NAME='' + local MANUAL_SECTION_NAMES="$@" + + # Loop through list of section names. + for MANUAL_SECTION_NAME in $MANUAL_SECTION_NAMES;do + + # Define absolute path to documentation entry. + MANUAL_ENTRY=${MANUAL_BASEDIR_L10N}/${MANUAL_CHAPTER_NAME}/${MANUAL_SECTION_NAME}.${MANUAL_EXTENSION} + + # Output entry's absolute path. + echo ${MANUAL_ENTRY} + + done + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_getEntryIndex.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_getEntryIndex.sh new file mode 100755 index 0000000..cc93ce4 --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_getEntryIndex.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# +# texinfo_getEntryTitle.sh -- This function standardizes the way +# values for chapter and section index definitions are printed out. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_getEntryIndex { + + # Initialize phrase we want to transform based on style provided. + local PHRASE="$1" + + # In the entire phrase provided, capitalize the first word only. + PHRASE=$(echo "${PHRASE}" | tr '[:upper:]' '[:lower:]' \ + | sed -r 's!^([[:alpha:]])!\u\1!') + + # Output transformed phrase. + echo "$PHRASE" + +} + diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_getEntryNode.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_getEntryNode.sh new file mode 100755 index 0000000..801061b --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_getEntryNode.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# +# texinfo_getEntryNode.sh -- This function cleans up the action value +# (ACTIONVAL) directory to make a node name from it. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_getEntryNode { + + # Define documentation entry. + local MANUAL_ENTRY="$1" + + # Verify documentation entry. + if [[ $MANUAL_ENTRY == '' ]];then + cli_printMessage "`gettext "The first positional parameter cannot be empty."`" --as-error-line + fi + + # Define node from documentation entry. + local NODE=$(echo "$MANUAL_ENTRY" | sed -r \ + -e "s!^${MANUAL_BASEDIR_L10N}/!!" \ + -e "s/\.${MANUAL_EXTENSION}$//" \ + -e "s!chapter!!" \ + -e 's!(/|-)! !g' \ + -e 's!\<([[:alpha:]]+)\>!\u\1!g' \ + -e 's!^[[:space:]]+!!' \ + -e 's![[:space:]]+$!!') + + echo "$NODE" + +} + diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_getEntryTitle.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_getEntryTitle.sh new file mode 100755 index 0000000..ce305c3 --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_getEntryTitle.sh @@ -0,0 +1,79 @@ +#!/bin/bash +# +# texinfo_getEntryTitle.sh -- This function standardizes the way entry +# titles for chapters and sections are printed out. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_getEntryTitle { + + # Initialize phrase we want to transform based on style provided. + local PHRASE="$1" + + # Define section style. Through this property you can customize + # the section title in predefined ways. By default, section + # titles are printed with each word capitalized (`cap-each-word'). + # Other values to this option are `cap-first-only' (to capitalize + # just the first word in the title) or `directory' to transform + # each word to a directory path. + local MANUAL_SECTION_STYLE=$(cli_getConfigValue "${MANUAL_CONFIG_FILE}" "main" "manual_section_style") + if [[ ! $MANUAL_SECTION_STYLE =~ '^(cap-each-word|cap-first-only|directory)$' ]];then + MANUAL_SECTION_STYLE='cap-each-word' + fi + + # Verify section style provided and transform the phrase value in + # accordance with it. + case $MANUAL_SECTION_STYLE in + + 'cap-first-only' ) + + # In the entire phrase provided, capitalize the first word + # only. + PHRASE=$(echo "${PHRASE}" | tr '[:upper:]' '[:lower:]' \ + | sed -r 's!^([[:alpha:]])!\u\1!') + ;; + + 'directory' ) + + # In the entire phrase provided, concatenate all words + # with slash (/) character and remark the fact it is a + # directory. + PHRASE=$(echo "${PHRASE}" | sed -r \ + -e 's/(Trunk|Branches|Tags)/\l\1/' \ + -e 's/ /\//g' \ + -e 's/\/([[:alpha:]])/\/\u\1/g') + + PHRASE="@file{$PHRASE}" + ;; + + 'cap-each-word' | * ) + + # In the entire phrase provided, capitalize all words. + PHRASE=$(echo "${PHRASE}" | tr '[:upper:]' '[:lower:]' \ + | sed -r 's!\<([[:alpha:]]+)\>!\u\1!g') + ;; + + esac + + # Output transformed phrase. + echo "$PHRASE" + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_makeSeeAlso.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_makeSeeAlso.sh new file mode 100755 index 0000000..346527d --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_makeSeeAlso.sh @@ -0,0 +1,149 @@ +#!/bin/bash +# +# texinfo_makeSeeAlso.sh -- This function creates a list of links with +# section entries one level ahead from the current section entry being +# processed. Desition of what of these texinfo definitions to use is +# set inside the section entry itself, through the following +# construction: +# +# @c -- <[centos-art(SeeAlso,TYPE) +# @c -- ]> +# +# In this construction, the TYPE variable can be either `itemize', +# `enumerate' or `menu'. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_makeSeeAlso { + + # Initialize variables. + local CHILD_ENTRIES='' + local CHILD_ENTRY='' + local ENTRY_PATTERN='' + local LIST_DEF='' + local LIST_ENTRIES='' + local LIST_TYPE='' + local LIST_TYPE_PATTERN='' + local MANUAL_ENTRY='' + local TMARK='' + local TMARK_PATTERN='' + local TMARKS='' + + # Define absolute path to section entry. + MANUAL_ENTRY="$1" + + # Verify section entry. When section entries are deleted, there is + # no menu definition to set. + if [[ ! -f $MANUAL_ENTRY ]];then + return + fi + + # Define `SeeAlso' translation marker regular expression pattern. + TMARK_PATTERN="^@c -- <\[${CLI_NAME}\(SeeAlso(,(itemize|enumerate|menu))?\)$" + + # Retrieve `SeeAlso' translation marker definition lines. Be sure + # to retrieve unique definitions only. If the same definition is + # present more than once, it will be expanded in one pass. There's + # no need to go through different passes in order to expand + # repeated translation marker definition. + TMARKS=$(egrep "${TMARK_PATTERN}" $MANUAL_ENTRY | sort | uniq) + + # Remove spaces from translation marker definition lines in order + # to process them correctly. Otherwise the definition line would + # be broken on each space character and then that wouldn't be the + # definition line we initially conceived. + TMARKS=$(echo "$TMARKS" | sed -r 's/ /\\040/g') + + # Define pattern used to build list of child sections. A child + # section shares the same path information of its parent without + # file extension. For example, if you have the `identity', + # `identity-images' and `identity-images-themes' section entries, + # `identity-images' is a child entry of `identity' likewise + # `identity-images-themes' is a child entry of `identity-images'. + ENTRY_PATTERN=$(echo "$MANUAL_ENTRY" | sed -r "s/\.${MANUAL_EXTENSION}$//") + + # Define list of child entries we'll use as reference to build the + # menu nodes. Reverse the output here to produce the correct value + # based on menu nodes definition set further. + CHILD_ENTRIES=$(cli_getFilesList $(dirname ${MANUAL_ENTRY}) \ + --pattern="^${ENTRY_PATTERN}-[[:alnum:]]+\.${MANUAL_EXTENSION}$" | sort -r | uniq ) + + # Loop through translation marker definition lines. + for TMARK in $TMARKS;do + + # Define list type based on translation marker definition. + # Remember to revert back the space character transformation + # we previously did, in order for the translation marker + # regular expression pattern to match. + LIST_TYPE=$(echo "$TMARK" | sed -r -e 's/\\040/ /g' -e "s/${TMARK_PATTERN}/\2/") + + # Define list type default value. This is, the list type used + # when no list type is specified in the translation marker + # construction properties field. + if [[ $LIST_TYPE == '' ]];then + LIST_TYPE="itemize" + fi + + # Define list properties (type included). + LIST_PROP=$(echo "$TMARK" | sed -r -e 's/\\040/ /g' -e "s/${TMARK_PATTERN}/\1/") + + # Define `SeeAlso' translation marker regular expression + # pattern that matches the translation marker definition. + # Notice that we cannot use TMARK_PATTERN here because it + # includes a selection list of all possible translation + # markers that can provided and here we need to precisely set + # the one being currently processed, not those whose could be + # processed. + LIST_TYPE_PATTERN="^@c -- <\[${CLI_NAME}\(SeeAlso${LIST_PROP}\)$" + + # Redefine list's entry based on translation marker definition. + if [[ $LIST_TYPE =~ '^menu$' ]];then + for CHILD_ENTRY in $CHILD_ENTRIES;do + LIST_ENTRIES="* $(texinfo_getEntryNode "$CHILD_ENTRY")::\n${LIST_ENTRIES}" + done + elif [[ $LIST_TYPE =~ '^(itemize|enumerate)$' ]];then + for CHILD_ENTRY in $CHILD_ENTRIES;do + LIST_ENTRIES="@item @ref{$(texinfo_getEntryNode "$CHILD_ENTRY")}\n${LIST_ENTRIES}" + done + else + # When an translation marker isn't recognize, go on with + # the next one in the list. + continue + fi + + # Define menu using menu nodes. + LIST_DEF="@c -- <[${CLI_NAME}(SeeAlso${LIST_PROP})\n@${LIST_TYPE}\n${LIST_ENTRIES}@end ${LIST_TYPE}\n@c -- ]>" + + # Expand list definition using translation marker and list + # definition itself. Be sure that no expansion be done when + # the closing tag of translation marker isn't specified. + # Otherwise, there might be lost of content. + sed -r -i "/${LIST_TYPE_PATTERN}/{:a;N;/\n@c -- ]>$/!ba;s/.*/${LIST_DEF}/;}" $MANUAL_ENTRY + + # Clean up both list definition and list entries. Otherwise + # undesired concatenations happen. + LIST_DEF='' + LIST_ENTRIES='' + LIST_TYPE='' + + done + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_renameCrossReferences.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_renameCrossReferences.sh new file mode 100755 index 0000000..597ae59 --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_renameCrossReferences.sh @@ -0,0 +1,83 @@ +#!/bin/bash +# +# texinfo_renameCrossReferences.sh -- This function renames menu, +# nodes and cross references related to chapters and sections that +# have been renamed previously. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_renameCrossReferences { + + local -a PATTERN + local -a REPLACE + + # Build source and target node definitions. + local NODE_SRC="$(texinfo_getEntryNode "$MANUAL_ENTRY_SRC")" + local NODE_DST="$(texinfo_getEntryNode "$MANUAL_ENTRY_DST")" + + # Define regular expression pattern and its replacement for node + # definitions that have been previously removed. + PATTERN[0]="--- @strong\{`gettext "Removed"`\}\((pxref|xref|ref):\<${NODE_SRC}\>(.*)\) ---" + REPLACE[0]="\@\1{${NODE_DST}\2}" + + # Define regular expression pattern and its replacement for menu + # definitions that have been previously removed. + PATTERN[1]="^@comment --- `gettext "Removed"`\(\* \<${NODE_SRC}\>(.*)\) ---$" + REPLACE[1]="* ${NODE_DST}\1" + + # Define list of entries to process. This is, all the texinfo + # source files the documentation manual is made of. + local MANUAL_ENTRIES=$(cli_getFilesList ${MANUAL_BASEDIR_L10N} \ + --pattern="^.+\.${MANUAL_EXTENSION}$" \ + | egrep -v "(${MANUAL_NAME}|chapter)-(menu|nodes|index)") + + # Update node cross references. The node-related cross reference + # definition, long ones specially, could require more than one + # line to be set. By default, GNU sed does not matches newline + # characters in the pattern space, so we need to make use of + # `label' feature and the `N' command in order to build a pattern + # space that includes the newline character in it. Here we use the + # `a' letter to name the label we use, followed by N command to + # add a newline to the pattern space, the s command to make the + # pattern replacement using the `g' flag to make it global and + # finally the command `b' to branch label named `a'. + # + # Inside the pattern space, the `\<' and `\>' are used to restrict + # the match pattern to a word boundary. The word boundary + # restriction applied here is required to avoid undesired + # replacements when we replace singular words with their plurals. + # For example, if we need to change the node `Manual' to its + # plural (i.e., `Manuals'), and no boundary restriction is used in + # the pattern space to do that, we might end up having nodes like + # `Manualsssss' which probably doesn't exist. This is because this + # sed command might be applied to the same file more than once; + # and each time it is applied, a new `Manuals' replaces the + # previous `Manuals' replacement to form `Manualss', `Manualsss', + # and so on for each interaction. Using word boundaries + # restrictions prevent such issue from happening. + sed -r -i ":a;N;s!${PATTERN[0]}!${REPLACE[0]}!g;ba" ${MANUAL_ENTRIES} + + # Update menu cross references. Menu cross reference definitions + # hardly appear in more than one line, so there is no need to + # complicate the replacement command. + sed -r -i "s!${PATTERN[1]}!${REPLACE[1]}!" ${MANUAL_ENTRIES} + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_renameEntry.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_renameEntry.sh new file mode 100755 index 0000000..a626922 --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_renameEntry.sh @@ -0,0 +1,73 @@ +#!/bin/bash +# +# texinfo_renameEntry.sh -- This function standardizes renaming tasks +# related to manual, chapters and sections inside the working copy. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_renameEntry { + + # Initialize source and target locations. + local MANUAL_ENTRY_SRC='' + local MANUAL_ENTRY_DST='' + + # Define both source and target documentation entries. To build + # the source and target documentation entries we take into + # consideration the manual's main definition file, the chapter's + # main definition file and non-option arguments passed to + # centos-art.sh script through the command-line. + if [[ ${MANUAL_SECT[${MANUAL_DOCENTRY_ID}]} != '' ]];then + + # When a section is renamed, the section source location is + # duplicated into the section target location and later + # removed from the working copy. Once the section source + # location has been renamed, the section menu, nodes and cross + # references are updated to keep consistency inside the + # manual. + texinfo_renameEntrySection + + elif [[ ${MANUAL_CHAP[$MANUAL_DOCENTRY_ID]} != '' ]] \ + && [[ ${MANUAL_CHAP[(($MANUAL_DOCENTRY_ID + 1))]} != '' ]];then + + # When a chapter is renamed, the chapter source location is + # duplicated into the chapter source location and later + # removed from the working copy. Once the chapter source + # location has been renamed, the chapter and section menu, + # nodes and cross references are updated to keep consistency + # inside the manual. + texinfo_renameEntryChapter + + elif [[ ${MANUAL_DIRN[$MANUAL_DOCENTRY_ID]} != '' ]] \ + && [[ ${MANUAL_DIRN[(($MANUAL_DOCENTRY_ID + 1))]} != '' ]] ;then + + # When a manual is renamed, a new manual structure is created + # in the manual target location and all chapters and sections + # are duplicated from manual source location to manual target + # location. Once the source manual has been renamed, chapter + # and section menu, nodes and cross references are updated to + # keep consistency inside the manual. + texinfo_renameEntryManual + + else + cli_printMessage "`gettext "The parameters you provided are not supported."`" --as-error-line + fi + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_renameEntryChapter.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_renameEntryChapter.sh new file mode 100755 index 0000000..18cf697 --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_renameEntryChapter.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# +# texinfo_renameEntryChapter.sh -- This function standardizes renaming +# tasks related to manual chapters inside documentation manuals +# written in texinfo format. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_renameEntryChapter { + + # Copy section source entry to target location. + texinfo_copyEntryChapter + + # Delete section source entry. + texinfo_deleteEntryChapter + + # Rename menu, nodes and cross references related entries. + texinfo_renameCrossReferences + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_renameEntryManual.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_renameEntryManual.sh new file mode 100755 index 0000000..ce9d8a1 --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_renameEntryManual.sh @@ -0,0 +1,62 @@ +#!/bin/bash +# +# texinfo_renameEntryManual.sh -- This function standardizes renaming +# tasks related to documenation manuals written in texinfo format +# inside the working copy. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_renameEntryManual { + + # Copy section source entry to target location. + texinfo_copyEntryManual + + # Delete section source entry. + texinfo_deleteEntryManual + + # Redefine absolute paths to changed directories. This is + # required in order for `cli_synchronizeRepoChanges' to be aware + # of manual source and target locations we've just renamed. + MANUAL_CHANGED_DIRS="${MANUAL_BASEDIR} $(echo $MANUAL_BASEDIR \ + | sed -r "s!${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]}!${MANUAL_DIRN[((${MANUAL_DOCENTRY_ID} + 1))]}!")" + + # From this time on, the manual information set so far is no + # longer useful. Redefine it to start using the new manual + # information instead. + + # Redefine manual name using manual name passed to `centos-art.sh' + # script as second non-option argument. + MANUAL_NAME=${MANUAL_SLFN[((${MANUAL_DOCENTRY_ID} + 1))]} + + # Redefine absolute path to manual directory using manual name + # passed to `centos-art.sh' script as second non-option argument. + MANUAL_BASEDIR="$(echo $MANUAL_BASEDIR \ + | sed -r "s!${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]}!${MANUAL_DIRN[((${MANUAL_DOCENTRY_ID} + 1))]}!")" + + # Redefine absolute path to manual directory using manual name + # passed to `centos-art.sh' script as second non-option argument. + MANUAL_BASEDIR_L10N="${MANUAL_BASEDIR}/${MANUAL_L10N}" + + # Redefine absolute path to base file using manual name passed to + # `centos-art.sh' script as second non-option argument. + MANUAL_BASEFILE="${MANUAL_BASEDIR_L10N}/${MANUAL_NAME}" + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_renameEntrySection.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_renameEntrySection.sh new file mode 100755 index 0000000..771929a --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_renameEntrySection.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# +# texinfo_renameEntrySection.sh -- This function standardizes renaming +# tasks related to chapter sections inside documentation manuals +# written in texinfo format. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_renameEntrySection { + + # Copy section source entry to target location. + texinfo_copyEntrySection + + # Delete section source entry. + texinfo_deleteEntrySection + + # Rename menu, nodes and cross references related entries. + texinfo_renameCrossReferences + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_restoreCrossReferences.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_restoreCrossReferences.sh new file mode 100755 index 0000000..e7389c0 --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_restoreCrossReferences.sh @@ -0,0 +1,82 @@ +#!/bin/bash +# +# texinfo_restoreCrossReferences.sh -- This function looks inside +# texinfo source files, from section level on, and restores any cross +# reference related to a documentation entry. This function is used in +# those cases where documentation entries are created/recreated to +# documentation structure. It is a verification that looks for +# matching documentation entries previously defined as removed by +# texinfo_deleteCrossReferences function. The +# texinfo_restoreCrossReferences function relays in the removed +# message format produced by texinfo_deleteCrossReferences +# function, in order to return them back into the link format. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_restoreCrossReferences { + + local -a PATTERN + local -a REPLACE + + # Define documentation entry. + local MANUAL_ENTRY="$1" + + # Verify documentation entry. If documentation entry is empty, + # stop script execution with an error message. + if [[ $MANUAL_ENTRY == '' ]];then + cli_printMessage "`gettext "The first positional parameter cannot be empty."`" --as-error-line + fi + + # Build the node string using entry location. + local NODE="$(texinfo_getEntryNode "$MANUAL_ENTRY")" + + # Define regular expression patterns to match removed message + # format produced by message_removeCrossReferences function. + PATTERN[0]="--- @strong\{`gettext "Removed"`\}\((pxref|xref|ref):(${NODE})\) ---" + PATTERN[1]="^@comment --- `gettext "Removed"`\((\* ${NODE}:(.*)?:(.*)?)\) ---$" + + # Define replacement string to turn removed message back to cross + # reference link. + REPLACE[0]='\@\1{\2}' + REPLACE[1]='\1' + + # Define list of entries to process. + local MANUAL_ENTRIES=$(cli_getFilesList ${MANUAL_BASEDIR_L10N} \ + --pattern="^.+\.${MANUAL_EXTENSION}$") + + # Update node-related cross references. The node-related cross + # reference definition, long ones specially, could require more + # than one line to be set. By default, GNU sed does not matches + # newline characters in the pattern space, so we need to make use + # of `label' feature and the `N' command in order to build a + # pattern space that includes the newline character in it. Here we + # use the `a' letter to name the label we use, followed by N + # command to add a newline to the pattern space, the s command to + # make the pattern replacement using the `g' flag to make it + # global and finally the command `b' to branch label named `a'. + sed -r -i ":a;N;s!${PATTERN[0]}!${REPLACE[0]}!g;ba" ${MANUAL_ENTRIES} + + # Update menu-related cross references. Menu-related cross + # references hardly appear in more than one line, so there is no + # need to complicate the replacement command. + sed -r -i "s!${PATTERN[1]}!${REPLACE[1]}!" ${MANUAL_ENTRIES} + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_searchIndex.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_searchIndex.sh new file mode 100755 index 0000000..9e62307 --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_searchIndex.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# +# texinfo_searchIndex.sh -- This function does an index search inside the +# info document. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_searchIndex { + + # Verify manual output files and, if they don't exist, create + # them. + if [[ ! -f ${MANUAL_BASEFILE}.info.bz2 ]];then + texinfo_updateOutputFiles + fi + + # Print separator line. + cli_printMessage '-' --as-separator-line + + # Print action message. + cli_printMessage "${MANUAL_BASEFILE}.info.bz2" --as-reading-line + + # Execute info command to perform an index-search. + /usr/bin/info --index-search="$FLAG_SEARCH" --file=${MANUAL_BASEFILE}.info.bz2 + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_searchNode.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_searchNode.sh new file mode 100755 index 0000000..a22749a --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_searchNode.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# +# texinfo_searchNode.sh -- This function converts the documentation +# entry provided to `centos-art.sh' script command-line into a node +# and tries to read it from the manual's `.info' output file. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_searchNode { + + # Verify documentation entry and, if it doesn't exist, prompt out + # its creation. + if [[ ! -f "$MANUAL_ENTRY" ]];then + texinfo_editEntry + fi + + # Verify manual output files and, if they don't exist, create + # them. + if [[ ! -f ${MANUAL_OUTPUT_BASEFILE}.info.bz2 ]];then + texinfo_updateOutputFiles + fi + + # Print separator line. + cli_printMessage '-' --as-separator-line + + # Print action message. + cli_printMessage "${MANUAL_OUTPUT_BASEFILE}.info.bz2" --as-reading-line + + # Define manual node that will be read. + local MANUAL_NODE="$(texinfo_getEntryNode "$MANUAL_ENTRY")" + + # Verify manual node that will be read. When the manual name is + # the only value passed as documentation entry, then use the `Top' + # node as manual node to be read. + if [[ $MANUAL_NODE =~ $(texinfo_getEntryNode "$MANUAL_NAME") ]];then + MANUAL_NODE='Top' + fi + + # Use info reader to read the manual node. + info --node="${MANUAL_NODE}" --file="${MANUAL_OUTPUT_BASEFILE}.info.bz2" + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateChapterMenu.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateChapterMenu.sh new file mode 100755 index 0000000..b9d5433 --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateChapterMenu.sh @@ -0,0 +1,92 @@ +#!/bin/bash +# +# texinfo_updateChapterMenu.sh -- This function updates chapter menu. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_updateChapterMenu { + + local ACTION=$1 + local MENUCHAPTERS='' + + # Print action name. + cli_printMessage "${MANUAL_BASEFILE}-menu.${MANUAL_EXTENSION}" --as-creating-line + + # Build menu of chapters. The Index node is not included as other + # nodes are. The Index node is defined inside the master texinfo + # file (repository.texinfo) as an included file. To create the final + # .info file correctly, the Index line in the menu should remain, + # even no other node exist. + if [[ -f ${MANUAL_BASEFILE}-menu.${MANUAL_EXTENSION} ]];then + MENUCHAPTERS=$(cat ${MANUAL_BASEFILE}-menu.${MANUAL_EXTENSION} \ + | egrep -v "^@(end )?menu$" \ + | egrep -v '^\* (Licenses|Index)::$') + fi + + # Re-defined menu of chapters based on action. + case $ACTION in + + --delete-entry ) + # Remove chapter from menu. + MENUCHAPTERS=$(echo "${MENUCHAPTERS}" \ + | egrep -v '^\* '"${MANUAL_CHAPTER_NAME}"'::[[:print:]]*$') + ;; + + --add-entry | * ) + # Update chapter menu using texinfo format. Be sure the + # chapter node itself is not included here, that would + # duplicate it inside the menu definition file which end + # up being a definition error. Take care the way you quote + # egrep's pattern, prevent to end up using the syntax + # `$"..."' which has security risks. + MENUCHAPTERS="$(echo "${MENUCHAPTERS}" \ + | egrep -v '\* '"${MANUAL_CHAPTER_NAME}"'::[[:print:]]*$') + * ${MANUAL_CHAPTER_NAME}::" + ;; + esac + + # Remove opening spaces/tabs and empty line from the menu of + # chapters. Empty lines may occur the first time the menu of + # chapters is created. + MENUCHAPTERS=$(echo "${MENUCHAPTERS}" | sed -r 's!^[[:space:]]+!!' \ + | egrep -v '^[[:space:]]*$') + + # Organize menu of chapters alphabetically and verify that no + # duplicated line be included on the list. Notice that organizing + # menu this way suppresses the idea of putting the last chapter + # created at the end of the list. + #MENUCHAPTERS=$(echo "${MENUCHAPTERS}" | sort | uniq) + + # Give format to final menu output. + MENUCHAPTERS="@menu + ${MENUCHAPTERS} + * Licenses:: + * Index:: + @end menu" + + # Remove opening space/tabs from menu's final definition. + MENUCHAPTERS=$(echo "${MENUCHAPTERS}" | sed -r 's!^[[:space:]]+!!' \ + | egrep -v '^[[:space:]]*$') + + # Dump organized menu of chapters into file. + echo "${MENUCHAPTERS}" > ${MANUAL_BASEFILE}-menu.${MANUAL_EXTENSION} + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateChapterNodes.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateChapterNodes.sh new file mode 100755 index 0000000..f82b0b4 --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateChapterNodes.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# +# texinfo_updateChapterNodes.sh -- This function updates nodes of +# chapters based on menu of chapters. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_updateChapterNodes { + + # Print action name. + cli_printMessage "${MANUAL_BASEFILE}-nodes.${MANUAL_EXTENSION}" --as-creating-line + + # Build chapter nodes using entries from chapter menu as + # reference. Don't include `Licenses' or `Index' chapters here. + # These chapters are part of our manual's main definition file and + # shouldn't be handled as regular chapters. + local CHAPTERNODES=$(cat ${MANUAL_BASEFILE}-menu.${MANUAL_EXTENSION} \ + | egrep -v '^@(end )?menu$' | egrep -v '^\* (Licenses|Index)::$'\ + | sed -r 's!^\* !!' | sed -r 's!::[[:print:]]*$!!g' \ + | sed -r 's! !_!g') + + # Build list of inclusions from chapter nodes. + local FILENODE=$(\ + for CHAPTERNODE in ${CHAPTERNODES};do + INCL=$(echo ${CHAPTERNODE} \ + | sed -r "s!(${CHAPTERNODE})!\1.${MANUAL_EXTENSION}!") + # Output inclusion line using texinfo format. + echo "@include $INCL" + done) + + # Dump organized nodes of chapters into file. + echo "$FILENODE" > ${MANUAL_BASEFILE}-nodes.${MANUAL_EXTENSION} + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateLicenseLink.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateLicenseLink.sh new file mode 100755 index 0000000..273e6b0 --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateLicenseLink.sh @@ -0,0 +1,61 @@ +#!/bin/bash +# +# texinfo_updateLicenseLink.sh -- This function updates the link +# information related to License directory used by Texinfo +# documentation manuals. There isn't a need to duplicate the License +# information in each documentation manual. In fact it is important +# not to have it duplicated so we can centralize such information for +# all documentation manuals. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_updateLicenseLink { + + # Define directory where license templates are stored in. + local DIR=${TCAR_WORKDIR}/Documentation/Models/Texinfo/Default/${CLI_LANG_LC} + + # Define files related to license templates. + local FILES=$(find ${DIR} -name 'Licenses*') + + for FILE in $FILES;do + + # Remove path from license templates. + FILE=$(basename ${FILE}) + + # Remove license files from manual's specific models. All + # these files are symbolic links. If they aren't, stop the + # script execution with an error message. In this case you + # need to fix your directory structure first (e.g., by + # fetching a more up-to-date version of it from central + # repository). + if [[ -h ${MANUAL_BASEDIR_L10N}/${FILE} ]];then + rm ${MANUAL_BASEDIR_L10N}/${FILE} + else + cli_printMessage "${MANUAL_BASEDIR_L10N} `gettext "has an old directory structure."`" --as-error-line + fi + + # Create link from manual's default models to manual's + # specific models. + ln -s ${DIR}/${FILE} ${MANUAL_BASEDIR_L10N}/${FILE} + + done + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateOutputFileDocbook.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateOutputFileDocbook.sh new file mode 100755 index 0000000..2937ad6 --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateOutputFileDocbook.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# +# texinfo_updateOutputFileDocbook.sh -- This function exports +# documentation manual to DocBook format. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_updateOutputFileDocbook { + + # Print action message. + cli_printMessage "${MANUAL_OUTPUT_BASEFILE}.docbook" --as-creating-line + + # Update xml output format. + /usr/bin/makeinfo --docbook --output=${MANUAL_OUTPUT_BASEFILE}.docbook \ + ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} --no-warn + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateOutputFileInfo.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateOutputFileInfo.sh new file mode 100755 index 0000000..9a462fe --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateOutputFileInfo.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# +# texinfo_updateOutputFileInfo.sh -- This function exports +# documentation manual to info format. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_updateOutputFileInfo { + + # Output action message. + cli_printMessage "${MANUAL_OUTPUT_BASEFILE}.info.bz2" --as-creating-line + + # Update info file. + /usr/bin/makeinfo --output=${MANUAL_OUTPUT_BASEFILE}.info \ + --enable-encoding \ + ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} + + # Compress info file. + if [[ $? -eq 0 ]];then + bzip2 -f ${MANUAL_OUTPUT_BASEFILE}.info + fi + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateOutputFilePdf.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateOutputFilePdf.sh new file mode 100755 index 0000000..c93c6f5 --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateOutputFilePdf.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# +# texinfo_updateOutputFilePdf.sh -- This function exports documentation +# manual to PDF format. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_updateOutputFilePdf { + + # Verify texi2pdf package existence. If this package isn't + # installed in the system, stop script execution with an error + # message. texi2pdf isn't a package by itself but a program of + # texinfo-tex package. So check the correct package. + cli_checkFiles texinfo-tex --is-installed + + # Output action message. + cli_printMessage "${MANUAL_OUTPUT_BASEFILE}.pdf" --as-creating-line + + # Update plaintext output directory. + /usr/bin/texi2pdf --quiet \ + ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} --output=${MANUAL_OUTPUT_BASEFILE}.pdf + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateOutputFilePlaintext.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateOutputFilePlaintext.sh new file mode 100755 index 0000000..4d753b8 --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateOutputFilePlaintext.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# +# texinfo_updateOutputFilePlaintext.sh -- This function exports +# documentation manual to plain-text format. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_updateOutputFilePlaintext { + + # Output action message. + cli_printMessage "${MANUAL_OUTPUT_BASEFILE}.txt.bz2" --as-creating-line + + # Update plaintext output directory. + /usr/bin/makeinfo --plaintext \ + ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} --output=${MANUAL_OUTPUT_BASEFILE}.txt + + # Compress plaintext output file. + if [[ -f ${MANUAL_OUTPUT_BASEFILE}.txt ]];then + bzip2 ${MANUAL_OUTPUT_BASEFILE}.txt --force + fi + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateOutputFileXhtml.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateOutputFileXhtml.sh new file mode 100755 index 0000000..05acbf3 --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateOutputFileXhtml.sh @@ -0,0 +1,96 @@ +#!/bin/bash +# +# texinfo_updateOutputFileXhtml.sh -- This function exports +# documentation manual to HTML format. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_updateOutputFileXhtml { + + # Verify texi2html package existence. If this package isn't + # installed in the system, stop script execution with an error + # message. + cli_checkFiles texi2html --is-installed + + # Output action message. + cli_printMessage "${MANUAL_OUTPUT_BASEFILE}.xhtml.tar.bz2" --as-creating-line + + # Verify initialization files used by texi2html. + cli_checkFiles -e ${MANUAL_TEMPLATE}/manual-init.pl + cli_checkFiles -e ${MANUAL_TEMPLATE_L10N}/manual-init.pl + + # Verify transformation files used to modify texi2html output. + cli_checkFiles -e ${MANUAL_TEMPLATE}/manual.sed + cli_checkFiles -e ${MANUAL_TEMPLATE_L10N}/manual.sed + + # Clean up directory structure where xhtml files will be stored. + # We don't want to have unused files inside it. + if [[ -d ${MANUAL_OUTPUT_BASEFILE}-xhtml ]];then + rm -r ${MANUAL_OUTPUT_BASEFILE}-xhtml + fi + + # Prepare directory structure where xhtml files will be stored in. + mkdir -p ${MANUAL_OUTPUT_BASEFILE}-xhtml + + # Add manual base directory path into directory stack to make it + # the current working directory. This is done to reduce the path + # information packaged inside `repository.xhtml.tar.bz2' file. + pushd ${MANUAL_OUTPUT_BASEFILE}-xhtml > /dev/null + + # Update xhtml files. Use texi2html to export from texinfo file + # format to xhtml using The CentOS Web default visual style. + texi2html --lang=${CLI_LANG_LL} \ + --init-file=${MANUAL_TEMPLATE}/manual-init.pl \ + --init-file=${MANUAL_TEMPLATE_L10N}/manual-init.pl \ + -I ${TCAR_WORKDIR} \ + --output=${MANUAL_OUTPUT_BASEFILE}-xhtml \ + ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} + + # Create `css' and `images' directories. In order to save disk + # space, these directories are linked (symbolically) to their + # respective locations inside the working copy. + ln -s ${TCAR_WORKDIR}/Identity/Webenv/Themes/Default/Docbook/1.69.1/Css Css + ln -s ${TCAR_WORKDIR}/Identity/Images/Webenv Images + + # Remove directory where xhtml files are stored from directory + # stack. The xhtml files have been already created. + popd > /dev/null + + # Apply xhtml transformations. This transformation cannot be built + # inside the initialization script (repository-init.pl). For example, + # Would it be a possible way to produce different quotation HTML + # outputs from the same texinfo quotation definition? Instead, + # once the HTML code is produced we can take the quotation HTML + # definition plus the first letters inside it and transform the + # structure to a completely different thing that can be handle + # through classed inside CSS definitions. + sed -r -i \ + -f ${MANUAL_TEMPLATE}/manual.sed \ + -f ${MANUAL_TEMPLATE_L10N}/manual.sed \ + ${MANUAL_OUTPUT_BASEFILE}-xhtml/*.xhtml + + # Compress directory structure where xhtml files are stored in. + # This compressed version is the one we put under version control. + # The directory used to build the compressed version is left + # unversion for the matter of human revision. + tar -cjf ${MANUAL_OUTPUT_BASEFILE}.xhtml.tar.bz2 ${MANUAL_OUTPUT_BASEFILE}-xhtml > /dev/null 2>&1 + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateOutputFileXml.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateOutputFileXml.sh new file mode 100755 index 0000000..4a60c3f --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateOutputFileXml.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# +# texinfo_updateOutputFileXml.sh -- This function exports documentation +# manual to XML format. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_updateOutputFileXml { + + # Print action message. + cli_printMessage "${MANUAL_OUTPUT_BASEFILE}.xml" --as-creating-line + + # Update xml output format. + /usr/bin/makeinfo --xml \ + ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} --output=${MANUAL_OUTPUT_BASEFILE}.xml \ + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateOutputFiles.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateOutputFiles.sh new file mode 100755 index 0000000..ed1eedc --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateOutputFiles.sh @@ -0,0 +1,65 @@ +#!/bin/bash +# +# texinfo_updateOutputFiles.sh -- This function exports documentation +# manual to different output formats. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_updateOutputFiles { + + # Verify manual base file. We can update manual outputs only if + # its base file exists. For example, we cannot update manual + # outputs if the manual has been deleted previously. + if [[ ! -a ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} ]];then + return + fi + + # Verify output directory. + if [[ ! -d $(dirname $MANUAL_OUTPUT_BASEFILE) ]];then + mkdir -p $(dirname $MANUAL_OUTPUT_BASEFILE) + fi + + # Move script execution to manuals base directory in order for + # makeinfo to produce content correctly. This is the location + # where the documentation's main definition file is stored in. + # Related content outside this location is accessible through + # symbolic links. + pushd ${MANUAL_BASEDIR_L10N} > /dev/null + + # Verify existence of link to Licenses information. + texinfo_updateLicenseLink + + # Keep the order in which these actions are performed. Begin with + # actions that use the makeinfo file to realize the export. Later, + # continue with action that need other tools to realize the export + # (e.g., texi2html to produce XHTML and texi2pdf to produce PDF + # outputs). + texinfo_updateOutputFileInfo + texinfo_updateOutputFileXml + texinfo_updateOutputFileDocbook + texinfo_updateOutputFilePlaintext + texinfo_updateOutputFileXhtml + texinfo_updateOutputFilePdf + + # Remove the working copy root directory from directory stack. + popd > /dev/null + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateSectionMenu.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateSectionMenu.sh new file mode 100755 index 0000000..03c9315 --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateSectionMenu.sh @@ -0,0 +1,113 @@ +#!/bin/bash +# +# texinfo_updateSectionMenu.sh -- This function updates the section's +# menu definition file of a chapter. If this function is called with +# the '--delete-entry' string as first argument, the menu line related +# to the entry being processed is removed. Otherwise, if this function +# is called with the '--add-entry' string as first argument, the menu +# line related to the entry being processed is added to menu's bottom. +# If no argument is passed to this function, the '--add-entry' action +# is assumed. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_updateSectionMenu { + + # Specify which action to do with documentation entry inside the + # chapter menu. + local ACTION="$1" + + # Define section order. Through this property you can customize + # the section order inside the manual. Possible arguments to this + # option are `ordered', `reversed', `created'. From these three + # values `created' is used by default (i.e., new menu entries are + # added to menu's bottom as last entry.). Notice that, once + # you've sorted the menu using `ordered' or `reversed' values, it + # is hard to sort the list back to former creation orders. Go + # sorted or not sorted at all. + local MANUAL_SECTION_ORDER=$(cli_getConfigValue "${MANUAL_CONFIG_FILE}" "main" "manual_section_order") + if [[ ! $MANUAL_SECTION_ORDER =~ '^(created|ordered|reversed)$' ]];then + MANUAL_SECTION_ORDER='created' + fi + + # Build node information used inside chapter menu. + local MENUNODE=$(texinfo_getEntryNode "$MANUAL_ENTRY") + + # Define menu entry using texinfo style and node information as + # reference. + local MENULINE="* ${MENUNODE}::" + + # Retrieve list of menu entries from chapter menu and exclude + # `@menu', `@end menu' and empty lines from output. + local MENU=$(cat ${MENUFILE} \ + | egrep -v '^[[:space:]]*$' | egrep -v '^@(end )?menu') + + # Re-defined chapter menu entries based on action provided to this + # function as first positional parameter. + case $ACTION in + + --delete-entry ) + # Remove menu entry from chapter menu. + MENU="$(echo "$MENU" | egrep -v "$MENULINE")" + ;; + + --add-entry | * ) + # Add menu entry to chapter menu list as last entry. + MENU="$(echo "$MENU" | egrep -v "$MENULINE" ) + ${MENULINE}" + ;; + + esac + + # Remove opening spaces/tabs and empty lines from final menu + # entries. + MENU=$(echo "$MENU" | sed -r 's!^[[:space:]]+!!g' \ + | egrep -v '^[[:space:]]*$') + + # Sort menu entries based on section order property. + case $MANUAL_SECTION_ORDER in + + 'ordered' ) + MENU="$(echo "$MENU" | sort )" + ;; + + 'reversed' ) + MENU="$(echo "$MENU" | sort -r )" + ;; + + esac + + # Rebuild list of chapter menu entries including '@menu' and '@end + # menu' lines back into chapter menu. + MENU="@menu + $MENU + @end menu" + + # Remove opening spaces/tabs and empty lines from final menu + # structure. + MENU=$(echo "$MENU" | sed -r 's!^[[:space:]]+!!g' \ + | egrep -v '^[[:space:]]*$') + + # Dump chapter menu entries back into chapter's menu definition + # file. + echo "$MENU" > ${MENUFILE} + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateSectionNodes.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateSectionNodes.sh new file mode 100755 index 0000000..58d4c30 --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateSectionNodes.sh @@ -0,0 +1,145 @@ +#!/bin/bash +# +# texinfo_updateSectionNodes.sh -- This function updates section's +# nodes definition files using section's menu definition file both +# inside the same chapter. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_updateSectionNodes { + + # Define node file. + local NODEFILE=$(echo $MENUFILE | sed -r "s,-menu,-nodes,") + + # Build list of chapter nodes using entries from chapter menu as + # reference. + local NODES=$(cat ${MENUFILE} \ + | sed -r 's!^\* !!' | sed -r 's!:{1,2}.*$!!g' \ + | egrep -v '^@(end )?menu$' | sed -r 's! !:!g') + + # Build chapter nodes based on chapter menu. + for NODE in $NODES;do + + local NODE=$(echo "${NODE}" | sed -r 's!:! !g') + local INCL=$(echo "${NODE}" | sed -r -e 's! !/!' -e 's! !-!g' -e's!/(.+)!/\L\1!').${MANUAL_EXTENSION} + local SECT=$(texinfo_getEntryTitle "$NODE") + local CIND=$(texinfo_getEntryIndex "$NODE") + + # Initialize absolute path to final texinfo template. + local TEMPLATE='' + + # Create texinfo section file using templates, only if the + # section file doesn't exist and hasn't been marked for + # deletion. Otherwise, when the files have been marked for + # deletion, they will be created again from texinfo template + # to working copy and that might create confusion. + if [[ ! -f ${MANUAL_BASEDIR_L10N}/$INCL ]] \ + && [[ $(cli_runFnEnvironment vcs --status ${MANUAL_BASEDIR_L10N}/$INCL) != 'D' ]];then + + # Retrieve configuration lines from configuration file. Be + # sure no line beginning with `#' or space remain in the + # line. Otherwise, it would be difficult to loop through + # configuration lines. + local CONFLINE='' + local CONFLINES=$(cli_getConfigLines "${MANUAL_CONFIG_FILE}" "templates" "*") + + # Initialize both left hand side and right hand side + # configuration values. + local CONFLHS='' + local CONFRHS='' + + # Define what section template to apply using + # documentation entry absolute path and values provided by + # configuration line. Be sure to break the loop in the + # first match. + for CONFLINE in $CONFLINES;do + + CONFLHS=$(echo $CONFLINE \ + | gawk 'BEGIN{FS="="}; { print $1 }' \ + | sed -r 's![[:space:]]*!!g') + + CONFRHS=$(echo $CONFLINE \ + | gawk 'BEGIN{FS="="}; { print $2 }' \ + | sed -r -e 's![[:space:]]*!!g' -e 's!^"(.+)"$!\1!') + + if [[ ${MANUAL_BASEDIR_L10N}/${INCL} =~ $CONFRHS ]];then + TEMPLATE="${MANUAL_TEMPLATE_L10N}/${CONFLHS}" + break + fi + + done + + # Verify existence of texinfo template file. If no + # template is found, stop script execution with an error + # message. We cannot continue without it. + cli_checkFiles -e ${TEMPLATE} + + # Create documentation entry using texinfo template as + # reference. + cli_runFnEnvironment vcs --copy --quiet ${TEMPLATE} ${MANUAL_BASEDIR_L10N}/$INCL + + fi + + # Expand common translation markers in documentation entry. + cli_expandTMarkers "${MANUAL_BASEDIR_L10N}/$INCL" + + # Replace node, section and concept index definitions already + # defined with node, section and concept index translation + # markers. Otherwise, incorrect sectioning may happen. Take + # care with index definitions, more than one index definition + # might be found in the section file but only the first + # concept index entry (i.e., `cindex') will be updated, the + # rest will remain as they are. + sed -i -r \ + -e '/^@node/c@node =NODE=' \ + -e '/^@section/c@section =SECT=' \ + -e '0,/^@cindex/c@cindex =CIND=' \ + "${MANUAL_BASEDIR_L10N}/$INCL" + + # Before expanding node, section and concept index, be sure + # that all slash characters (`/') be escaped. Otherwise, they + # might be interpreted as separators and that isn't + # desirable in anyway. + NODE=$(echo "$NODE" | sed -r 's/\//\\\//g') + SECT=$(echo "$SECT" | sed -r 's/\//\\\//g') + CIND=$(echo "$CIND" | sed -r 's/\//\\\//g') + + # Expand node, section and concept index translation + # markers in documentation entry. + sed -i -r \ + -e "s/=NODE=/${NODE}/g" \ + -e "s/=SECT=/${SECT}/g" \ + -e "s/=CIND=/${CIND}/g" \ + "${MANUAL_BASEDIR_L10N}/$INCL" + + # Verify existence of Chapter-nodes template file. If no + # Chapter-nodes template is found, stop script execution with + # an error message. We cannot continue without it. + cli_checkFiles -e ${MANUAL_TEMPLATE_L10N}/Chapters-nodes.${MANUAL_EXTENSION} + + # Expand chapter node inclusion definition. + cat ${MANUAL_TEMPLATE_L10N}/Chapters-nodes.${MANUAL_EXTENSION} \ + | sed -r "s!=INCL=!${INCL}!g" + + # Dump chapter node definition into manual structure. + done > ${NODEFILE} + +} diff --git a/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateStructureSection.sh b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateStructureSection.sh new file mode 100755 index 0000000..b9bd1d6 --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/Texinfo/texinfo_updateStructureSection.sh @@ -0,0 +1,140 @@ +#!/bin/bash +# +# texinfo_updateStructureSection.sh -- This function looks for all +# section entries (i.e., files holding section definitions) inside the +# manual's base directory and updates menu, nodes and cross references +# definitions for them all, one at a time. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function texinfo_updateStructureSection { + + local PATTERN="${1}" + + # Define regular expression pattern used to build list of section + # entries when pattern points to manual's file name or it is not + # provided at all. + if [[ $PATTERN =~ "${MANUAL_NAME}\.${MANUAL_EXTENSION}$" ]] \ + || [[ $PATTERN == '' ]]; then + PATTERN="/.+\.${MANUAL_EXTENSION}$" + fi + + local MANUAL_ENTRY='' + local MANUAL_ENTRIES='' + local ACTIONNAM_SECMENU='' + local ACTIONNAM_CROSREF='' + + # Define action to perform on menu, nodes and cross references + # definitions. + case "$2" in + + --delete ) + + # Remove menu and node definitions for sections inside + # manual, in order to reflect the changes. + ACTIONNAM_SECMENU='texinfo_updateSectionMenu --delete-entry' + + # Remove cross reference definitions inside manual + # structure. + ACTIONNAM_CROSREF='texinfo_deleteCrossReferences' + ;; + + --update | * ) + + # Update menu and node definitions for sections inside + # manual, in order to reflect the changes. + ACTIONNAM_SECMENU='texinfo_updateSectionMenu --add-entry' + + # Restore cross reference definitions inside manual + # structure. If a documentation entry has been removed by + # mistake and that mistake is later fixed by adding the + # removed documentation entry back into the manual + # structure, it is necessary to rebuild the missing cross + # reference information inside the manual structure in + # order to reactivate the removed cross references, as + # well. + ACTIONNAM_CROSREF='texinfo_restoreCrossReferences' + ;; + + esac + + # Define list of target entries using find's regular expression + # pattern as reference. Notice that, when we update section + # definition files, the files already exist in the working copy so + # the pattern can be its absolute path without any problem. If the + # pattern is built correctly, it will match the location and so be + # returned to build the list of entries to process. Notice also + # that, when updating, it is possible to use a regular expression + # to match more than one location and build the list of entries + # based on such matching. In this last configuration, let you to + # update menu, nodes and cross references to many section + # definitions (i.e., all those section definition file that match + # the pattern you specified). + MANUAL_ENTRIES=$(cli_getFilesList ${MANUAL_BASEDIR_L10N} \ + --pattern="${PATTERN}" --mindepth="2" --maxdepth="2") + + # Verify list of target entries. Assuming is is empty, define + # list of target documentation entries using pattern as reference + # instead. When we delete a section entry from the working copy, + # using find to retrieve its path isn't possible because the + # section definition file is removed before executing find and by + # consequence no match is found. This issue provokes no section + # entry to be removed from menu, nodes and cross references. In + # order to solve this, use the pattern value as list of target + # entries. Notice that, in this case, the pattern value must be + # the absolute path to that documentation entry which doesn't + # exist and we want to update menu, nodes and cross references + # information for. + if [[ $MANUAL_ENTRIES == '' ]] && [[ $PATTERN =~ '^/[[:alnum:]./_-]+$' ]];then + MANUAL_ENTRIES=${PATTERN} + fi + + # Verify list of target entries. Assuming it is still empty, there + # is nothing else to do here but printing an error message + # describing the fact that no section entry was found to process. + if [[ $MANUAL_ENTRIES == '' ]];then + cli_printMessage "`gettext "There wasn't any section for processing found."`" --as-error-line + fi + + # Loop through target documentation entries in order to update the + # documentation structure (e.g., it is not enough with copying + # documentation entry files, it is also needed to update menu, + # nodes and related cross-references). + for MANUAL_ENTRY in ${MANUAL_ENTRIES};do + + # Define menu file based on manual entry. We use the menu file + # as reference to build the nodes files and update the menu + # file itself based on available section files. + local MENUFILE=$(dirname ${MANUAL_ENTRY} \ + | sed -r 's,/$,,')-menu.${MANUAL_EXTENSION} + + # Don't print action name here. Instead, make it integral part + # of documentation entry creation process. + #cli_printMessage "${MANUAL_ENTRY}" --as-stdout-line + + ${ACTIONNAM_SECMENU} + texinfo_updateSectionNodes + texinfo_makeSeeAlso "${MANUAL_ENTRY}" + ${ACTIONNAM_CROSREF} "${MANUAL_ENTRY}" + + done + +} diff --git a/Automation/centos-art.sh-mods/Help/help.sh b/Automation/centos-art.sh-mods/Help/help.sh new file mode 100755 index 0000000..1d7df06 --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/help.sh @@ -0,0 +1,213 @@ +#!/bin/bash +# +# help.sh -- This function initializes the interface used by +# centos-art.sh script to perform documentation tasks through +# different documentation formats. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function help { + + # Initialize action name with an empty value. + local ACTIONNAM='' + + # Initialize search option (`--search'). This option is used to + # look for documentation inside documentation formats. + local FLAG_SEARCH="" + + # Initialize manual's language. + local MANUAL_L10N=${CLI_LANG_LC} + + # Initialize manuals' top-level directory. This is the place where + # source files for documentation manuals will be stored in. + local MANUAL_TLDIR="${TCAR_WORKDIR}/Documentation/Models" + + # Initialize documentation format. This information defines the + # kind of source files we work with inside the documentation + # manual as well as the kind of actions required by them to + # perform actions related to document management (e.g., creation, + # edition, deletion, copying, renaming, etc.). By default texinfo + # format is used. Other formats can be specified in the + # command-line using the `--format' option. + local FLAG_FORMAT='texinfo' + + # Initialize specific function export id. This value is redefined + # later once we know which is the documentation format. + local EXPORTID='' + + # Initialize documentation entries arrays. Arrays defined here + # contain all the information needed to process documentation + # entries (e.g., manual, part, chapter and section). + local -a MANUAL_SLFN + local -a MANUAL_DIRN + local -a MANUAL_PART + local -a MANUAL_CHAP + local -a MANUAL_SECT + + # Initialize documentation entries counter. + local MANUAL_DOCENTRY_COUNT=0 + local MANUAL_DOCENTRY_ID=0 + + # Interpret option arguments passed through the command-line. + help_getOptions + + # Redefine arrays related to documentation entries using + # non-option arguments passed through the command-line. At this + # point all options have been removed from ARGUMENTS and + # non-option arguments remain. Evaluate ARGUMENTS to retrieve the + # information related documentation entries from there. + help_getEntries + + # Execute format-specific documentation tasks for each + # documentation entry specified in the command-line, individually. + # Notice that we've stored all documentation entries passed as + # non-option arguments in array variables in order to process them + # now, one by one. This is particularly useful when we need to + # reach items in the array beyond the current iteration cycle. For + # example, when we perform actions that require source and target + # locations (e.g., copying and renaming): we use the current value + # as source location and the second value in the array as target + # location; both defined from the first iteration cycle. + while [[ $MANUAL_DOCENTRY_ID -lt $MANUAL_DOCENTRY_COUNT ]];do + + # Define name used by manual's main definition file. + MANUAL_NAME=${MANUAL_SLFN[${MANUAL_DOCENTRY_ID}]} + + # Define extension used by documentation manuals. The + # extension used must be the same passed in the format option. + MANUAL_EXTENSION=${FLAG_FORMAT} + + # Define absolute path to directory holding language-specific + # models. + MANUAL_BASEDIR="${MANUAL_TLDIR}/$(cli_getRepoName \ + ${MANUAL_EXTENSION} -d)/${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]}" + + # Define absolute path to directory holding language-specific + # source files. + MANUAL_BASEDIR_L10N="${MANUAL_BASEDIR}/${MANUAL_L10N}" + + # Define absolute path to changed directories inside the + # manual. For example, when a section entry is edited, copied + # or renamed inside the same manual there is only one + # absolute path to look for changes, the one holding the + # section entry. However, when an entire manual is renamed, + # there might be two different locations to look changes for, + # the source location deleted and the target location added. + MANUAL_CHANGED_DIRS="${MANUAL_BASEDIR_L10N}" + + # Define absolute path to base file. This is the main file + # name (without extension) we use as reference to build output + # files in different formats (.info, .pdf, .xml, etc.). + MANUAL_BASEFILE="${MANUAL_BASEDIR_L10N}/${MANUAL_NAME}" + + # Redefine function export id based on documentation format. + EXPORTID="${CLI_FUNCDIRNAM}/$(cli_getRepoName ${MANUAL_EXTENSION} -d)/${MANUAL_EXTENSION}" + + # Define manual base file used for output. + MANUAL_OUTPUT_BASEFILE=$(echo $MANUAL_BASEFILE | sed -r 's!Models/!Manuals/!') + + # Define manual's part name. + MANUAL_PART_NAME=${MANUAL_PART[${MANUAL_DOCENTRY_ID}]} + + # Define absolute path to manual's part directory. + MANUAL_PART_DIR="${MANUAL_BASEDIR_L10N}/${MANUAL_PART_NAME}" + + # Define manual's chapter name. + MANUAL_CHAPTER_NAME=${MANUAL_CHAP[${MANUAL_DOCENTRY_ID}]} + + # Define absolute path to chapter's directory. This is the + # place where chapter-specific files are stored in. Be sure no + # extra slash be present in the value (e.g., when the part + # name isn't provided). + MANUAL_CHAPTER_DIR="$(echo ${MANUAL_PART_DIR}/${MANUAL_CHAPTER_NAME} \ + | sed -r 's!/{2,}!/!g' | sed -r 's!/$!!' )" + + # Define section name. + MANUAL_SECTION_NAME=${MANUAL_SECT[${MANUAL_DOCENTRY_ID}]} + + # Define absolute path to manual's configuration file. This + # is the file that controls the way template files are applied + # to documentation entries once they have been created as well + # as the style and order used for printing sections. + MANUAL_CONFIG_FILE="${MANUAL_BASEFILE}.conf" + + # Notice that, because we are processing non-option arguments + # one by one, there is no need to synchronize changes or + # initialize functionalities to the same manual time after + # time (assuming all documentation entries passed as + # non-option arguments refer the same manual directory name). + # That would be only necessary when documentation entries + # refer to different manual directory names that could be + # written in different documentation formats. + if [[ ${MANUAL_DOCENTRY_ID} -eq 0 \ + || ( ( ${MANUAL_DOCENTRY_ID} -gt 0 ) && ( \ + ${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]} != ${MANUAL_DIRN[((${MANUAL_DOCENTRY_ID} - 1))]} ) ) ]];then + + # Synchronize changes between repository and working copy. + # At this point, changes in the repository are merged in + # the working copy and changes in the working copy + # committed up to repository. + if [[ -d ${MANUAL_CHANGED_DIRS} ]];then + cli_synchronizeRepoChanges "${MANUAL_CHANGED_DIRS}" + fi + + # Initialize documentation format functionalities. At + # this point we load all functionalities required into + # `centos-art.sh''s execution environment and make them + # available, this way, to perform format-specific + # documentation tasks. + cli_exportFunctions "${EXPORTID}" + + fi + + # Execute format-specific documentation tasks. + ${MANUAL_EXTENSION} + + # Unset the exported functions before go on with the next + # documentation entry provided as non-option argument to + # `centos-art.sh' script. Different documentation entries may + # be written in different documentation formats. Each + # documentation format is loaded in order to perform their + # related documentation tasks. Assuming more that one + # documentation entry be passed as non-option argument to + # `centos-art.sh' script and they are written in different + # formats, we might end up loading documentation format + # functionalities that aren't used in the current + # documentation entry being processed. In that sake, unset + # documentation back-end functionalities when the next + # documentation entry refers to a manual directory different + # to that one being currently processed. + if [[ ${MANUAL_DOCENTRY_ID} -gt 0 \ + && ${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]} != ${MANUAL_DIRN[((${MANUAL_DOCENTRY_ID} + 1))]} ]];then + cli_unsetFunctions "${EXPORTID}" + fi + + # Increment documentation entry counter id. + MANUAL_DOCENTRY_ID=$(($MANUAL_DOCENTRY_ID + 1)) + + done + + # Synchronize changes between repository and working copy. At this + # point, changes in the repository are merged in the working copy + # and changes in the working copy committed up to repository. + cli_synchronizeRepoChanges "${MANUAL_CHANGED_DIRS}" + +} diff --git a/Automation/centos-art.sh-mods/Help/help_getEntries.sh b/Automation/centos-art.sh-mods/Help/help_getEntries.sh new file mode 100755 index 0000000..56e1a92 --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/help_getEntries.sh @@ -0,0 +1,125 @@ +#!/bin/bash +# +# help_getEntries.sh -- This function interpretes non-option +# arguments passed to `help' functionality through the command-line +# and redefines array variables related to documentation entries. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function help_getEntries { + + # Initialize manual's documentation entry as an empty value local + # to this function. + local MANUAL_DOCENTRY='' + + # Redefine positional parameters using ARGUMENTS. At this point, + # option arguments have been removed from ARGUMENTS variable and + # only non-option arguments remain in it. + eval set -- "$ARGUMENTS" + + # Retrive documentation entries passed to `centos-art.sh' script + # as non-option arguments and store them in array variables in + # order to describe their parts (e.g., manual name, chapter name + # and section name) that way. Documentation entries passed as + # non-opiton arguments must be written either in + # `MANUAL:PART:CHAPTER:SECTION' or `path/to/dir' formats in order + # to be processed correctly here. Empty spaces are not permitted. + # To separate words, use the minus sign (e.g., hello-world) or + # cammel case (e.g., HelloWorld). + for MANUAL_DOCENTRY in $@;do + + if [[ ${MANUAL_DOCENTRY} =~ '^[[:alpha:]][[:alnum:]-]+:([[:alnum:]-]*:){2}[[:alnum:]/]*' ]];then + + # When `MANUAL:PART:CHAPTER:SECTION' is used as format to + # documentation entry, you can specify the manual, chapter + # and section where documentation actions will take place + # on. + + # Manual self name. + MANUAL_SLFN[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ + $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN { FS=":" } { print $1 }') -f \ + | tr '[:upper:]' '[:lower:]') + + # Manual self directory name. + MANUAL_DIRN[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ + $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN { FS=":" } { print $1 }') -d ) + + # Manual part name. + MANUAL_PART[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ + $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN { FS=":" } { print $2 }') -d ) + + # Manual chapter name. + MANUAL_CHAP[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ + $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN { FS=":" } { print $3 }') -d ) + + # Manual section name. + MANUAL_SECT[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ + $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN { FS=":" } { print $4 }' | tr '/' '-') -f ) + + elif [[ ${MANUAL_DOCENTRY} =~ "^(trunk|branches|tags)?(/)?($(ls ${TCAR_WORKDIR} \ + | tr '[[:space:]]' '|' | sed 's/|$//'))" ]];then + + # When we use the `path/to/dir' as format to reach + # documentation entries, you cannot specify the manual + # chapter or section where documentation actions will take + # place on. Instead, they are predefined for you here. Use + # this format to quickly document directories inside your + # working copy. + # + # When we use the `path/to/dir' format to reach + # documentation entries, there is a distinction between + # Subversion and Git version control system we need to be + # aware of. This is the directory structure layout used + # in the repository. In Subversion, we use a trunk/, + # branches/, tags/ layout as first level in the repository + # directory structure but, in Git, we don't need such + # special layout in the repository's first directory + # level. The script must be able to understand both + # directory structures. + + # Manual's self name. + MANUAL_SLFN[${MANUAL_DOCENTRY_COUNT}]='tcar-fs' + + # Manual's self directory name. + MANUAL_DIRN[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ + ${MANUAL_SLFN[${MANUAL_DOCENTRY_COUNT}]} -d) + + # Manual's chapter name. + MANUAL_CHAP[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ + $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN { FS="/" }; { if ( NF >= 1 ) print $1 }' ) -d ) + + # Manual's section name. + MANUAL_SECT[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ + $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN { FS="/" }; { if ( NF >= 2 ) print $0 }' \ + | cut -d/ -f2- | tr '/' '-') -f ) + + else + + cli_printMessage "`gettext "The documentation entry provided isn't supported."`" --as-error-line + + fi + + # Increment counting of non-option arguments. + MANUAL_DOCENTRY_COUNT=$(($MANUAL_DOCENTRY_COUNT + 1)) + + done + +} diff --git a/Automation/centos-art.sh-mods/Help/help_getOptions.sh b/Automation/centos-art.sh-mods/Help/help_getOptions.sh new file mode 100755 index 0000000..0ac28ec --- /dev/null +++ b/Automation/centos-art.sh-mods/Help/help_getOptions.sh @@ -0,0 +1,138 @@ +#!/bin/bash +# +# help_getOptions.sh -- This function interpretes option arguments +# passed to `help' functionality through the command-line and defines +# action names accordingly. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function help_getOptions { + + # Define short options we want to support. + local ARGSS="h,q" + + # Define long options we want to support. + local ARGSL="help,quiet,answer-yes,read,search:,format:,edit,update-output,update-structure,copy,delete,rename,synchronize" + + # Redefine ARGUMENTS using getopt(1) command parser. + cli_parseArguments + + # Reset positional parameters using output from (getopt) argument + # parser. + eval set -- "$ARGUMENTS" + + # Define action to take for each option passed. + while true; do + case "$1" in + + -h | --help ) + cli_runFnEnvironment help --read --format="texinfo" "tcar-fs::scripts:bash-functions-help" + shift 1 + exit + ;; + + -q | --quiet ) + FLAG_QUIET="true" + shift 1 + ;; + + --answer-yes ) + FLAG_ANSWER="true" + shift 1 + ;; + + --synchronize ) + FLAG_SYNCHRONIZE="true" + shift 1 + ;; + + --search ) + ACTIONNAM="searchIndex" + FLAG_SEARCH="$2" + shift 2 + ;; + + --format ) + FLAG_FORMAT=$(cli_getRepoName "$2" -f) + # Verify supported documentation manual formats. This + # is required in order to prevent building paths to + # non-existent documentation structures. + if [[ ! $FLAG_FORMAT =~ '^(texinfo)$' ]];then + cli_printMessage "`gettext "The documentation format provided is not supported."`" --as-error-line + fi + shift 2 + ;; + + --read ) + ACTIONNAM="searchNode" + shift 1 + ;; + + --edit ) + ACTIONNAM="editEntry" + shift 1 + ;; + + --copy ) + ACTIONNAM="copyEntry" + shift 1 + ;; + + --delete ) + ACTIONNAM="deleteEntry" + shift 1 + ;; + + --rename ) + ACTIONNAM="renameEntry" + shift 1 + ;; + + --update-output ) + ACTIONNAM="updateOutputFiles" + shift 1 + ;; + + --update-structure ) + ACTIONNAM="updateStructureSection" + shift 1 + ;; + + -- ) + # Remove the `--' argument from the list of arguments + # in order for processing non-option arguments + # correctly. At this point all option arguments have + # been processed already but the `--' argument still + # remains to mark ending of option arguments and + # beginning of non-option arguments. The `--' argument + # needs to be removed here in order to avoid + # centos-art.sh script to process it as a path inside + # the repository, which obviously is not. + shift 1 + break + ;; + esac + done + + # Redefine ARGUMENTS variable using current positional parameters. + cli_parseArgumentsReDef "$@" + +} diff --git a/Automation/centos-art.sh-mods/Locale/locale.sh b/Automation/centos-art.sh-mods/Locale/locale.sh new file mode 100755 index 0000000..58e2375 --- /dev/null +++ b/Automation/centos-art.sh-mods/Locale/locale.sh @@ -0,0 +1,101 @@ +#!/bin/bash +# +# locale.sh -- This function provides internationalization features +# for centos-art.sh script through GNU gettext standard processes. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function locale { + + local ACTIONNAMS='' + local ACTIONNAM='' + local ACTIONVAL='' + + # Initialize machine object flag (`--dont-create-mo'). This flag + # controls whether the centos-art.sh script does create/update + # machine object (MO) files from related portable object (PO) + # files or not. By default, MO files are created. + local FLAG_DONT_CREATE_MO='false' + + # Define localization (l10n) base directory. This is the place + # where all translation messages are organized in. Translation + # messages are organized herein using the same layout of the + # components they represent under the `Identity', + # `Documentation/Manuals' or `Scripts' directory structures. The + # localization base directory must be used as source location for + # control version system operations (e.g., status, update, commit, + # etc.). Otherwise, it would be difficult to add directory + # structures that have several levels down from the localization + # base directory up to the repository (e.g., + # subversion-1.4.2-4.el5_3.1.i386.rpm doesn't support recursive + # creation of directories which parent directories doesn't + # exist.). + local L10N_BASEDIR="${TCAR_WORKDIR}/Locales" + + # Verify current locale information to avoid English messages from + # being localized to themselves. The English language is used as + # reference to write translatable strings inside the source files. + if [[ ${CLI_LANG_LC} =~ '^en' ]];then + cli_printMessage "`gettext "The English language cannot be localized to itself."`" --as-error-line + fi + + # Interpret arguments and options passed through command-line. + locale_getOptions + + # Redefine positional parameters using ARGUMENTS. At this point, + # option arguments have been removed from ARGUMENTS variable and + # only non-option arguments remain in it. + eval set -- "${ARGUMENTS}" + + # Loop through non-option arguments passed to centos-art.sh script + # through its command-line. + for ACTIONVAL in "$@";do + + # Don't call locale_isLocalizable function here. Remember that + # this function (i.e., locale) is called from other functions + # using the cli_runFnEnvironment function to determine whether + # a location can accept or not localized messages. If you put + # the locale_isLocalizable function here, you would be + # duplicating its execution. + + # Sanitate non-option arguments to be sure they match the + # directory conventions established by centos-art.sh script + # against source directory locations in the working copy. + ACTIONVAL=$(cli_checkRepoDirSource ${ACTIONVAL}) + + # Verify non-option arguments passed to centos-art.sh + # command-line. It should point to an existent directory under + # version control inside the working copy. Otherwise, if it + # doesn't point to a directory under version control, finish + # the script execution with an error message. + cli_checkFiles ${ACTIONVAL} -d --is-versioned + + # Execute localization actions provided to centos-art.sh + # script through its command-line. Notice that localization + # actions will be executed in the same order they were + # provided in the command-line. + for ACTIONNAM in ${ACTIONNAMS};do + ${ACTIONNAM} + done + + done + +} diff --git a/Automation/centos-art.sh-mods/Locale/locale_combineLicenseMessages.sh b/Automation/centos-art.sh-mods/Locale/locale_combineLicenseMessages.sh new file mode 100755 index 0000000..2e9868d --- /dev/null +++ b/Automation/centos-art.sh-mods/Locale/locale_combineLicenseMessages.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# +# locale_combineLicenseMessages.sh -- This function combines template +# messages with license messages. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function locale_combineLicenseMessages { + + if [[ $# -lt 1 ]];then + cli_printMessage "`gettext "One argument is required."`" --as-error-message + fi + + local TRANSLATION_INSTANCE=$1 + local TRANSLATION_TEMPLATE=$2 + + local DOCBOOK_LOCALES=$(echo $DOCBOOK_MODELS \ + | sed -r "s!${TCAR_WORKDIR}/!${TCAR_WORKDIR}/Locales/!") + + # Define list of all files you want to combine. + local FILES="${DOCBOOK_LOCALES}/${CLI_LANG_LC}/messages.po \ + ${DOCBOOK_LOCALES}/${CLI_LANG_LC}/messages.po \ + ${TRANSLATION_TEMPLATE}" + + # Be sure the files we want to combine do exist. + cli_checkFiles -e ${FILES} + + # Combine files. + msgcat --output=${TRANSLATION_INSTANCE} \ + --width=70 --no-location --use-first ${FILES} + +} diff --git a/Automation/centos-art.sh-mods/Locale/locale_deleteMessages.sh b/Automation/centos-art.sh-mods/Locale/locale_deleteMessages.sh new file mode 100755 index 0000000..6956257 --- /dev/null +++ b/Automation/centos-art.sh-mods/Locale/locale_deleteMessages.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# +# locale_deleteMessages.sh -- This function deletes the source files' +# localization directory from the working copy in conjunction with all +# portable objects and machine objects inside it. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function locale_deleteMessages { + + # Print separator line. + cli_printMessage '-' --as-separator-line + + # Print action message. + cli_printMessage "$L10N_WORKDIR" --as-deleting-line + + # Verify existence of localization working directory. We cannot + # remove translation files that don't exist. + cli_checkFiles -e "$L10N_WORKDIR" + + # Delete localization working directory using subversion quietly. + ${SVN} del "$L10N_WORKDIR" --quiet + +} diff --git a/Automation/centos-art.sh-mods/Locale/locale_editMessages.sh b/Automation/centos-art.sh-mods/Locale/locale_editMessages.sh new file mode 100755 index 0000000..5b942ee --- /dev/null +++ b/Automation/centos-art.sh-mods/Locale/locale_editMessages.sh @@ -0,0 +1,97 @@ +#!/bin/bash +# +# locale_editMessages.sh -- This function edits portable objects (.po) +# using default text editor. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function locale_editMessages { + + # Verify directory passed as non-option argument to be sure it + # supports localization. + locale_isLocalizable "${ACTIONVAL}" + + local PO_FILE='' + local PO_FILES='' + + # Define location where translation files will be stored in + # without language information in it. The language information is + # put later, when we build the list of files. + local L10N_WORKDIR=$(cli_getLocalizationDir "${ACTIONVAL}" "--no-lang") + + # Prepare working directory to receive translation files. Don't do + # this here. It is already done as part the update actions, but we + # need it here for those cases when no update action is run and + # one execute the edit option. + locale_prepareWorkingDirectory ${L10N_WORKDIR} + + # Define list of PO files to process based on paths provided as + # non-option arguments through centos-art.sh script command-line. + if [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/(Documentation/Models/(Docbook|Svg)|Identity/Models)/.*$" ]];then + + # Do not create MO files for XML-based files. + FLAG_DONT_CREATE_MO='true' + + fi + + # Define list of PO files we want to work with. Don't forget to + # include the language information here. + PO_FILES=$(cli_getFilesList ${L10N_WORKDIR} --type="f" \ + --pattern=".+/${FLAG_FILTER}/${CLI_LANG_LC}/messages\.po$") + + # Verify list of PO files. + if [[ $PO_FILES = "" ]];then + cli_printMessage "`gettext "The path provided hasn't translations yet."`" --as-error-line + else + cli_printMessage '-' --as-separator-line + fi + + # Synchronize changes between repository and working copy. At this + # point, changes in the repository are merged in the working copy + # and changes in the working copy committed up to repository. + cli_synchronizeRepoChanges "${PO_FILES}" + + # Loop through list of PO files to process in order to edit them + # one by one using user's default text editor. + for PO_FILE in ${PO_FILES};do + + # Print the file we are editing. + cli_printMessage "${PO_FILE}" --as-updating-line + + # Use default text editor to edit the PO file. + eval ${EDITOR} ${PO_FILE} + + done + + # At this point some changes might be realized inside the PO file, + # so we need to update the related MO file based on recently + # updated PO files here in order for `centos-art.sh' script to + # print out the most up to date revision of localized messages. + # Notice that this is required only if we were localizing shell + # scripts. + locale_updateMessageBinary + + # Synchronize changes between repository and working copy. At this + # point, changes in the repository are merged in the working copy + # and changes in the working copy committed up to repository. + cli_synchronizeRepoChanges "${PO_FILES}" + +} diff --git a/Automation/centos-art.sh-mods/Locale/locale_getCountryName.sh b/Automation/centos-art.sh-mods/Locale/locale_getCountryName.sh new file mode 100755 index 0000000..874ae24 --- /dev/null +++ b/Automation/centos-art.sh-mods/Locale/locale_getCountryName.sh @@ -0,0 +1,754 @@ +#!/bin/bash +# +# locale_getLanguageName.sh -- This function takes the environment +# country code as reference and outputs the related country name. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function locale_getCountryName { + + local COUNTRYNAME="`gettext "Unknown"`" + + case ${CLI_LANG_CC} in + + 'AD' ) + COUNTRYNAME="`gettext "Andorra"`" + ;; + 'AE' ) + COUNTRYNAME="`gettext "United Arab Emirates"`" + ;; + 'AF' ) + COUNTRYNAME="`gettext "Afghanistan"`" + ;; + 'AG' ) + COUNTRYNAME="`gettext "Antigua and Barbuda"`" + ;; + 'AI' ) + COUNTRYNAME="`gettext "Anguilla"`" + ;; + 'AL' ) + COUNTRYNAME="`gettext "Albania"`" + ;; + 'AM' ) + COUNTRYNAME="`gettext "Armenia"`" + ;; + 'AN' ) + COUNTRYNAME="`gettext "Netherlands Antilles"`" + ;; + 'AO' ) + COUNTRYNAME="`gettext "Angola"`" + ;; + 'AQ' ) + COUNTRYNAME="`gettext "Antarctica"`" + ;; + 'AR' ) + COUNTRYNAME="`gettext "Argentina"`" + ;; + 'AS' ) + COUNTRYNAME="`gettext "Samoa (American)"`" + ;; + 'AT' ) + COUNTRYNAME="`gettext "Austria"`" + ;; + 'AU' ) + COUNTRYNAME="`gettext "Australia"`" + ;; + 'AW' ) + COUNTRYNAME="`gettext "Aruba"`" + ;; + 'AZ' ) + COUNTRYNAME="`gettext "Azerbaijan"`" + ;; + 'BA' ) + COUNTRYNAME="`gettext "Bosnia and Herzegovina"`" + ;; + 'BB' ) + COUNTRYNAME="`gettext "Barbados"`" + ;; + 'BD' ) + COUNTRYNAME="`gettext "Bangladesh"`" + ;; + 'BE' ) + COUNTRYNAME="`gettext "Belgium"`" + ;; + 'BF' ) + COUNTRYNAME="`gettext "Burkina Faso"`" + ;; + 'BG' ) + COUNTRYNAME="`gettext "Bulgaria"`" + ;; + 'BH' ) + COUNTRYNAME="`gettext "Bahrain"`" + ;; + 'BI' ) + COUNTRYNAME="`gettext "Burundi"`" + ;; + 'BJ' ) + COUNTRYNAME="`gettext "Benin"`" + ;; + 'BM' ) + COUNTRYNAME="`gettext "Bermuda"`" + ;; + 'BN' ) + COUNTRYNAME="`gettext "Brunei"`" + ;; + 'BO' ) + COUNTRYNAME="`gettext "Bolivia"`" + ;; + 'BR' ) + COUNTRYNAME="`gettext "Brazil"`" + ;; + 'BS' ) + COUNTRYNAME="`gettext "Bahamas"`" + ;; + 'BT' ) + COUNTRYNAME="`gettext "Bhutan"`" + ;; + 'BV' ) + COUNTRYNAME="`gettext "Bouvet Island"`" + ;; + 'BW' ) + COUNTRYNAME="`gettext "Botswana"`" + ;; + 'BY' ) + COUNTRYNAME="`gettext "Belarus"`" + ;; + 'BZ' ) + COUNTRYNAME="`gettext "Belize"`" + ;; + 'CA' ) + COUNTRYNAME="`gettext "Canada"`" + ;; + 'CC' ) + COUNTRYNAME="`gettext "Cocos (Keeling) Islands"`" + ;; + 'CD' ) + COUNTRYNAME="`gettext "Congo (Dem. Rep.)"`" + ;; + 'CF' ) + COUNTRYNAME="`gettext "Central African Rep."`" + ;; + 'CG' ) + COUNTRYNAME="`gettext "Congo (Rep.)"`" + ;; + 'CH' ) + COUNTRYNAME="`gettext "Switzerland"`" + ;; + 'CI' ) + COUNTRYNAME="`gettext "Co^te d'Ivoire"`" + ;; + 'CK' ) + COUNTRYNAME="`gettext "Cook Islands"`" + ;; + 'CL' ) + COUNTRYNAME="`gettext "Chile"`" + ;; + 'CM' ) + COUNTRYNAME="`gettext "Cameroon"`" + ;; + 'CN' ) + COUNTRYNAME="`gettext "China"`" + ;; + 'CO' ) + COUNTRYNAME="`gettext "Colombia"`" + ;; + 'CR' ) + COUNTRYNAME="`gettext "Costa Rica"`" + ;; + 'CS' ) + COUNTRYNAME="`gettext "Serbia and Montenegro"`" + ;; + 'CU' ) + COUNTRYNAME="`gettext "Cuba"`" + ;; + 'CV' ) + COUNTRYNAME="`gettext "Cape Verde"`" + ;; + 'CX' ) + COUNTRYNAME="`gettext "Christmas Island"`" + ;; + 'CY' ) + COUNTRYNAME="`gettext "Cyprus"`" + ;; + 'CZ' ) + COUNTRYNAME="`gettext "Czech Republic"`" + ;; + 'DE' ) + COUNTRYNAME="`gettext "Germany"`" + ;; + 'DJ' ) + COUNTRYNAME="`gettext "Djibouti"`" + ;; + 'DK' ) + COUNTRYNAME="`gettext "Denmark"`" + ;; + 'DM' ) + COUNTRYNAME="`gettext "Dominica"`" + ;; + 'DO' ) + COUNTRYNAME="`gettext "Dominican Republic"`" + ;; + 'DZ' ) + COUNTRYNAME="`gettext "Algeria"`" + ;; + 'EC' ) + COUNTRYNAME="`gettext "Ecuador"`" + ;; + 'EE' ) + COUNTRYNAME="`gettext "Estonia"`" + ;; + 'EG' ) + COUNTRYNAME="`gettext "Egypt"`" + ;; + 'EH' ) + COUNTRYNAME="`gettext "Western Sahara"`" + ;; + 'ER' ) + COUNTRYNAME="`gettext "Eritrea"`" + ;; + 'ES' ) + COUNTRYNAME="`gettext "Spain"`" + ;; + 'ET' ) + COUNTRYNAME="`gettext "Ethiopia"`" + ;; + 'FI' ) + COUNTRYNAME="`gettext "Finland"`" + ;; + 'FJ' ) + COUNTRYNAME="`gettext "Fiji"`" + ;; + 'FK' ) + COUNTRYNAME="`gettext "Falkland Islands"`" + ;; + 'FM' ) + COUNTRYNAME="`gettext "Micronesia"`" + ;; + 'FO' ) + COUNTRYNAME="`gettext "Faeroe Islands"`" + ;; + 'FR' ) + COUNTRYNAME="`gettext "France"`" + ;; + 'GA' ) + COUNTRYNAME="`gettext "Gabon"`" + ;; + 'GB' ) + COUNTRYNAME="`gettext "Britain (UK)"`" + ;; + 'GD' ) + COUNTRYNAME="`gettext "Grenada"`" + ;; + 'GE' ) + COUNTRYNAME="`gettext "Georgia"`" + ;; + 'GF' ) + COUNTRYNAME="`gettext "French Guiana"`" + ;; + 'GH' ) + COUNTRYNAME="`gettext "Ghana"`" + ;; + 'GI' ) + COUNTRYNAME="`gettext "Gibraltar"`" + ;; + 'GL' ) + COUNTRYNAME="`gettext "Greenland"`" + ;; + 'GM' ) + COUNTRYNAME="`gettext "Gambia"`" + ;; + 'GN' ) + COUNTRYNAME="`gettext "Guinea"`" + ;; + 'GP' ) + COUNTRYNAME="`gettext "Guadeloupe"`" + ;; + 'GQ' ) + COUNTRYNAME="`gettext "Equatorial Guinea"`" + ;; + 'GR' ) + COUNTRYNAME="`gettext "Greece"`" + ;; + 'GS' ) + COUNTRYNAME="`gettext "South Georgia and the South Sandwich Islands"`" + ;; + 'GT' ) + COUNTRYNAME="`gettext "Guatemala"`" + ;; + 'GU' ) + COUNTRYNAME="`gettext "Guam"`" + ;; + 'GW' ) + COUNTRYNAME="`gettext "Guinea-Bissau"`" + ;; + 'GY' ) + COUNTRYNAME="`gettext "Guyana"`" + ;; + 'HK' ) + COUNTRYNAME="`gettext "Hong Kong"`" + ;; + 'HM' ) + COUNTRYNAME="`gettext "Heard Island and McDonald Islands"`" + ;; + 'HN' ) + COUNTRYNAME="`gettext "Honduras"`" + ;; + 'HR' ) + COUNTRYNAME="`gettext "Croatia"`" + ;; + 'HT' ) + COUNTRYNAME="`gettext "Haiti"`" + ;; + 'HU' ) + COUNTRYNAME="`gettext "Hungary"`" + ;; + 'ID' ) + COUNTRYNAME="`gettext "Indonesia"`" + ;; + 'IE' ) + COUNTRYNAME="`gettext "Ireland"`" + ;; + 'IL' ) + COUNTRYNAME="`gettext "Israel"`" + ;; + 'IN' ) + COUNTRYNAME="`gettext "India"`" + ;; + 'IO' ) + COUNTRYNAME="`gettext "British Indian Ocean Territory"`" + ;; + 'IQ' ) + COUNTRYNAME="`gettext "Iraq"`" + ;; + 'IR' ) + COUNTRYNAME="`gettext "Iran"`" + ;; + 'IS' ) + COUNTRYNAME="`gettext "Iceland"`" + ;; + 'IT' ) + COUNTRYNAME="`gettext "Italy"`" + ;; + 'JM' ) + COUNTRYNAME="`gettext "Jamaica"`" + ;; + 'JO' ) + COUNTRYNAME="`gettext "Jordan"`" + ;; + 'JP' ) + COUNTRYNAME="`gettext "Japan"`" + ;; + 'KE' ) + COUNTRYNAME="`gettext "Kenya"`" + ;; + 'KG' ) + COUNTRYNAME="`gettext "Kyrgyzstan"`" + ;; + 'KH' ) + COUNTRYNAME="`gettext "Cambodia"`" + ;; + 'KI' ) + COUNTRYNAME="`gettext "Kiribati"`" + ;; + 'KM' ) + COUNTRYNAME="`gettext "Comoros"`" + ;; + 'KN' ) + COUNTRYNAME="`gettext "St Kitts and Nevis"`" + ;; + 'KP' ) + COUNTRYNAME="`gettext "Korea (North)"`" + ;; + 'KR' ) + COUNTRYNAME="`gettext "Korea (South)"`" + ;; + 'KW' ) + COUNTRYNAME="`gettext "Kuwait"`" + ;; + 'KY' ) + COUNTRYNAME="`gettext "Cayman Islands"`" + ;; + 'KZ' ) + COUNTRYNAME="`gettext "Kazakhstan"`" + ;; + 'LA' ) + COUNTRYNAME="`gettext "Laos"`" + ;; + 'LB' ) + COUNTRYNAME="`gettext "Lebanon"`" + ;; + 'LC' ) + COUNTRYNAME="`gettext "St Lucia"`" + ;; + 'LI' ) + COUNTRYNAME="`gettext "Liechtenstein"`" + ;; + 'LK' ) + COUNTRYNAME="`gettext "Sri Lanka"`" + ;; + 'LR' ) + COUNTRYNAME="`gettext "Liberia"`" + ;; + 'LS' ) + COUNTRYNAME="`gettext "Lesotho"`" + ;; + 'LT' ) + COUNTRYNAME="`gettext "Lithuania"`" + ;; + 'LU' ) + COUNTRYNAME="`gettext "Luxembourg"`" + ;; + 'LV' ) + COUNTRYNAME="`gettext "Latvia"`" + ;; + 'LY' ) + COUNTRYNAME="`gettext "Libya"`" + ;; + 'MA' ) + COUNTRYNAME="`gettext "Morocco"`" + ;; + 'MC' ) + COUNTRYNAME="`gettext "Monaco"`" + ;; + 'MD' ) + COUNTRYNAME="`gettext "Moldova"`" + ;; + 'MG' ) + COUNTRYNAME="`gettext "Madagascar"`" + ;; + 'MH' ) + COUNTRYNAME="`gettext "Marshall Islands"`" + ;; + 'MK' ) + COUNTRYNAME="`gettext "Macedonia"`" + ;; + 'ML' ) + COUNTRYNAME="`gettext "Mali"`" + ;; + 'MM' ) + COUNTRYNAME="`gettext "Myanmar (Burma)"`" + ;; + 'MN' ) + COUNTRYNAME="`gettext "Mongolia"`" + ;; + 'MO' ) + COUNTRYNAME="`gettext "Macao"`" + ;; + 'MP' ) + COUNTRYNAME="`gettext "Northern Mariana Islands"`" + ;; + 'MQ' ) + COUNTRYNAME="`gettext "Martinique"`" + ;; + 'MR' ) + COUNTRYNAME="`gettext "Mauritania"`" + ;; + 'MS' ) + COUNTRYNAME="`gettext "Montserrat"`" + ;; + 'MT' ) + COUNTRYNAME="`gettext "Malta"`" + ;; + 'MU' ) + COUNTRYNAME="`gettext "Mauritius"`" + ;; + 'MV' ) + COUNTRYNAME="`gettext "Maldives"`" + ;; + 'MW' ) + COUNTRYNAME="`gettext "Malawi"`" + ;; + 'MX' ) + COUNTRYNAME="`gettext "Mexico"`" + ;; + 'MY' ) + COUNTRYNAME="`gettext "Malaysia"`" + ;; + 'MZ' ) + COUNTRYNAME="`gettext "Mozambique"`" + ;; + 'NA' ) + COUNTRYNAME="`gettext "Namibia"`" + ;; + 'NC' ) + COUNTRYNAME="`gettext "New Caledonia"`" + ;; + 'NE' ) + COUNTRYNAME="`gettext "Niger"`" + ;; + 'NF' ) + COUNTRYNAME="`gettext "Norfolk Island"`" + ;; + 'NG' ) + COUNTRYNAME="`gettext "Nigeria"`" + ;; + 'NI' ) + COUNTRYNAME="`gettext "Nicaragua"`" + ;; + 'NL' ) + COUNTRYNAME="`gettext "Netherlands"`" + ;; + 'NO' ) + COUNTRYNAME="`gettext "Norway"`" + ;; + 'NP' ) + COUNTRYNAME="`gettext "Nepal"`" + ;; + 'NR' ) + COUNTRYNAME="`gettext "Nauru"`" + ;; + 'NU' ) + COUNTRYNAME="`gettext "Niue"`" + ;; + 'NZ' ) + COUNTRYNAME="`gettext "New Zealand"`" + ;; + 'OM' ) + COUNTRYNAME="`gettext "Oman"`" + ;; + 'PA' ) + COUNTRYNAME="`gettext "Panama"`" + ;; + 'PE' ) + COUNTRYNAME="`gettext "Peru"`" + ;; + 'PF' ) + COUNTRYNAME="`gettext "French Polynesia"`" + ;; + 'PG' ) + COUNTRYNAME="`gettext "Papua New Guinea"`" + ;; + 'PH' ) + COUNTRYNAME="`gettext "Philippines"`" + ;; + 'PK' ) + COUNTRYNAME="`gettext "Pakistan"`" + ;; + 'PL' ) + COUNTRYNAME="`gettext "Poland"`" + ;; + 'PM' ) + COUNTRYNAME="`gettext "St Pierre and Miquelon"`" + ;; + 'PN' ) + COUNTRYNAME="`gettext "Pitcairn"`" + ;; + 'PR' ) + COUNTRYNAME="`gettext "Puerto Rico"`" + ;; + 'PS' ) + COUNTRYNAME="`gettext "Palestine"`" + ;; + 'PT' ) + COUNTRYNAME="`gettext "Portugal"`" + ;; + 'PW' ) + COUNTRYNAME="`gettext "Palau"`" + ;; + 'PY' ) + COUNTRYNAME="`gettext "Paraguay"`" + ;; + 'QA' ) + COUNTRYNAME="`gettext "Qatar"`" + ;; + 'RE' ) + COUNTRYNAME="`gettext "Reunion"`" + ;; + 'RO' ) + COUNTRYNAME="`gettext "Romania"`" + ;; + 'RU' ) + COUNTRYNAME="`gettext "Russia"`" + ;; + 'RW' ) + COUNTRYNAME="`gettext "Rwanda"`" + ;; + 'SA' ) + COUNTRYNAME="`gettext "Saudi Arabia"`" + ;; + 'SB' ) + COUNTRYNAME="`gettext "Solomon Islands"`" + ;; + 'SC' ) + COUNTRYNAME="`gettext "Seychelles"`" + ;; + 'SD' ) + COUNTRYNAME="`gettext "Sudan"`" + ;; + 'SE' ) + COUNTRYNAME="`gettext "Sweden"`" + ;; + 'SG' ) + COUNTRYNAME="`gettext "Singapore"`" + ;; + 'SH' ) + COUNTRYNAME="`gettext "St Helena"`" + ;; + 'SI' ) + COUNTRYNAME="`gettext "Slovenia"`" + ;; + 'SJ' ) + COUNTRYNAME="`gettext "Svalbard and Jan Mayen"`" + ;; + 'SK' ) + COUNTRYNAME="`gettext "Slovakia"`" + ;; + 'SL' ) + COUNTRYNAME="`gettext "Sierra Leone"`" + ;; + 'SM' ) + COUNTRYNAME="`gettext "San Marino"`" + ;; + 'SN' ) + COUNTRYNAME="`gettext "Senegal"`" + ;; + 'SO' ) + COUNTRYNAME="`gettext "Somalia"`" + ;; + 'SR' ) + COUNTRYNAME="`gettext "Suriname"`" + ;; + 'ST' ) + COUNTRYNAME="`gettext "Sao Tome and Principe"`" + ;; + 'SV' ) + COUNTRYNAME="`gettext "El Salvador"`" + ;; + 'SY' ) + COUNTRYNAME="`gettext "Syria"`" + ;; + 'SZ' ) + COUNTRYNAME="`gettext "Swaziland"`" + ;; + 'TC' ) + COUNTRYNAME="`gettext "Turks and Caicos Islands"`" + ;; + 'TD' ) + COUNTRYNAME="`gettext "Chad"`" + ;; + 'TF' ) + COUNTRYNAME="`gettext "French Southern and Antarctic Lands"`" + ;; + 'TG' ) + COUNTRYNAME="`gettext "Togo"`" + ;; + 'TH' ) + COUNTRYNAME="`gettext "Thailand"`" + ;; + 'TJ' ) + COUNTRYNAME="`gettext "Tajikistan"`" + ;; + 'TK' ) + COUNTRYNAME="`gettext "Tokelau"`" + ;; + 'TL' ) + COUNTRYNAME="`gettext "Timor-Leste"`" + ;; + 'TM' ) + COUNTRYNAME="`gettext "Turkmenistan"`" + ;; + 'TN' ) + COUNTRYNAME="`gettext "Tunisia"`" + ;; + 'TO' ) + COUNTRYNAME="`gettext "Tonga"`" + ;; + 'TR' ) + COUNTRYNAME="`gettext "Turkey"`" + ;; + 'TT' ) + COUNTRYNAME="`gettext "Trinidad and Tobago"`" + ;; + 'TV' ) + COUNTRYNAME="`gettext "Tuvalu"`" + ;; + 'TW' ) + COUNTRYNAME="`gettext "Taiwan"`" + ;; + 'TZ' ) + COUNTRYNAME="`gettext "Tanzania"`" + ;; + 'UA' ) + COUNTRYNAME="`gettext "Ukraine"`" + ;; + 'UG' ) + COUNTRYNAME="`gettext "Uganda"`" + ;; + 'UM' ) + COUNTRYNAME="`gettext "US minor outlying islands"`" + ;; + 'US' ) + COUNTRYNAME="`gettext "United States"`" + ;; + 'UY' ) + COUNTRYNAME="`gettext "Uruguay"`" + ;; + 'UZ' ) + COUNTRYNAME="`gettext "Uzbekistan"`" + ;; + 'VA' ) + COUNTRYNAME="`gettext "Vatican City"`" + ;; + 'VC' ) + COUNTRYNAME="`gettext "St Vincent"`" + ;; + 'VE' ) + COUNTRYNAME="`gettext "Venezuela"`" + ;; + 'VG' ) + COUNTRYNAME="`gettext "Virgin Islands (UK)"`" + ;; + 'VI' ) + COUNTRYNAME="`gettext "Virgin Islands (US)"`" + ;; + 'VN' ) + COUNTRYNAME="`gettext "Vietnam"`" + ;; + 'VU' ) + COUNTRYNAME="`gettext "Vanuatu"`" + ;; + 'WF' ) + COUNTRYNAME="`gettext "Wallis and Futuna"`" + ;; + 'WS' ) + COUNTRYNAME="`gettext "Samoa (Western)"`" + ;; + 'YE' ) + COUNTRYNAME="`gettext "Yemen"`" + ;; + 'YT' ) + COUNTRYNAME="`gettext "Mayotte"`" + ;; + 'ZA' ) + COUNTRYNAME="`gettext "South Africa"`" + ;; + 'ZM' ) + COUNTRYNAME="`gettext "Zambia"`" + ;; + 'ZW' ) + COUNTRYNAME="`gettext "Zimbabwe"`" + ;; + + esac + + echo $COUNTRYNAME + +} diff --git a/Automation/centos-art.sh-mods/Locale/locale_getLanguageName.sh b/Automation/centos-art.sh-mods/Locale/locale_getLanguageName.sh new file mode 100755 index 0000000..9872fab --- /dev/null +++ b/Automation/centos-art.sh-mods/Locale/locale_getLanguageName.sh @@ -0,0 +1,776 @@ +#!/bin/bash +# +# locale_getLanguageName.sh -- This function takes the environment +# language code as reference and outputs the related language name. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function locale_getLanguageName { + + local LANGNAME="`gettext "Unknown"`" + + case ${CLI_LANG_LL} in + + 'aa' ) + LANGNAME="`gettext "Afar"`" + ;; + + 'ab' ) + LANGNAME="`gettext "Abkhazian"`" + ;; + + 'ae' ) + LANGNAME="`gettext "Avestan"`" + ;; + + 'af' ) + LANGNAME="`gettext "Afrikaans"`" + ;; + + 'ak' ) + LANGNAME="`gettext "Akan"`" + ;; + + 'am' ) + LANGNAME="`gettext "Amharic"`" + ;; + + 'an' ) + LANGNAME="`gettext "Aragonese"`" + ;; + + 'ar' ) + LANGNAME="`gettext "Arabic"`" + ;; + + 'as' ) + LANGNAME="`gettext "Assamese"`" + ;; + + 'av' ) + LANGNAME="`gettext "Avaric"`" + ;; + + 'ay' ) + LANGNAME="`gettext "Aymara"`" + ;; + + 'az' ) + LANGNAME="`gettext "Azerbaijani"`" + ;; + + 'ba' ) + LANGNAME="`gettext "Bashkir"`" + ;; + + 'be' ) + LANGNAME="`gettext "Byelorussian"`" + ;; + + 'bg' ) + LANGNAME="`gettext "Bulgarian"`" + ;; + + 'bh' ) + LANGNAME="`gettext "Bihari"`" + ;; + + 'bi' ) + LANGNAME="`gettext "Bislama"`" + ;; + + 'bm' ) + LANGNAME="`gettext "Bambara"`" + ;; + + 'bn' ) + LANGNAME="`gettext "Bengali"`" + ;; + + 'bo' ) + LANGNAME="`gettext "Tibetan"`" + ;; + + 'br' ) + LANGNAME="`gettext "Breton"`" + ;; + + 'bs' ) + LANGNAME="`gettext "Bosnian"`" + ;; + + 'ca' ) + LANGNAME="`gettext "Catalan"`" + ;; + + 'ce' ) + LANGNAME="`gettext "Chechen"`" + ;; + + 'ch' ) + LANGNAME="`gettext "Chamorro"`" + ;; + + 'co' ) + LANGNAME="`gettext "Corsican"`" + ;; + + 'cr' ) + LANGNAME="`gettext "Cree"`" + ;; + + 'cs' ) + LANGNAME="`gettext "Czech"`" + ;; + + 'cu' ) + LANGNAME="`gettext "Church Slavic"`" + ;; + + 'cv' ) + LANGNAME="`gettext "Chuvash"`" + ;; + + 'cy' ) + LANGNAME="`gettext "Welsh"`" + ;; + + 'da' ) + LANGNAME="`gettext "Danish"`" + ;; + + 'de' ) + LANGNAME="`gettext "German"`" + ;; + + 'dv' ) + LANGNAME="`gettext "Divehi"`" + ;; + + 'dz' ) + LANGNAME="`gettext "Dzongkha"`" + ;; + + 'ee' ) + LANGNAME="`gettext "E'we"`" + ;; + + 'el' ) + LANGNAME="`gettext "Greek"`" + ;; + + 'en' ) + LANGNAME="`gettext "English"`" + ;; + + 'eo' ) + LANGNAME="`gettext "Esperanto"`" + ;; + + 'es' ) + LANGNAME="`gettext "Spanish"`" + ;; + + 'et' ) + LANGNAME="`gettext "Estonian"`" + ;; + + 'eu' ) + LANGNAME="`gettext "Basque"`" + ;; + 'fa' ) + LANGNAME="`gettext "Persian"`" + ;; + + 'ff' ) + LANGNAME="`gettext "Fulah"`" + ;; + + 'fi' ) + LANGNAME="`gettext "Finnish"`" + ;; + + 'fj' ) + LANGNAME="`gettext "Fijian"`" + ;; + + 'fo' ) + LANGNAME="`gettext "Faroese"`" + ;; + + 'fr' ) + LANGNAME="`gettext "French"`" + ;; + + 'fy' ) + LANGNAME="`gettext "Frisian"`" + ;; + + 'ga' ) + LANGNAME="`gettext "Irish"`" + ;; + + 'gd' ) + LANGNAME="`gettext "Scots"`" + ;; + + 'gl' ) + LANGNAME="`gettext "Gallegan"`" + ;; + + 'gn' ) + LANGNAME="`gettext "Guarani"`" + ;; + + 'gu' ) + LANGNAME="`gettext "Gujarati"`" + ;; + + 'gv' ) + LANGNAME="`gettext "Manx"`" + ;; + + 'ha' ) + LANGNAME="`gettext "Hausa"`" + ;; + + 'he' ) + LANGNAME="`gettext "Hebrew"`" + ;; + + 'hi' ) + LANGNAME="`gettext "Hindi"`" + ;; + + 'ho' ) + LANGNAME="`gettext "Hiri Motu"`" + ;; + + 'hr' ) + LANGNAME="`gettext "Croatian"`" + ;; + + 'ht' ) + LANGNAME="`gettext "Haitian"`" + ;; + + 'hu' ) + LANGNAME="`gettext "Hungarian"`" + ;; + + 'hy' ) + LANGNAME="`gettext "Armenian"`" + ;; + + 'hz' ) + LANGNAME="`gettext "Herero"`" + ;; + + 'ia' ) + LANGNAME="`gettext "Interlingua"`" + ;; + + 'id' ) + LANGNAME="`gettext "Indonesian"`" + ;; + + 'ie' ) + LANGNAME="`gettext "Interlingue"`" + ;; + + 'ig' ) + LANGNAME="`gettext "Igbo"`" + ;; + + 'ii' ) + LANGNAME="`gettext "Sichuan Yi"`" + ;; + + 'ik' ) + LANGNAME="`gettext "Inupiak"`" + ;; + + 'io' ) + LANGNAME="`gettext "Ido"`" + ;; + + 'is' ) + LANGNAME="`gettext "Icelandic"`" + ;; + + 'it' ) + LANGNAME="`gettext "Italian"`" + ;; + + 'iu' ) + LANGNAME="`gettext "Inuktitut"`" + ;; + + 'ja' ) + LANGNAME="`gettext "Japanese"`" + ;; + + 'jv' ) + LANGNAME="`gettext "Javanese"`" + ;; + + 'ka' ) + LANGNAME="`gettext "Georgian"`" + ;; + + 'kg' ) + LANGNAME="`gettext "Kongo"`" + ;; + + 'ki' ) + LANGNAME="`gettext "Kikuyu"`" + ;; + + 'kj' ) + LANGNAME="`gettext "Kuanyama"`" + ;; + + 'kk' ) + LANGNAME="`gettext "Kazakh"`" + ;; + + 'kl' ) + LANGNAME="`gettext "Kalaallisut"`" + ;; + + 'km' ) + LANGNAME="`gettext "Khmer"`" + ;; + + 'kn' ) + LANGNAME="`gettext "Kannada"`" + ;; + + 'ko' ) + LANGNAME="`gettext "Korean"`" + ;; + + 'kr' ) + LANGNAME="`gettext "Kanuri"`" + ;; + + 'ks' ) + LANGNAME="`gettext "Kashmiri"`" + ;; + + 'ku' ) + LANGNAME="`gettext "Kurdish"`" + ;; + + 'kv' ) + LANGNAME="`gettext "Komi"`" + ;; + + 'kw' ) + LANGNAME="`gettext "Cornish"`" + ;; + + 'ky' ) + LANGNAME="`gettext "Kirghiz"`" + ;; + + 'la' ) + LANGNAME="`gettext "Latin"`" + ;; + + 'lb' ) + LANGNAME="`gettext "Letzeburgesch"`" + ;; + + 'lg' ) + LANGNAME="`gettext "Ganda"`" + ;; + + 'li' ) + LANGNAME="`gettext "Limburgish"`" + ;; + + 'ln' ) + LANGNAME="`gettext "Lingala"`" + ;; + + 'lo' ) + LANGNAME="`gettext "Lao"`" + ;; + + 'lt' ) + LANGNAME="`gettext "Lithuanian"`" + ;; + + 'lu' ) + LANGNAME="`gettext "Luba-Katanga"`" + ;; + + 'lv' ) + LANGNAME="`gettext "Latvian"`" + ;; + + 'mg' ) + LANGNAME="`gettext "Malagasy"`" + ;; + + 'mh' ) + LANGNAME="`gettext "Marshall"`" + ;; + + 'mi' ) + LANGNAME="`gettext "Maori"`" + ;; + + 'mk' ) + LANGNAME="`gettext "Macedonian"`" + ;; + + 'ml' ) + LANGNAME="`gettext "Malayalam"`" + ;; + + 'mn' ) + LANGNAME="`gettext "Mongolian"`" + ;; + + 'mo' ) + LANGNAME="`gettext "Moldavian"`" + ;; + + 'mr' ) + LANGNAME="`gettext "Marathi"`" + ;; + + 'ms' ) + LANGNAME="`gettext "Malay"`" + ;; + + 'mt' ) + LANGNAME="`gettext "Maltese"`" + ;; + + 'my' ) + LANGNAME="`gettext "Burmese"`" + ;; + + 'na' ) + LANGNAME="`gettext "Nauru"`" + ;; + + 'nb' ) + LANGNAME="`gettext "Norwegian Bokmaal"`" + ;; + + 'nd' ) + LANGNAME="`gettext "Ndebele, North"`" + ;; + + 'ne' ) + LANGNAME="`gettext "Nepali"`" + ;; + + 'ng' ) + LANGNAME="`gettext "Ndonga"`" + ;; + + 'nl' ) + LANGNAME="`gettext "Dutch"`" + ;; + + 'nn' ) + LANGNAME="`gettext "Norwegian Nynorsk"`" + ;; + + 'no' ) + LANGNAME="`gettext "Norwegian"`" + ;; + + 'nr' ) + LANGNAME="`gettext "Ndebele, South"`" + ;; + + 'nv' ) + LANGNAME="`gettext "Navajo"`" + ;; + + 'ny' ) + LANGNAME="`gettext "Chichewa"`" + ;; + + 'oc' ) + LANGNAME="`gettext "Occitan"`" + ;; + + 'oj' ) + LANGNAME="`gettext "Ojibwa"`" + ;; + + 'om' ) + LANGNAME="`gettext "(Afan) Oromo"`" + ;; + + 'or' ) + LANGNAME="`gettext "Oriya"`" + ;; + + 'os' ) + LANGNAME="`gettext "Ossetian; Ossetic"`" + ;; + + 'pa' ) + LANGNAME="`gettext "Panjabi; Punjabi"`" + ;; + + 'pi' ) + LANGNAME="`gettext "Pali"`" + ;; + + 'pl' ) + LANGNAME="`gettext "Polish"`" + ;; + + 'ps' ) + LANGNAME="`gettext "Pashto, Pushto"`" + ;; + + 'pt' ) + LANGNAME="`gettext "Portuguese"`" + ;; + + 'qu' ) + LANGNAME="`gettext "Quechua"`" + ;; + + 'rm' ) + LANGNAME="`gettext "Rhaeto-Romance"`" + ;; + + 'rn' ) + LANGNAME="`gettext "Rundi"`" + ;; + + 'ro' ) + LANGNAME="`gettext "Romanian"`" + ;; + + 'ru' ) + LANGNAME="`gettext "Russian"`" + ;; + + 'rw' ) + LANGNAME="`gettext "Kinyarwanda"`" + ;; + + 'sa' ) + LANGNAME="`gettext "Sanskrit"`" + ;; + + 'sc' ) + LANGNAME="`gettext "Sardinian"`" + ;; + + 'sd' ) + LANGNAME="`gettext "Sindhi"`" + ;; + + 'se' ) + LANGNAME="`gettext "Northern Sami"`" + ;; + + 'sg' ) + LANGNAME="`gettext "Sango; Sangro"`" + ;; + + 'si' ) + LANGNAME="`gettext "Sinhalese"`" + ;; + + 'sk' ) + LANGNAME="`gettext "Slovak"`" + ;; + + 'sl' ) + LANGNAME="`gettext "Slovenian"`" + ;; + + 'sm' ) + LANGNAME="`gettext "Samoan"`" + ;; + + 'sn' ) + LANGNAME="`gettext "Shona"`" + ;; + + 'so' ) + LANGNAME="`gettext "Somali"`" + ;; + + 'sq' ) + LANGNAME="`gettext "Albanian"`" + ;; + + 'sr' ) + LANGNAME="`gettext "Serbian"`" + ;; + + 'ss' ) + LANGNAME="`gettext "Swati; Siswati"`" + ;; + + 'st' ) + LANGNAME="`gettext "Sesotho; Sotho, Southern"`" + ;; + + 'su' ) + LANGNAME="`gettext "Sundanese"`" + ;; + + 'sv' ) + LANGNAME="`gettext "Swedish"`" + ;; + + 'sw' ) + LANGNAME="`gettext "Swahili"`" + ;; + + 'ta' ) + LANGNAME="`gettext "Tamil"`" + ;; + + 'te' ) + LANGNAME="`gettext "Telugu"`" + ;; + + 'tg' ) + LANGNAME="`gettext "Tajik"`" + ;; + + 'th' ) + LANGNAME="`gettext "Thai"`" + ;; + + 'ti' ) + LANGNAME="`gettext "Tigrinya"`" + ;; + + 'tk' ) + LANGNAME="`gettext "Turkmen"`" + ;; + + 'tl' ) + LANGNAME="`gettext "Tagalog"`" + ;; + + 'tn' ) + LANGNAME="`gettext "Tswana; Setswana"`" + ;; + + 'to' ) + LANGNAME="`gettext "Tonga (?)"`" + ;; + + 'tr' ) + LANGNAME="`gettext "Turkish"`" + ;; + + 'ts' ) + LANGNAME="`gettext "Tsonga"`" + ;; + + + 'tt' ) + LANGNAME="`gettext "Tatar"`" + ;; + + 'tw' ) + LANGNAME="`gettext "Twi"`" + ;; + + 'ty' ) + LANGNAME="`gettext "Tahitian"`" + ;; + + 'ug' ) + LANGNAME="`gettext "Uighur"`" + ;; + + 'uk' ) + LANGNAME="`gettext "Ukrainian"`" + ;; + + 'ur' ) + LANGNAME="`gettext "Urdu"`" + ;; + + 'uz' ) + LANGNAME="`gettext "Uzbek"`" + ;; + + 've' ) + LANGNAME="`gettext "Venda"`" + ;; + + 'vi' ) + LANGNAME="`gettext "Vietnamese"`" + ;; + + 'vo' ) + LANGNAME="`gettext "Volapuk; Volapuk"`" + ;; + + 'wa' ) + LANGNAME="`gettext "Walloon"`" + ;; + + 'wo' ) + LANGNAME="`gettext "Wolof"`" + ;; + + 'xh' ) + LANGNAME="`gettext "Xhosa"`" + ;; + + 'yi' ) + LANGNAME="`gettext "Yiddish (formerly ji)"`" + ;; + + 'yo' ) + LANGNAME="`gettext "Yoruba"`" + ;; + + 'za' ) + LANGNAME="`gettext "Zhuang"`" + ;; + + 'zh' ) + LANGNAME="`gettext "Chinese"`" + ;; + + 'zu' ) + LANGNAME="`gettext "Zulu"`" + ;; + + esac + + echo ${LANGNAME} + +} diff --git a/Automation/centos-art.sh-mods/Locale/locale_getOptions.sh b/Automation/centos-art.sh-mods/Locale/locale_getOptions.sh new file mode 100755 index 0000000..c844614 --- /dev/null +++ b/Automation/centos-art.sh-mods/Locale/locale_getOptions.sh @@ -0,0 +1,122 @@ +#!/bin/bash +# +# locale_getOptions.sh -- This function interprets option parameters +# passed to `locale' functionality and defines action names +# accordingly. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function locale_getOptions { + + # Define short options we want to support. + local ARGSS="h,q" + + # Define long options we want to support. + local ARGSL="help,quiet,filter:,answer-yes,update,edit,delete,dont-create-mo,is-localizable,synchronize" + + # Redefine ARGUMENTS using getopt(1) command parser. + cli_parseArguments + + # Reset positional parameters using output from (getopt) argument + # parser. + eval set -- "${ARGUMENTS}" + + # Look for options passed through command-line. + while true; do + case "$1" in + + -h | --help ) + cli_runFnEnvironment help --read --format="texinfo" "tcar-fs::scripts:bash-functions-locale" + shift 1 + exit + ;; + + -q | --quiet ) + FLAG_QUIET="true" + shift 1 + ;; + + --filter ) + FLAG_FILTER="$2" + shift 2 + ;; + + --answer-yes ) + FLAG_ANSWER="true" + shift 1 + ;; + + --update ) + ACTIONNAMS="$ACTIONNAMS locale_updateMessages" + shift 1 + ;; + + --edit ) + ACTIONNAMS="$ACTIONNAMS locale_editMessages" + shift 1 + ;; + + --delete ) + ACTIONNAMS="$ACTIONNAMS locale_deleteMessages" + shift 1 + ;; + + --is-localizable ) + ACTIONNAMS="$ACTIONNAMS locale_isLocalizable" + shift 1 + ;; + + --dont-create-mo ) + FLAG_DONT_CREATE_MO="true" + shift 1 + ;; + + --synchronize ) + FLAG_SYNCHRONIZE="true" + shift 1 + ;; + + -- ) + # Remove the `--' argument from the list of arguments + # in order for processing non-option arguments + # correctly. At this point all option arguments have + # been processed already but the `--' argument still + # remains to mark ending of option arguments and + # beginning of non-option arguments. The `--' argument + # needs to be removed here in order to avoid + # centos-art.sh script to process it as a path inside + # the repository, which obviously is not. + shift 1 + break + ;; + esac + done + + # Verify action names. When no action name is specified, print an + # error message explaining an action is required at least. + if [[ $ACTIONNAMS == '' ]];then + cli_printMessage "`gettext "You need to provide one action at least."`" --as-error-line + fi + + # Redefine ARGUMENTS variable using current positional parameters. + cli_parseArgumentsReDef "$@" + +} diff --git a/Automation/centos-art.sh-mods/Locale/locale_isLocalizable.sh b/Automation/centos-art.sh-mods/Locale/locale_isLocalizable.sh new file mode 100755 index 0000000..f59bbe3 --- /dev/null +++ b/Automation/centos-art.sh-mods/Locale/locale_isLocalizable.sh @@ -0,0 +1,116 @@ +#!/bin/bash +# +# locale_isLocalizable.sh -- This function determines whether a file +# or directory can have translation messages or not. This is the way +# we standardize what locations can and cannot be localized inside the +# repository. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function locale_isLocalizable { + + local DIR='' + local -a DIRS + + # Initialize location will use as reference to determine whether + # it can have translation messages or not. + local LOCATION="$1" + + # Initialize answer value. By default all paths do not accept + # localization. + local L10N_ACCEPTED='no' + + # When no variable is passed to this function, use the action + # value instead. + if [[ $LOCATION == '' ]];then + LOCATION=${ACTIONVAL} + fi + + # Redefine location to be sure we'll always evaluate a directory, + # as reference location. + if [[ -f $LOCATION ]];then + LOCATION=$(dirname $LOCATION) + fi + + # Verify location existence. If it doesn't exist we cannot go on. + cli_checkFiles -e $LOCATION + + # Initialize possible messages this function would print out. + local -a MESSAGES + + # Define regular expression list of all directories inside the + # repository that can have translation. Try to keep regular + # expressions as simple as possible, so they can be understood by + # sed program. + DIRS[++((${#DIRS[*]}))]="${TCAR_WORKDIR}/Identity/Models/Themes/[[:alnum:]-]+/Distro/$(\ + cli_getPathComponent --release-pattern)/(Anaconda|Concept|Posters|Media)" + DIRS[++((${#DIRS[*]}))]="${TCAR_WORKDIR}/Documentation/Models/Docbook/[[:alnum:]-]+" + DIRS[++((${#DIRS[*]}))]="${TCAR_WORKDIR}/Documentation/Models/Svg/[[:alnum:]-]+" + DIRS[++((${#DIRS[*]}))]="${TCAR_WORKDIR}/Scripts/Bash" + + # Verify location passed as first argument against the list of + # directories that can have translation messages. By default, the + # location passed as first argument is considered as a location + # that cannot have translation messages until a positive answer + # says otherwise. + for DIR in ${DIRS[@]};do + + # Define the path part which is not present in the + # localizable directories. + local PATHDIFF=$(echo ${LOCATION} | sed -r "s,${DIR}/,,") + + # Define the path part that is present in the localizable + # directories. + local PATHSAME=$(echo ${LOCATION} | sed -r "s,/${PATHDIFF},,") + + # Initiate verification between location provided and + # localizable directories. + if [[ $LOCATION =~ "^$DIR$" ]];then + + # At this point the location provided is exactly the same + # that matches the localizable directories. There is + # nothing else to do here but return the script flow to + # this function caller. + L10N_ACCEPTED='yes' + break + + elif [[ ${PATHSAME} =~ "^${DIR}" ]] && [[ -d ${LOCATION} ]];then + + # At this point the location provided is a directory in + # the repository which doesn't match any localizable + # directory in the list, but it could be rendered if the + # --filter option is provided with the appropriate path + # argument. Print a suggestion about it. + cli_printMessage "${PATHSAME} --filter=\"$PATHDIFF\"" --as-suggestion-line + break + + fi + + done + + # At this point, we are safe to say that the path provided isn't + # allow to have any localization for it. So, finish the script + # execution with an error message. + if [[ $L10N_ACCEPTED == 'no' ]];then + cli_printMessage "`gettext "The path provided doesn't support localization."`" --as-error-line + fi + +} diff --git a/Automation/centos-art.sh-mods/Locale/locale_prepareWorkingDirectory.sh b/Automation/centos-art.sh-mods/Locale/locale_prepareWorkingDirectory.sh new file mode 100755 index 0000000..0eaae6a --- /dev/null +++ b/Automation/centos-art.sh-mods/Locale/locale_prepareWorkingDirectory.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# +# locale_prepareWorkingDirectory.sh -- This function prepares the +# working directory where translation files should be stored. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function locale_prepareWorkingDirectory { + + local L10N_WORKDIR=$1 + + if [[ ! -d ${L10N_WORKDIR} ]];then + + # Create localization working directory making parent + # directories as needed. Subversion doesn't create directories + # recursively, so we use the system's `mkdir' command and then + # subversion to register the changes. + mkdir -p ${L10N_WORKDIR} + + # Commit changes from working copy to central repository only. + # At this point, changes in the repository are not merged in + # the working copy, but chages in the working copy do are + # committed up to central repository. + cli_synchronizeRepoChanges "${L10N_BASEDIR}" + + elif [[ $L10N_WORKDIR == '' ]];then + + cli_printMessage "`gettext "The localization directory isn't defined."`" --as-error-line + + fi + +} diff --git a/Automation/centos-art.sh-mods/Locale/locale_updateMessageBinary.sh b/Automation/centos-art.sh-mods/Locale/locale_updateMessageBinary.sh new file mode 100755 index 0000000..426eb5d --- /dev/null +++ b/Automation/centos-art.sh-mods/Locale/locale_updateMessageBinary.sh @@ -0,0 +1,78 @@ +#!/bin/bash +# +# locale_updateMessageBinary.sh -- This function creates/updates +# machine objects (.mo) from portable objects (.po). +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function locale_updateMessageBinary { + + # Verify machine object creation flag. + if [[ ${FLAG_DONT_CREATE_MO} == 'true' ]];then + return + fi + + # Define absolute path to final portable object. This is the file + # that contains all the individual function translation messages + # and is used to build the machine object (.mo) file. + local PO_FILE=${L10N_WORKDIR}/${TEXTDOMAIN}.po + + # Define list of portable objects to work with. This list must be + # built using the portable objects inside the working copy as + # reference not the information in the central repository + # (IMPORTANT: all of them must be included in this list, so + # FLAG_FILTER mustn't be applied here). Thus, when we are + # selective about the functionalities we want to use, it is + # possible to have translation messages only for those + # functionalities we did download into the working copy and no + # others. There is no need to have translation messages for + # functionalities we didn't download. + local PO_FILES=$(cli_getFilesList ${L10N_WORKDIR} --type='f' --pattern="^.+/messages.po$") + + # Define absolute path to machine object directory. + local MO_DIR="${L10N_WORKDIR}/LC_MESSAGES" + + # Define absolute path to machine object file. + local MO_FILE="${MO_DIR}/${TEXTDOMAIN}.mo" + + # Print action message. + cli_printMessage "${PO_FILE}" --as-creating-line + + # Combine all the function individual portable objects into just + # one portable object. Be sure to use just the first translation + # found, otherwise the automated flow will be broken for you to + # decide which one of two or more variants should remain in the + # portable object. + msgcat ${PO_FILES} --use-first --output-file=${PO_FILE} + + # Print action message. + cli_printMessage "${MO_FILE}" --as-creating-line + + # Verify absolute path to machine object directory, if it doesn't + # exist create it. + if [[ ! -d ${MO_DIR} ]];then + mkdir -p ${MO_DIR} + fi + + # Create machine object from portable object. + msgfmt --check ${PO_FILE} --output-file=${MO_FILE} + +} diff --git a/Automation/centos-art.sh-mods/Locale/locale_updateMessageMetadata.sh b/Automation/centos-art.sh-mods/Locale/locale_updateMessageMetadata.sh new file mode 100755 index 0000000..a986483 --- /dev/null +++ b/Automation/centos-art.sh-mods/Locale/locale_updateMessageMetadata.sh @@ -0,0 +1,90 @@ +#!/bin/bash +# +# locale_updateMessageMetadata.sh -- This function sanitates .pot and +# .po files to use common translation markers inside top comment. +# Later, replacement of common translation markers is applied to set +# the final information. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function locale_updateMessageMetadata { + + local COUNT=0 + local -a SRC + local -a DST + + # Retrive absolute path of portable object we'll work with. + local FILE="$1" + + # Check existence of file before work with it. + cli_checkFiles -e "${FILE}" + + # Define pattern lines. The pattern lines are put inside portable + # objects through xgettext and xml2po commands. In the case of + # Last-Translators, be sure to remplace it only when it is empty + # or refer the Documentation SIG only. This way translators' names + # will survive metadata updates. We don't want they have to type + # their name each time they edit a file. + SRC[0]="\"Project-Id-Version:" + SRC[1]="\"Report-Msgid-Bugs-To:" + SRC[2]="\"Last-Translator: (Documentation SIG)?" + SRC[3]="\"Language-Team:" + SRC[4]="\"PO-Revision-Date:" + + # Define replacement lines for pattern line. + DST[0]="\"Project-Id-Version: ${CLI_NAME}-${CLI_VERSION}\\\n\"" + DST[1]="\"Report-Msgid-Bugs-To: Documentation SIG <$(cli_printMailingList --docs)>\\\n\"" + DST[2]="\"Last-Translator: Documentation SIG\\\n\"" + DST[3]="\"Language-Team: $(locale_getLanguageName)\\\n\"" + DST[4]="\"PO-Revision-Date: $(date "+%F %H:%M%z")\\\n\"" + + # Change pattern lines with their replacement lines. + while [[ $COUNT -lt ${#SRC[*]} ]];do + sed -i -r "/${SRC[$COUNT]}/c${DST[$COUNT]}" ${FILE} + COUNT=$(($COUNT + 1)) + done + + # When the .pot file is created using xml2po the + # `Report-Msgid-Bugs-To:' metadata field isn't created like it + # does when xgettext is used. So, in order to have such metadata + # field in all .pot files, verify its existence and add it if it + # doesn't exist. + egrep "^\"${SRC[1]}" $FILE > /dev/null + if [[ $? -ne 0 ]];then + sed -i -r "/^\"${SRC[0]}/a${DST[1]}" $FILE + fi + + # Replace package information using gettext domain information. + sed -i -r "s/PACKAGE/${CLI_NAME}-${CLI_VERSION}/g" ${FILE} + + # Remove absolute path to the working copy so it doesn't appear on + # comments related to locations. Remember that people can download + # their working copies in different locations and we don't want to + # version those changes each time a translation message be + # updated. To be consistent about this, show path information from + # first level on. Don't show the variable part of the path. + sed -i -r "s,${TCAR_WORKDIR}/,,g" ${FILE} + + # Unset array variables to avoid undesired concatenations. + unset SRC + unset DST + +} diff --git a/Automation/centos-art.sh-mods/Locale/locale_updateMessagePObjects.sh b/Automation/centos-art.sh-mods/Locale/locale_updateMessagePObjects.sh new file mode 100755 index 0000000..d2e9aa0 --- /dev/null +++ b/Automation/centos-art.sh-mods/Locale/locale_updateMessagePObjects.sh @@ -0,0 +1,62 @@ +#!/bin/bash +# +# locale_updateMessagePObjects.sh -- This function initializes the +# portable object when it doesn't exist. When the portable object does +# exist, it is updated instead. In both cases, the portable object +# template is used as source to merge changes inside the portable +# object. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function locale_updateMessagePObjects { + + local FILE="$1" + + # Verify the portable object template. The portable object + # template is used to create the portable object. We cannot + # continue without it. + cli_checkFiles -e "${FILE}.pot" + + # Print action message. + cli_printMessage "${FILE}.po" --as-creating-line + + # Verify existence of portable object. The portable object is the + # file translators edit in order to make translation works. + if [[ -f ${FILE}.po ]];then + + # Update portable object merging both portable object and + # portable object template. + msgmerge --output="${FILE}.po" "${FILE}.po" "${FILE}.pot" --quiet + + else + + # Initiate portable object using portable object template. + # Do not print msginit sterr output, use centos-art action + # message instead. + msginit -i ${FILE}.pot -o ${FILE}.po --width=70 \ + --no-translator > /dev/null 2>&1 + + fi + + # Sanitate metadata inside the PO file. + locale_updateMessageMetadata "${FILE}.po" + +} diff --git a/Automation/centos-art.sh-mods/Locale/locale_updateMessageShell.sh b/Automation/centos-art.sh-mods/Locale/locale_updateMessageShell.sh new file mode 100755 index 0000000..ad7614f --- /dev/null +++ b/Automation/centos-art.sh-mods/Locale/locale_updateMessageShell.sh @@ -0,0 +1,89 @@ +#!/bin/bash +# +# locale_updateMessageShell.sh -- This function parses shell scripts +# source files under action value and retrives translatable strings in +# order to creates/updates both the portable object template (.pot) +# and the portable object (.po) related. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function locale_updateMessageShell { + + # Print separator line. + cli_printMessage '-' --as-separator-line + + # Define regular expression to match extensions of shell scripts + # we use inside the repository. + local EXTENSION='sh' + + # Define list of absolute paths to function directories. + local FNDIRS=$(cli_getFilesList ${ACTIONVAL}/Functions \ + --maxdepth=1 --mindepth=1 --type='d' --pattern="${ACTIONVAL}/${FLAG_FILTER}") + + for FNDIR in $FNDIRS;do + + # Define absolute path to directory used as reference to store + # portable objects. + local L10N_WORKDIR=$(cli_getLocalizationDir "${FNDIR}") + + # Prepare working directory to receive translation files. + locale_prepareWorkingDirectory ${L10N_WORKDIR} + + # Define absolute path to file used as reference to create + # portable objects. + local MESSAGES="${L10N_WORKDIR}/messages" + + # Print action message. + cli_printMessage "${MESSAGES}.pot" --as-updating-line + + # Build list of files to process. When you build the pattern, + # be sure the value passed through `--filter' will be exactly + # evaluated with the extension as prefix. Otherwise it would + # be difficult to match files that share the same characters + # in their file names (e.g., it would be difficult to match + # only `hello.sh' if `hello-world.sh' also exists in the same + # location). + local FILES=$(cli_getFilesList ${FNDIR} --pattern="^.+\.${EXTENSION}$") + + # Retrieve translatable strings from shell script files and + # create the portable object template (.pot) from them. + xgettext --output=${MESSAGES}.pot \ + --copyright-holder="$(cli_printCopyrightInfo --holder)" \ + --width=70 --sort-by-file ${FILES} + + # Sanitate metadata inside the POT file. + locale_updateMessageMetadata "${MESSAGES}.pot" + + # Verify, initialize or update portable objects from portable + # object templates. + locale_updateMessagePObjects "${MESSAGES}" + + done + + # At this point some changes might be realized inside the PO file, + # so we need to update the related MO file based on recently + # updated PO files here in order for `centos-art.sh' script to + # print out the most up to date revision of localized messages. + # Notice that this is required only if we were localizaing shell + # scripts. + locale_updateMessageBinary + +} diff --git a/Automation/centos-art.sh-mods/Locale/locale_updateMessageXml.sh b/Automation/centos-art.sh-mods/Locale/locale_updateMessageXml.sh new file mode 100755 index 0000000..cf7bfde --- /dev/null +++ b/Automation/centos-art.sh-mods/Locale/locale_updateMessageXml.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# +# locale_updateMessageXml.sh -- This function parses XML-based files +# (e.g., Scalable Vector Graphics and Docbook files), retrieves +# translatable strings and creates/update gettext portable objects. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function locale_updateMessageXml { + + # Define what kind of XML file we are generating translation + # messages for. This is relevant because scalable vector graphics + # (SVG) files are not using entity expansion while DocBook files + # do. + if [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/Documentation/Models/Docbook/[[:alnum:]-]+$" ]];then + + locale_updateMessageXmlDocbook + + # Combine template messages and licenses messages so when + # template be merged into the final portable object the + # translations be there. If we cannot treat licenses as + # independent documents (e.g., through XInclude), then lets + # keep translation messages as synchronized as possible. + + elif [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/Identity/Models/.+$" ]] \ + || [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/Documentation/Models/Svg/.+$" ]];then + + locale_updateMessageXmlSvg + + else + + cli_printMessage "`gettext "The path provided doesn't support localization."`" --as-error-line + + fi + +} diff --git a/Automation/centos-art.sh-mods/Locale/locale_updateMessageXmlDocbook.sh b/Automation/centos-art.sh-mods/Locale/locale_updateMessageXmlDocbook.sh new file mode 100755 index 0000000..04448e2 --- /dev/null +++ b/Automation/centos-art.sh-mods/Locale/locale_updateMessageXmlDocbook.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# +# locale_updateMessageXmlDocbook.sh -- This function retrieves +# translation messages from Docbook files and creates related portable +# object template for them. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function locale_updateMessageXmlDocbook { + + # Define location where translation files will be stored in. + local L10N_WORKDIR=$(cli_getLocalizationDir ${ACTIONVAL}) + + # Define regular expression to match extensions of shell scripts + # we use inside the repository. + local EXTENSION='docbook' + + # Define absolute paths to Docbook main file. + local TEMPLATE=$(cli_getFilesList ${ACTIONVAL} \ + --maxdepth=1 --mindepth=1 --type='f' \ + --pattern=".+/$(cli_getRepoName ${ACTIONVAL} -f)\.${EXTENSION}$") + + # Process Docbook template files based on whether it is empty or + # not. When it is empty, it is because there is not a Docbook main + # file in the location provided to centos-art.sh script + # command-line. In this case, we try to create one POT file to all + # docbook files inside the location provided but without expanding + # entities. When Docbook template file is not empty, expand + # entities and create the POT file from a Docbook main file + # instance, with all entities expanded. + if [[ -z ${TEMPLATE} ]];then + locale_updateMessageXmlDocbookNoEntities + else + locale_updateMessageXmlDocbookWithEntities + fi + +} diff --git a/Automation/centos-art.sh-mods/Locale/locale_updateMessageXmlDocbookNoEntities.sh b/Automation/centos-art.sh-mods/Locale/locale_updateMessageXmlDocbookNoEntities.sh new file mode 100755 index 0000000..67d6f75 --- /dev/null +++ b/Automation/centos-art.sh-mods/Locale/locale_updateMessageXmlDocbookNoEntities.sh @@ -0,0 +1,73 @@ +#!/bin/bash +# +# locale_updateMessageXmlDocbookNoEntities.sh -- This function creates +# an instance of one or more Docbook files without expanding entities +# inside it, retrieves all translatable strings from main file +# instance, and creates the related portable object template POT for +# them. This is useful to localize Docbook files that aren't direct +# part of a documentation manual but included at rendition time (e.g., +# Docbook files holding license information). +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function locale_updateMessageXmlDocbookNoEntities { + + # In case no path to Docbook main file is not found, go deeper + # into the documentation models directory structure looking for + # files that do match the name of the directory who hold it, and + # use that file as template to initiate localization process. The + # way to reach these files have to be through --filter options + # because we want to respect the restrictions imposed by + # locale_isLocalizable function inside the repository. + # CAUTION: entity expansion the files found this way will be # ignored. + local TEMPLATES=$(cli_getFilesList ${ACTIONVAL} --type='f' \ + --pattern=".+/${FLAG_FILTER}.+\.${EXTENSION}$") + + # Verify number of template files found and define what kind of + # processing they are going to have. In case more than one + # template file be found and because entity expansion will be + # ignored in such case, the whole process of creating the PO file + # for all these templates is also different (simpler) from that we + # use with entity expansion. + + for TEMPLATE in ${TEMPLATES};do + + # Redefine path related to localization work directory. + local L10N_WORKDIR=$(cli_getLocalizationDir "$TEMPLATE") + + # Define location of the file used to create both portable + # object templates (.pot) and portable objects (.po) files. + local MESSAGES="${L10N_WORKDIR}/messages" + + # Print action message. + cli_printMessage "${MESSAGES}.pot" --as-updating-line + + # Extract translatable strings from docbook files and merge + # them down into related messages file. + xml2po -a -l ${CLI_LANG_LL} -o ${MESSAGES}.pot ${TEMPLATE} + + # Verify, initialize or merge portable objects from portable + # object templates. + locale_updateMessagePObjects "${MESSAGES}" + + done + +} diff --git a/Automation/centos-art.sh-mods/Locale/locale_updateMessageXmlDocbookWithEntities.sh b/Automation/centos-art.sh-mods/Locale/locale_updateMessageXmlDocbookWithEntities.sh new file mode 100755 index 0000000..352e5b9 --- /dev/null +++ b/Automation/centos-art.sh-mods/Locale/locale_updateMessageXmlDocbookWithEntities.sh @@ -0,0 +1,74 @@ +#!/bin/bash +# +# locale_updateMessageXmlDocbookWithEntities.sh -- This function +# creates an instance of Docbook main file, expands entities inside +# it, retrieves all translatable strings from main file instance, and +# creates the related portable object template POT for them. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function locale_updateMessageXmlDocbookWithEntities { + + # Define location of the file used to create both portable object + # templates (.pot) and portable objects (.po) files. + local MESSAGES="${L10N_WORKDIR}/messages" + + # Print action message. + cli_printMessage "${MESSAGES}.pot" --as-updating-line + + # Define file name used as template instance. Here is where we + # expand translation markers and entities before retrieving + # translation messages. + local INSTANCE=$(cli_getTemporalFile "$(basename ${TEMPLATE})") + + # Create the non-translated instance of design model. + cp ${TEMPLATE} ${INSTANCE} + + # Expand common contents inside instance. + cli_exportFunctions "Render/Docbook/docbook_setExpansionLicenses" + docbook_setExpansionLicenses ${INSTANCE} + + # When translated instances are rendered, system entities (e.g., + # `%entity-name;') don't appear in the translated instance (it + # seems that xml2po removes them) and this provokes DocBook + # validation to fail. So in order to pass the validation + # successfully and automate the whole creation of system entities, + # don't let this duty ion users'. Instead, make centos-art.sh + # script responsible of it. + cli_exportFunctions "Render/Docbook/docbook_setExpansionSystemEntities" + docbook_setExpansionSystemEntities ${INSTANCE} + + # Create portable object template from instance. Validate + # translated instance before processing it. This step is very + # important in order to detect document's malformations and warn + # you about it, so you can correct them. + xmllint --valid --noent ${INSTANCE} | xml2po -a -l ${CLI_LANG_LC} - \ + | msgcat --output=${MESSAGES}.pot \ + --width=70 --no-location - + + # Expand translation markers inside file. + cli_expandTMarkers ${INSTANCE} + + # Verify, initialize or merge portable objects from portable + # object templates. + locale_updateMessagePObjects "${MESSAGES}" + +} diff --git a/Automation/centos-art.sh-mods/Locale/locale_updateMessageXmlSvg.sh b/Automation/centos-art.sh-mods/Locale/locale_updateMessageXmlSvg.sh new file mode 100755 index 0000000..d41bec1 --- /dev/null +++ b/Automation/centos-art.sh-mods/Locale/locale_updateMessageXmlSvg.sh @@ -0,0 +1,101 @@ +#!/bin/bash +# +# locale_updateMessageXmlSvg.sh -- This function parses XML-based +# files (e.g., scalable vector graphics), retrieves translatable +# strings and creates/update gettext portable objects. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function locale_updateMessageXmlSvg { + + # Inside `Identity/Models' and Documentation/Models/Svg/, design + # models can be compressed or uncompressed. Because of this we + # cannot process all the design models in one unique way. Instead, + # we need to treat them individually based on their file type. + + local DIR='' + local DIRS='' + + # Define regular expression to match extensions of shell scripts + # we use inside the repository. + local EXTENSION='(svgz|svg)' + + # Build list of directories in which we want to look files for. + local DIRS=$(cli_getFilesList ${ACTIONVAL} \ + --pattern="${ACTIONVAL}/${FLAG_FILTER}") + + # Process list of directories, one by one. + for DIR in $DIRS;do + + # Reset information related to temporal files. + local TEMPFILE='' + local TEMPFILES='' + + # Redefine localization working directory using the current + # directory. The localization working directory is the place + # where POT and PO files are stored inside the working copy. + local L10N_WORKDIR=$(cli_getLocalizationDir "${DIR}") + + # Prepare working directory to receive translation files. + locale_prepareWorkingDirectory ${L10N_WORKDIR} + + # Redefine final location of messages.po file, based on + # current directory. + MESSAGES=${L10N_WORKDIR}/messages + + # Build list of files we want to work with. + FILES=$(cli_getFilesList ${DIR} --pattern="${DIR}/.+\.${EXTENSION}") + + for FILE in $FILES;do + + # Redefine temporal file based on file been processed. + TEMPFILE=$(cli_getTemporalFile $(basename ${FILE})) + + # Update the command used to read content of XML files. + if [[ $(file -b -i $FILE) =~ '^application/x-gzip$' ]];then + + # Create uncompressed copy of file. + /bin/zcat $FILE > $TEMPFILE + + else + + # Create uncompressed copy of file. + /bin/cat $FILE > $TEMPFILE + + fi + + # Concatenate temporal files into a list so we can process + # them later through xml2po, all at once. + TEMPFILES="${TEMPFILE} ${TEMPFILES}" + + done + + # Create the portable object template. + cat $TEMPFILES | xml2po -a -l ${CLI_LANG_LC} - \ + | msgcat --output=${MESSAGES}.pot --width=70 --no-location - + + # Verify, initialize or merge portable objects from portable + # object templates. + locale_updateMessagePObjects "${MESSAGES}" + + done + +} diff --git a/Automation/centos-art.sh-mods/Locale/locale_updateMessages.sh b/Automation/centos-art.sh-mods/Locale/locale_updateMessages.sh new file mode 100755 index 0000000..32fd78d --- /dev/null +++ b/Automation/centos-art.sh-mods/Locale/locale_updateMessages.sh @@ -0,0 +1,79 @@ +#!/bin/bash +# +# locale_updateMessages.sh -- This function extracts translatable +# strings from both XML-based files (using xml2po) and shell scripts +# (using xgettext). Translatable strings are initially stored in +# portable objects templates (.pot) which are later merged into +# portable objects (.po) in order to be optionally converted as +# machine objects (.mo). +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function locale_updateMessages { + + # Verify directory passed as non-option argument to be sure it + # supports localization. + locale_isLocalizable "${ACTIONVAL}" + + # Prepare working directory to receive translation files. Don't + # do this here. This location can be redefine later based on + # deeper directory structures not provided as arguments to + # centos-art.sh script. For example, if you execute the following + # command: + # + # centos-art locale Documentation/Models/Svg/Brands --update + # + # it should produce the following directory structure: + # + # Locales/Documentation/Models/Svg/Brands/Logos/${LANG}/ + # Locales/Documentation/Models/Svg/Brands/Symbols/${LANG}/ + # Locales/Documentation/Models/Svg/Brands/Types/${LANG}/ + # + # and not the next one: + # + # Locales/Documentation/Models/Svg/Brands/${LANG}/ + # + # So, don't prepare working directory to receive translation files + # here. Instead, do it just before POT files creation. + + # Evaluate action value to determine whether to use xml2po to + # extract translatable strings from XML-based files or to use + # xgettext to extract translatable strings from shell script + # files. + if [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/(Documentation/Models/(Docbook|Svg)|Identity/Models)/.*$" ]];then + + # Update translatable strings inside the portable object + # template related to XML-based files (e.g., scalable vector + # graphics). + locale_updateMessageXml + + elif [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/Scripts/Bash$" ]];then + + # Update translatable strings inside the portable object + # template related to shell scripts (e.g., the centos-art.sh + # script). + locale_updateMessageShell + + else + cli_printMessage "`gettext "The path provided doesn't support localization."`" --as-error-line + fi + +} diff --git a/Automation/centos-art.sh-mods/Prepare/Config/bash_profile.conf b/Automation/centos-art.sh-mods/Prepare/Config/bash_profile.conf new file mode 100755 index 0000000..b7fbb7a --- /dev/null +++ b/Automation/centos-art.sh-mods/Prepare/Config/bash_profile.conf @@ -0,0 +1,20 @@ +# .bash_profile + +# Get the aliases and functions +if [ -f ~/.bashrc ]; then + . ~/.bashrc +fi + +# User specific environment and startup programs + +PATH=$PATH:$HOME/bin +export PATH + +EDITOR=/usr/bin/vim +export EDITOR + +TCAR_WORKDIR= +export TCAR_WORKDIR + +TCAR_BRAND= +export TCAR_BRAND diff --git a/Automation/centos-art.sh-mods/Prepare/Config/vim.conf b/Automation/centos-art.sh-mods/Prepare/Config/vim.conf new file mode 100755 index 0000000..e54c201 --- /dev/null +++ b/Automation/centos-art.sh-mods/Prepare/Config/vim.conf @@ -0,0 +1,9 @@ +set nu +set textwidth=70 +set autoindent +set tabstop=4 +set softtabstop=4 +set shiftwidth=4 +set expandtab +set tags=./tags,tags +set spell diff --git a/Automation/centos-art.sh-mods/Prepare/prepare.sh b/Automation/centos-art.sh-mods/Prepare/prepare.sh new file mode 100755 index 0000000..f9d8fc2 --- /dev/null +++ b/Automation/centos-art.sh-mods/Prepare/prepare.sh @@ -0,0 +1,67 @@ +#!/bin/bash +# +# prepare.sh (initialization) -- This function creates the base +# execution environment required to standardize final configuration +# stuff needed by your workstation, once the working copy of The +# CentOS Artwork Repository has been downloaded in it. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function prepare { + + local ACTIONNAM='' + local ACTIONNAMS='' + + # Define absolute path to directory holding prepare's + # configuration files. + local PREPARE_CONFIG_DIR=${CLI_FUNCDIR}/${CLI_FUNCDIRNAM}/Config + + # Interpret arguments and options passed through command-line. + prepare_getOptions + + # Redefine positional parameters using ARGUMENTS. At this point, + # option arguments have been removed from ARGUMENTS variable and + # only non-option arguments remain in it. + eval set -- "$ARGUMENTS" + + # Execute action names based on whether they were provided or not. + if [[ $ACTIONNAMS == '' ]];then + + # When action names are not provided, define action names that + # will take place, explicitly. + prepare_updateEnvironment + prepare_updatePackages + prepare_updateLocales + prepare_updateLinks + prepare_updateImages + prepare_updateManuals + + else + + # When action names are provided, loop through them and + # execute them one by one. + for ACTIONNAM in $ACTIONNAMS;do + ${ACTIONNAM} $@ + done + + fi + +} diff --git a/Automation/centos-art.sh-mods/Prepare/prepare_getEnvars.sh b/Automation/centos-art.sh-mods/Prepare/prepare_getEnvars.sh new file mode 100755 index 0000000..345bd34 --- /dev/null +++ b/Automation/centos-art.sh-mods/Prepare/prepare_getEnvars.sh @@ -0,0 +1,66 @@ +#!/bin/bash +# +# prepare_getEnvars.sh -- This function outputs a brief description of +# relevant environment variables used by `centos-art.sh' script. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function prepare_getEnvars { + + local -a VARS + local -a INFO + local COUNT=0 + + # Define name of environment variables used by centos-art.sh + # script. + VARS[0]='EDITOR' + VARS[1]='TZ' + VARS[2]='TEXTDOMAIN' + VARS[3]='TEXTDOMAINDIR' + VARS[4]='LANG' + + # Define description of environment variables. + INFO[0]="`gettext "Default text editor"`" + INFO[1]="`gettext "Default time zone representation"`" + INFO[2]="`gettext "Default domain used to retrieve translated messages"`" + INFO[3]="`gettext "Default directory used to retrive translated messages"`" + INFO[4]="`gettext "Default locale information"`" + + until [[ $COUNT -eq ${#VARS[*]} ]];do + + # Let user to reduce output using regular expression as + # reference. + if [[ ${VARS[$COUNT]} =~ $FLAG_FILTER ]];then + + # Output list of environment variables using indirect + # expansion (what a beautiful feature!) to output variable + # value. + cli_printMessage "${INFO[$COUNT]}:" + cli_printMessage "${VARS[$COUNT]}=${!VARS[$COUNT]}" --as-response-line + + fi + + # Increment counter. + COUNT=$(($COUNT + 1)) + + done + +} diff --git a/Automation/centos-art.sh-mods/Prepare/prepare_getLinkName.sh b/Automation/centos-art.sh-mods/Prepare/prepare_getLinkName.sh new file mode 100755 index 0000000..e14dbbf --- /dev/null +++ b/Automation/centos-art.sh-mods/Prepare/prepare_getLinkName.sh @@ -0,0 +1,56 @@ +#!/bin/bash +# +# prepare_getLinkName.sh -- This function standardizes link name +# construction. For the construction sake, two arguments are required, +# one to now the file's base directory, and another holding the file's +# absolute path. With this information, the base directory is removed +# from file's absolute path and the remaining path is transformed into +# a file name where each slash is converted into minus sign. +# +# For example, if the following information is provided: +# +# ARG1: /home/centos/artwork/Identity/Brushes +# ARG2: /home/centos/artwork/Identity/Brushes/Corporate/symbol.gbr +# +# the result will be: `corporate-symbol.gbr'. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function prepare_getLinkName { + + local LINK_BASEDIR='' + local LINK_ABSPATH='' + local LINK_CHARSEP='' + + # Define absolute path to link's base directory. + LINK_BASEDIR="$1" + + # Define absolute path to link's file. + LINK_ABSPATH="$2" + + # Define character used as word separator on file name. + LINK_CHARSEP='-' + + # Output link name. + echo "$LINK_ABSPATH" | sed -r "s!^${LINK_BASEDIR}/!!" \ + | tr '[:upper:]' '[:lower:]' | sed -r "s!/!${LINK_CHARSEP}!g" + +} diff --git a/Automation/centos-art.sh-mods/Prepare/prepare_getOptions.sh b/Automation/centos-art.sh-mods/Prepare/prepare_getOptions.sh new file mode 100755 index 0000000..7fc5c50 --- /dev/null +++ b/Automation/centos-art.sh-mods/Prepare/prepare_getOptions.sh @@ -0,0 +1,128 @@ +#!/bin/bash +# +# prepare_getOptions.sh -- This function parses command options +# provided to `centos-art.sh' script when the first argument in the +# command-line is the `prepare' word. To parse options, this function +# makes use of getopt program. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function prepare_getOptions { + + # Define short options we want to support. + local ARGSS="h,q" + + # Define long options we want to support. + local ARGSL="help,quiet,answer-yes,packages,locales,links,images,manuals,directories,set-environment,see-environment,synchronize" + + # Redefine ARGUMENTS using getopt(1) command parser. + cli_parseArguments + + # Reset positional parameters using output from (getopt) argument + # parser. + eval set -- "$ARGUMENTS" + + # Look for options passed through command-line. + while true; do + case "$1" in + + -h | --help ) + cli_runFnEnvironment help --read --format="texinfo" "tcar-fs::scripts:bash-functions-prepare" + shift 1 + exit + ;; + + -q | --quiet ) + FLAG_QUIET="true" + shift 1 + ;; + + --answer-yes ) + FLAG_ANSWER="true" + shift 1 + ;; + + --set-environment ) + ACTIONNAMS="${ACTIONNAMS} prepare_updateEnvironment" + shift 1 + ;; + + --see-environment ) + ACTIONNAMS="${ACTIONNAMS} prepare_seeEnvironment" + shift 1 + ;; + + --packages ) + ACTIONNAMS="${ACTIONNAMS} prepare_updatePackages" + shift 1 + ;; + + --locales ) + ACTIONNAMS="${ACTIONNAMS} prepare_updateLocales" + shift 1 + ;; + + --links ) + ACTIONNAMS="${ACTIONNAMS} prepare_updateLinks" + shift 1 + ;; + + --images ) + ACTIONNAMS="${ACTIONNAMS} prepare_updateImages" + shift 1 + ;; + + --manuals ) + ACTIONNAMS="${ACTIONNAMS} prepare_updateManuals" + shift 1 + ;; + + --directories ) + ACTIONNAMS="${ACTIONNAMS} prepare_updateDirectoryStructure" + shift 1 + ;; + + --synchronize ) + FLAG_SYNCHRONIZE="true" + shift 1 + ;; + + -- ) + # Remove the `--' argument from the list of arguments + # in order for processing non-option arguments + # correctly. At this point all option arguments have + # been processed already but the `--' argument still + # remains to mark ending of option arguments and + # beginning of non-option arguments. The `--' argument + # needs to be removed here in order to avoid + # centos-art.sh script to process it as a path inside + # the repository, which obviously is not. + shift 1 + break + ;; + + esac + done + + # Redefine ARGUMENTS variable using current positional parameters. + cli_parseArgumentsReDef "$@" + +} diff --git a/Automation/centos-art.sh-mods/Prepare/prepare_seeEnvironment.sh b/Automation/centos-art.sh-mods/Prepare/prepare_seeEnvironment.sh new file mode 100755 index 0000000..b0d98cf --- /dev/null +++ b/Automation/centos-art.sh-mods/Prepare/prepare_seeEnvironment.sh @@ -0,0 +1,68 @@ +#!/bin/bash +# +# prepare_seeEnvironment.sh -- This function outputs a brief description of +# relevant environment variables used by `centos-art.sh' script. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function prepare_seeEnvironment { + + local -a VARS + local -a INFO + local COUNT=0 + + # Define name of environment variables used by centos-art.sh + # script. + VARS[0]='EDITOR' + VARS[1]='TZ' + VARS[2]='TEXTDOMAIN' + VARS[3]='TEXTDOMAINDIR' + VARS[4]='LANG' + VARS[5]='TCAR_WORKDIR' + + # Define description of environment variables. + INFO[0]="`gettext "Default text editor"`" + INFO[1]="`gettext "Default time zone representation"`" + INFO[2]="`gettext "Default domain used to retrieve translated messages"`" + INFO[3]="`gettext "Default directory used to retrive translated messages"`" + INFO[4]="`gettext "Default locale information"`" + INFO[5]="`gettext "Default path to your working copy"`" + + until [[ $COUNT -eq ${#VARS[*]} ]];do + + # Let user to reduce output using regular expression as + # reference. + if [[ ${VARS[$COUNT]} =~ $FLAG_FILTER ]];then + + # Output list of environment variables using indirect + # expansion (what a beautiful feature!) to output variable + # value. + cli_printMessage "${INFO[$COUNT]}:" + cli_printMessage "${VARS[$COUNT]}=${!VARS[$COUNT]}" --as-response-line + + fi + + # Increment counter. + COUNT=$(($COUNT + 1)) + + done + +} diff --git a/Automation/centos-art.sh-mods/Prepare/prepare_updateDirectoryStructure.sh b/Automation/centos-art.sh-mods/Prepare/prepare_updateDirectoryStructure.sh new file mode 100755 index 0000000..b7c8f7f --- /dev/null +++ b/Automation/centos-art.sh-mods/Prepare/prepare_updateDirectoryStructure.sh @@ -0,0 +1,111 @@ +#!/bin/bash +# +# prepare_updateDirectoryStructure.sh -- This function standardizes +# the relation between source directory structures and target +# directory structures inside the repository. This function takes +# source and target paths as arguments, analyses them and builds the +# target directory structure based on source directory structure. This +# function must be executed before executing production functions like +# render. +# +# In order for this verification to work, all source directory +# structures provided must be organized using one directory level more +# than its related target directory. The purpose of this directory is +# content categorization. For example, consider the following path: +# +# ---------------++++++++++++++++++++++++ +# ${SOURCE_PATH}/${CATEGORY}/${COMPONENT} +# ---------------++++++++++++++++++++++++ +# ++++++++++++++++++++++++++++++++++------------ +# ${TARGET_PATH}/${NAME}/${VERSION}/${COMPONENT} +# ++++++++++++++++++++++++++++++++++------------ +# +# So we end with the following path: +# +# ${TARGET_PATH}/${CATEGORY}/${COMPONENT} +# +# In this path, ${CATEGORY} makes reference to a categorization +# directory used to describe source components related to target +# components. However, in the target side, such ${CATEGORY} directory +# is not needed and should be removed from it in order to get the +# final target path, which is: +# +# ${TARGET_PATH}/${COMPONENT} +# +# ${CATEGORY} is always a one-level directory, but ${COMPONENT} might +# have several levels deep. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function prepare_updateDirectoryStructure { + + # Define absolute path to design models' directory structure. This + # directory contains the directory structure you want to verify + # inside target path. + local SOURCE_PATH=$(cli_checkRepoDirSource "${1}") + + # Verify existence source path, just to be sure it was passed and + # it is a valid directory. + cli_checkFiles ${SOURCE_PATH} -d + + # Define absolute path to directory inside the repository where + # you want to replicate the source path directory structure. + local TARGET_PATH=$(cli_checkRepoDirSource "${2}") + + # NOTE: It is possible that target path doesn't exist. So verify + # the relation between target and source path. If there is a + # source path for the target, create an empty directory as target, + # using the related source directory as reference. + + # Define list of directories inside source path. + local SOURCE_DIRS=$(cli_getFilesList ${SOURCE_PATH} \ + --pattern='.+/[[:alpha:]]+$' --type=d) + + # Iterate through directories inside source path and verify + # whether or not they exist in the target path. If they don't + # exist create them. + for SOURCE_DIR in ${SOURCE_DIRS};do + + local SOURCE_DIR_BASENAME=$(echo ${SOURCE_DIR} \ + | sed -r "s,${SOURCE_PATH}/,,") + + local TARGET_DIR=${TARGET_PATH}/${SOURCE_DIR_BASENAME} + + if [[ ${SOURCE_DIR} == ${SOURCE_DIR_BASENAME} ]];then + continue + fi + + # Keep this for debugging ;) + #echo '---' + #echo $SOURCE_DIR_BASENAME; + #echo $SOURCE_DIR; + #echo $TARGET_DIR; + #echo $TARGET_PATH; + #echo '---' + #continue + + if [[ ! -d ${TARGET_DIR} ]];then + mkdir -p ${TARGET_DIR} + fi + + done + +} diff --git a/Automation/centos-art.sh-mods/Prepare/prepare_updateEnvironment.sh b/Automation/centos-art.sh-mods/Prepare/prepare_updateEnvironment.sh new file mode 100755 index 0000000..9128015 --- /dev/null +++ b/Automation/centos-art.sh-mods/Prepare/prepare_updateEnvironment.sh @@ -0,0 +1,72 @@ +#!/bin/bash +# +# prepare_updateEnvironment.sh -- This function updates the +# `~/.bash_profile' file to provide default configuration values to +# centos-art.sh script. Those values which aren't set by this function +# are already set in the `bash_profile.conf' template file we use as +# reference to create the `~/.bash_profile' file. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function prepare_updateEnvironment { + + # Verify that centos-art.sh script is run using an absolute path. + # We use this information to determine the exact working copy + # location to use, later when `bash_profile' file is created. + if [[ ! $0 =~ "^${HOME}/.+/${CLI_NAME}.sh$" ]];then + cli_printMessage "`gettext "To set environment variables you should run centos-art.sh using its abosolute path."`" --as-error-line + fi + + local PROFILE=bash_profile + local SOURCE=${PREPARE_CONFIG_DIR}/${PROFILE}.conf + local TARGET=${HOME}/.${PROFILE} + + # Determine the repository absolute path using the script absolute + # path the script has been executed from. Be careful when you use + # the centos-art command. It points to ~/bin directory which is + # not (and must not be) the repository working copy absolute path. + if [[ $TCAR_WORKDIR =~ "^${HOME}/bin" ]];then + cli_printMessage "`eval_gettext "The repository working directory cannot be $HOME/bin"`" --as-error-line + else + local TCAR_WORKDIR=$(dirname "$0" | sed "s,/${TCAR_BASHSCRIPTS},,") + fi + + # Determine which is the brand information that will be used as + # repository brand information. By default we are using `centos' + # and shouldn't be change to anything else, at least if you + # pretend to produce content for The CentOS Project. + local TCAR_BRAND='centos' + + # Print action message. + cli_printMessage "${TARGET}" --as-updating-line + + # Copy default configuration file to its final destination. Note + # that we are not making a link here in order for different users + # to be able of using different values in their own environments. + cp -f $SOURCE $TARGET + + # Update bash_profile file with default values. + sed -i -r \ + -e "s,^(TCAR_WORKDIR=).*,\1${TCAR_WORKDIR}," \ + -e "s,^(TCAR_BRAND=).*,\1${TCAR_BRAND}," \ + ${TARGET} + +} diff --git a/Automation/centos-art.sh-mods/Prepare/prepare_updateImages.sh b/Automation/centos-art.sh-mods/Prepare/prepare_updateImages.sh new file mode 100755 index 0000000..6b5b030 --- /dev/null +++ b/Automation/centos-art.sh-mods/Prepare/prepare_updateImages.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# +# prepare_updateImages.sh -- This option initializes image files inside +# the working copy. When you provide this option, the centos-art.sh +# scripts renders image files from all design models available in the +# working copy. This step is required in order to satisfy dependencies +# from different components inside the working copy. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function prepare_updateImages { + + # Define list of directories that need to be rendered. + local DIRS=$(cli_getFilesList \ + ${TCAR_WORKDIR}/Identity/Images --maxdepth="1" \ + --mindepth="1" --type="d" --pattern=".+/[[:alnum:]]+") + + # CAUTION: The order in which the image components are rendered is + # very important. For example, in order for theme images to hold + # the branding information the `Identity/Images/Brands' directory + # must be rendered before the `Identity/Images/Themes' directory. + # The reason of this is that brand images are not draw inside + # theme design models themselves, but combined with theme images + # using the ImageMagick tool suite once both have been rendered. + + # Update list of directories to be sure that brands will always be + # rendered as first image component. Here we remove the brand + # component from the list and add it explicitly on top of all + # other directories in the list. + DIRS="${TCAR_WORKDIR}/Identity/Images/Brands + $(echo "$DIRS" | grep -v 'Identity/Images/Brands')" + + # Render image components using the list of directories. + cli_runFnEnvironment render ${DIRS} --with-brands + +} diff --git a/Automation/centos-art.sh-mods/Prepare/prepare_updateLinks.sh b/Automation/centos-art.sh-mods/Prepare/prepare_updateLinks.sh new file mode 100755 index 0000000..70a18fb --- /dev/null +++ b/Automation/centos-art.sh-mods/Prepare/prepare_updateLinks.sh @@ -0,0 +1,183 @@ +#!/bin/bash +# +# prepare_updateLinks.sh -- This option creates/updates the symbolic links +# information required in your workstation to connect it with the +# files inside the working copy of The CentOS Artwork Repository. When +# you provide this option, the centos-art.sh put itself into your +# system's execution path and make common brushes, patterns, palettes +# and fonts available inside applications like GIMP, so you can make +# use of them without loosing version control over them. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function prepare_updateLinks { + + local -a LINKS_SRC + local -a LINKS_DST + local USERFILES='' + local PALETTE='' + local BRUSH='' + local PATTERN='' + local FONT='' + local FILE='' + local COUNT=0 + + # Define user's directories. Here is where configuration links are + # created in the local workstation. + local GIMP_DIR=${HOME}/.$(rpm -q gimp | cut -d. -f-2) + local GIMP_DIR_BRUSHES=${GIMP_DIR}/brushes + local GIMP_DIR_PALETTES=${GIMP_DIR}/palettes + local GIMP_DIR_PATTERNS=${GIMP_DIR}/patterns + local INKS_DIR=${HOME}/.inkscape + local INKS_DIR_PALETTES=${INKS_DIR}/palettes + local FONT_DIR=${HOME}/.fonts + local APPS_DIR=${HOME}/bin + + # Define the working copy directory structure. Here is where user + # specific configuration links in the workstation will point to. + local WCDIR=${TCAR_WORKDIR}/Identity + local WCDIR_BRUSHES=${WCDIR}/Brushes + local WCDIR_PALETTES=${WCDIR}/Palettes + local WCDIR_PATTERNS=${WCDIR}/Patterns + local WCDIR_FONTS=${WCDIR}/Fonts + local WCDIR_EDITOR=${PREPARE_CONFIG_DIR} + + # Verify required working copy directory structure. If these + # directories don't exist, there isn't a target location where + # configuration links can point to. To prevent such an issue + # output an error message and stop the script execution after it. + for DIR in $(echo "Brushes Palettes Patterns Fonts");do + cli_checkFiles ${WCDIR}/${DIR} + done + + # Define link relation for cli. + LINKS_SRC[((++${#LINKS_SRC[*]}))]=${APPS_DIR}/${CLI_NAME} + LINKS_DST[((++${#LINKS_DST[*]}))]=${CLI_BASEDIR}/${CLI_NAME}.sh + USERFILES="${APPS_DIR}/${CLI_NAME}" + + # Define link relation for fonts. + for FONT in $(cli_getFilesList "${WCDIR_FONTS}" --pattern='^.+\.ttf$');do + LINKS_SRC[((++${#LINKS_SRC[*]}))]=${FONT_DIR}/$(basename $FONT) + LINKS_DST[((++${#LINKS_DST[*]}))]=${FONT} + done + + # Define link relation for common palettes. + for PALETTE in $(cli_getFilesList "${WCDIR_PALETTES}" --pattern="^.+\.gpl$");do + LINKS_SRC[((++${#LINKS_SRC[*]}))]=${GIMP_DIR_PALETTES}/$(prepare_getLinkName ${WCDIR_PALETTES} ${PALETTE}) + LINKS_DST[((++${#LINKS_DST[*]}))]=${PALETTE} + LINKS_SRC[((++${#LINKS_SRC[*]}))]=${INKS_DIR_PALETTES}/$(prepare_getLinkName ${WCDIR_PALETTES} ${PALETTE}) + LINKS_DST[((++${#LINKS_DST[*]}))]=${PALETTE} + done + + # Define link relation for common brushes. + for BRUSH in $(cli_getFilesList "${WCDIR_BRUSHES}" --pattern="^.+\.(gbr|gih)$");do + LINKS_SRC[((++${#LINKS_SRC[*]}))]=${GIMP_DIR_BRUSHES}/$(prepare_getLinkName ${WCDIR_BRUSHES} ${BRUSH}) + LINKS_DST[((++${#LINKS_DST[*]}))]=${BRUSH} + done + + # Define link relation for common patterns. + for PATTERN in $(cli_getFilesList "${WCDIR_PATTERNS}" --pattern="^.+\.png$");do + LINKS_SRC[((++${#LINKS_SRC[*]}))]=${GIMP_DIR_PATTERNS}/$(prepare_getLinkName ${WCDIR_BRUSHES} ${BRUSH}) + LINKS_DST[((++${#LINKS_DST[*]}))]=${PATTERN} + done + + # Define link relation for Vim text editor's configuration. + if [[ $EDITOR == '/usr/bin/vim' ]];then + LINKS_SRC[((++${#LINKS_SRC[*]}))]=${HOME}/.vimrc + LINKS_DST[((++${#LINKS_DST[*]}))]=${WCDIR_EDITOR}/vim.conf + USERFILES="${USERFILES} ${HOME}/.vimrc" + fi + + # Define link relation for the `reset.css' file. The `reset.css' + # file is resets the web browser default style and use ours + # instead. The reset.css file is common for all web environments + # so there is no need to have duplicated files inside the working + # copy. Instead, create a symbolic link to it from different + # places using absolute paths and the default style guide as + # reference. + LINKS_SRC[((++${#LINKS_SRC[*]}))]=${TCAR_WORKDIR}/Identity/Webenv/Themes/Default/Docbook/1.69.1/Css/reset.css + LINKS_DST[((++${#LINKS_DST[*]}))]=${TCAR_WORKDIR}/Identity/Webenv/Themes/Default/Style-guide/0.0.1/Css/reset.css + + # Define link relation for `images' directory used inside the + # default web environment style guide. The `images' directory + # contains common images used by all web environments. By default + # no image is under version control so we point out the output + # directory where this images produced, once rendered. + LINKS_SRC[((++${#LINKS_SRC[*]}))]=${TCAR_WORKDIR}/Identity/Webenv/Themes/Default/Style-guide/0.0.1/Images + LINKS_DST[((++${#LINKS_DST[*]}))]=${TCAR_WORKDIR}/Identity/Images/Webenv + + # Define link relation for `Manuals' images. These images exists + # to help people describe ideas inside documentation. + LINKS_SRC[((++${#LINKS_SRC[*]}))]=${TCAR_WORKDIR}/Identity/Images/Webenv/Manuals + LINKS_DST[((++${#LINKS_DST[*]}))]=${TCAR_WORKDIR}/Identity/Images/Manuals + + # Define link for `centos-logo.png', the branding information that + # should be used in all web applications on the left-top corner. + LINKS_SRC[((++${#LINKS_SRC[*]}))]=${TCAR_WORKDIR}/Identity/Images/Webenv/logo-centos.png + LINKS_DST[((++${#LINKS_DST[*]}))]=${TCAR_WORKDIR}/Identity/Images/Brands/Logos/White/78/centos.png + + # Define which files inside the user's configuration directories + # need to be removed in order for centos-art.sh script to make a + # fresh installation of common patterns, common palettes and + # common brushes using symbolic links from the working copy to the + # user's configuration directories inside the workstation. + USERFILES=$(echo "$USERFILES"; + cli_getFilesList ${APPS_DIR} --pattern='^.+\.sh$'; + cli_getFilesList ${FONT_DIR} --pattern='^.+\.ttf$'; + cli_getFilesList ${GIMP_DIR_BRUSHES} --pattern='^.+\.(gbr|gih)$'; + cli_getFilesList ${GIMP_DIR_PATTERNS} --pattern='^.+\.(pat|png|jpg|bmp)$'; + cli_getFilesList ${GIMP_DIR_PALETTES} --pattern='^.+\.gpl$'; + cli_getFilesList ${INKS_DIR_PALETTES} --pattern='^.+\.gpl$';) + + # Remove user-specific configuration files from user's home + # directory before creating symbolic links from the working copy. + # Otherwise, we might end up having links inside the user's home + # directory that don't exist inside the working copy. + if [[ "$USERFILES" != '' ]];then + rm -r $USERFILES + fi + + while [[ $COUNT -lt ${#LINKS_SRC[*]} ]];do + + # Print action message. + cli_printMessage "${LINKS_SRC[$COUNT]}" --as-creating-line + + # Create symbolic link's parent directory if it doesn't exist. + if [[ ! -d $(dirname ${LINKS_SRC[$COUNT]}) ]];then + mkdir -p $(dirname ${LINKS_SRC[$COUNT]}) + fi + + # Remove symbolic link before creating it to prevent recursive + # creation once the first symbolic link be created and it be a + # directory. + if [[ -a ${LINKS_SRC[$COUNT]} ]];then + rm ${LINKS_SRC[$COUNT]} + fi + + # Create symbolic link. + ln ${LINKS_DST[$COUNT]} ${LINKS_SRC[$COUNT]} --symbolic --force + + # Increment counter. + COUNT=$(($COUNT + 1)) + + done + +} diff --git a/Automation/centos-art.sh-mods/Prepare/prepare_updateLocales.sh b/Automation/centos-art.sh-mods/Prepare/prepare_updateLocales.sh new file mode 100755 index 0000000..bb66e22 --- /dev/null +++ b/Automation/centos-art.sh-mods/Prepare/prepare_updateLocales.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# +# prepare_updateLocales.sh -- This function creates/updates the +# machine object (.mo) file gettext uses to output translated messages +# when centos-art.sh script is running. Certainly, what this function +# really does is a call to the locale functionality of centos-art.sh +# script to realize and update action against itself. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function prepare_updateLocales { + + # Realize localization tasks only when the current locale + # information is different to English language. Otherwise + # centos-art.sh would complain with an `English language cannot be + # localized to itself' message. Avoid this noise in the + # preparation stuff. + if [[ ! ${CLI_LANG_LL} =~ '^en' ]];then + cli_runFnEnvironment locale Scripts/Bash --update + fi + +} diff --git a/Automation/centos-art.sh-mods/Prepare/prepare_updateManuals.sh b/Automation/centos-art.sh-mods/Prepare/prepare_updateManuals.sh new file mode 100755 index 0000000..a5f5a40 --- /dev/null +++ b/Automation/centos-art.sh-mods/Prepare/prepare_updateManuals.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# +# prepare_updateManuals.sh -- This option initializes documentation files +# inside the working copy. When you provide this option, the +# centos-art.sh script renders all documentation manuals from their +# related source files so you can read them nicely. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function prepare_updateManuals { + + # Render key documentation manuals. + cli_runFnEnvironment render Documentation/Models/Docbook/Tcar-ug + cli_runFnEnvironment help --update --format="texinfo" tcar-fs::: + +} diff --git a/Automation/centos-art.sh-mods/Prepare/prepare_updatePackages.sh b/Automation/centos-art.sh-mods/Prepare/prepare_updatePackages.sh new file mode 100755 index 0000000..fdf2fc0 --- /dev/null +++ b/Automation/centos-art.sh-mods/Prepare/prepare_updatePackages.sh @@ -0,0 +1,81 @@ +#!/bin/bash +# +# prepare_updatePackages.sh -- This function verifies the required +# packages your workstation needs to have installed in order for +# `centos-art.sh' script to run correctly. If there is one or more +# missing packages, the `centos-art.sh' script asks you to confirm +# their installation through `sudo yum'. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function prepare_updatePackages { + + local PACKAGE='' + local PACKAGES='' + local PACKAGES_THIRDS='' + local -a PACKAGES_MISSING + local -a PACKAGES_INSTALL + local RPM='/bin/rpm' + local YUM='/usr/bin/yum' + local YUM_OPTIONS='' + + # Check execution rights of package managers. + cli_checkFiles -x $RPM + cli_checkFiles -x $YUM + + # Define required packages needed by centos-art.sh script. + PACKAGES="inkscape ImageMagick netpbm netpbm-progs syslinux gimp + coreutils texinfo texinfo-tex info tetex-latex tetex-fonts + tetex-xdvi tetex-dvips gettext texi2html 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 packages from third party repositories (i.e., packages + # not included in CentOS [base] repository.) required by + # centos-art to work as expected. + PACKAGES_THIRDS="(inkscape|blender)" + + # Build list of installed and missing packages. + for PACKAGE in $PACKAGES;do + $RPM -q --queryformat "%{NAME}\n" $PACKAGE --quiet + if [[ $? -ne 0 ]];then + PACKAGES_MISSING[((++${#PACKAGES_MISSING[*]}))]=$PACKAGE + else + PACKAGES_INSTALL[((++${#PACKAGES_INSTALL[*]}))]=$PACKAGE + fi + done + + # Define relation between centos-art.sh options and yum options. + [[ $FLAG_ANSWER == 'true' ]] && YUM_OPTIONS="${YUM_OPTIONS} -y" + [[ $FLAG_QUIET == 'true' ]] && YUM_OPTIONS="${YUM_OPTIONS} -q" + + # Use `sudo yum' to install missing packages in your workstation. + if [[ ${#PACKAGES_MISSING[*]} -gt 0 ]];then + sudo ${YUM} ${YUM_OPTIONS} install ${PACKAGES_MISSING[*]} + fi + + # Use `sudo yum' to update installed packages in your workstation. + if [[ ${#PACKAGES_INSTALL[*]} -gt 0 ]];then + sudo ${YUM} ${YUM_OPTIONS} update ${PACKAGES_INSTALL[*]} + fi + +} diff --git a/Automation/centos-art.sh-mods/Render/Conf/conf.sh b/Automation/centos-art.sh-mods/Render/Conf/conf.sh new file mode 100755 index 0000000..269e016 --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Conf/conf.sh @@ -0,0 +1,121 @@ +#!/bin/bash +# +# conf.sh -- This function standardizes the way images are produced +# from configuration files. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function conf { + + # Initialize local variables. + local MODEL='' + local -a MODELS + local FORMAT='' + local HEIGHT='' + local FGCOLOR='' + local BGCOLOR='' + + # Define list with all section names. These are the final file + # names we want to produce images for. + local FILENAME='' + local FILENAMES=$(cli_getConfigSectionNames $TEMPLATE) + + for FILENAME in $FILENAMES;do + + # Retrieve models you want to produce the image from. Notice + # that relative path passed in this option must point to one + # existent file inside the working copy. + for MODEL in $(cli_getConfigValue "$TEMPLATE" "$FILENAME" "models");do + MODELS[((++${#MODELS[*]}))]=${TCAR_WORKDIR}/${MODEL} + done + + # Retrieve formats you want to produce the image for. This + # variable contains one or more image format supported by + # ImageMagick. For example, `xpm', `jpg', 'tiff', etc. + local FORMATS=$(cli_getConfigValue "$TEMPLATE" "$FILENAME" "formats") + if [[ -z ${FORMATS} ]];then + FORMATS="xpm pdf jpg tif" + fi + + # Retrieve heights you want to produce the image for. This + # variable contains one or more numerical values. For example, + # `16', `24', `32', etc. + local HEIGHTS=$(cli_getConfigValue "$TEMPLATE" "$FILENAME" "heights") + if [[ -z ${HEIGHTS} ]];then + HEIGHTS="16 20 22 24 32 36 38 40 48 64 72 78 96 112 124 128 148 164 196 200 512" + fi + + # Retrieve foreground colors you want to produce the image + # for. This variable contains one or more color number in + # hexadecimal format. For example, `000000', `ffffff', etc. + local FGCOLORS=$(cli_getConfigValue "$TEMPLATE" "$FILENAME" "fgcolors") + if [[ -z ${FGCOLORS} ]];then + FGCOLORS="000000" + fi + + # Retrieve background colors you want to produce the image + # for. This variable contains one or more color number in + # hexadecimal format with opacity information included. + # Opacity is specified between 0.0 and 1.0 where 0.0 is full + # transparency and 1.0 full opacity. For example, the + # following values are accepted: `000000-0', `ffffff-1', etc. + local BGCOLORS=$(cli_getConfigValue "$TEMPLATE" "$FILENAME" "bgcolors") + if [[ -z ${BGCOLORS} ]];then + BGCOLORS="000000-0" + fi + + # Retrieve command-line you want execute to produce the image. + # For example, `/usr/bin/convert +append' + local COMMAND=$(cli_getConfigValue "$TEMPLATE" "$FILENAME" "command") + if [[ -z ${COMMAND} ]];then + COMMAND=/bin/cp + fi + + for FGCOLOR in $FGCOLORS;do + + # Verify value passed as foreground color. + cli_checkFiles ${FGCOLOR} --match="^[a-fA-F0-9]{3,6}$" + + for BGCOLOR in $BGCOLORS;do + + # Verify value passed as background color. + cli_checkFiles ${BGCOLOR} --match="^[a-fA-F0-9]{6}-(0|1)$" + + for HEIGHT in $HEIGHTS;do + + # Verify value passed as height. + cli_checkFiles ${HEIGHT} --match="^[[:digit:]]+$" + + # Do base rendition actions. + conf_setBaseRendition + + done + done + done + + # Reset models list to prevent it from growing for each file + # name (configuration section) iteration and create this way + # unexpected images as final result. + unset MODELS + + done + +} diff --git a/Automation/centos-art.sh-mods/Render/Conf/conf_setBaseRendition.sh b/Automation/centos-art.sh-mods/Render/Conf/conf_setBaseRendition.sh new file mode 100755 index 0000000..4962373 --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Conf/conf_setBaseRendition.sh @@ -0,0 +1,126 @@ +#!/bin/bash +# +# conf_setBaseRendition.sh -- This function standardizes base actions +# related to image production through configuration files. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function conf_setBaseRendition { + + local COUNTER=0 + local EXPORTID="CENTOSARTWORK" + local -a MODEL_INSTANCES + local -a IMAGE_INSTANCES + local -a IMAGE_COMMANDS + + # Define absolute path to output location. This is the location + # inside the working copy all images will be stored in. + local OUTPUT=${OUTPUT}/${FGCOLOR}/${BGCOLOR}/${HEIGHT}/${FILENAME} + + # Define which command will be used to output the template + # content. This is required because template files might be found + # as compressed files inside the repository. + local VIEWER="/bin/cat" + + while [[ $COUNTER -lt ${#MODELS[*]} ]];do + + # Verify existence and extension of design models. + cli_checkFiles ${MODELS[$COUNTER]} -f --match='\.(svgz|svg)$' + + # Define file name for design model instances. We need to use + # a random string in from of it to prevent duplication. + # Remember that different files can have the same name in + # different locations. Use the correct file information. + MODEL_INSTANCES[$COUNTER]=${TMPDIR}/${RANDOM}-$(basename ${MODELS[$COUNTER]}) + + # Define file name for image instances. We need to use a + # random string in from of it to prevent duplication. + # Remember that different files can have the same name in + # different locations. Use the correct file information. + IMAGE_INSTANCES[$COUNTER]=${TMPDIR}/${RANDOM}-$(basename ${MODELS[$COUNTER]} \ + | sed -r 's/\.(svgz|svg)$/.png/') + + # Redefine command used to read design models. + if [[ $(file -b -i ${MODELS[$COUNTER]}) =~ '^application/x-gzip$' ]];then + VIEWER="/bin/zcat" + fi + + # Create uncompressed design model instances in order to make + # color replacements without affecting original design models. + $VIEWER ${MODELS[$COUNTER]} > ${MODEL_INSTANCES[$COUNTER]} + + # Make your best to be sure the design model instance you are + # processing is a valid scalable vector graphic. + cli_checkFiles ${MODEL_INSTANCES[$COUNTER]} --mime="text/xml" + + # Make color replacements to each design model instance before + # render them using Inkscape. + if [[ ${FGCOLOR} != '000000' ]];then + sed -i -r "s/((fill|stroke):#)000000/\1${FGCOLOR}/g" ${MODEL_INSTANCES[$COUNTER]} + fi + + # Create list of Inkscape commands based for each design model + # set in the configuration file. + IMAGE_COMMANDS[${COUNTER}]="${MODEL_INSTANCES[$COUNTER]} \ + --export-id=${EXPORTID} \ + --export-png=${IMAGE_INSTANCES[$COUNTER]} \ + --export-background=$(echo ${BGCOLOR} | cut -d'-' -f1) \ + --export-background-opacity=$(echo ${BGCOLOR} | cut -d'-' -f2) \ + --export-height=${HEIGHT}" + + # Create PNG image based on design models. + inkscape ${IMAGE_COMMANDS[$COUNTER]} > /dev/null + + COUNTER=$(( $COUNTER + 1 )) + + done + + cli_printMessage "${OUTPUT}" --as-creating-line + + # Verify existence of output directory. + if [[ ! -d $(dirname ${OUTPUT}) ]];then + mkdir -p $(dirname ${OUTPUT}) + fi + + # Apply command to PNG images produced from design models to + # construct the final PNG image. + ${COMMAND} ${IMAGE_INSTANCES[*]} ${OUTPUT} + + # Remove instances to save disk space. There is no need to have + # unused files inside the temporal directory. They would be + # consuming space unnecessarily. Moreover, there is a remote + # chance of name collapsing (because the huge number of files that + # would be in place and the week random string we are putting in + # front of files) which may produce unexpected results. + rm ${IMAGE_INSTANCES[*]} ${MODEL_INSTANCES[*]} + + # Create path for different image formats creation using PNG image + # extension as reference. + local TARGET=$(echo ${OUTPUT} | sed -r "s/\.png$//") + + # Convert images from PNG to those formats specified in the + # configuration file. + for FORMAT in ${FORMATS};do + cli_printMessage "${TARGET}.${FORMAT}" --as-creating-line + convert ${OUTPUT} ${TARGET}.${FORMAT} + done + +} diff --git a/Automation/centos-art.sh-mods/Render/Docbook/docbook.sh b/Automation/centos-art.sh-mods/Render/Docbook/docbook.sh new file mode 100755 index 0000000..0cb4d7f --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Docbook/docbook.sh @@ -0,0 +1,106 @@ +#!/bin/bash +# +# docbook.sh -- This function performs base-rendition actions for +# DocBook files. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function docbook { + + # Define absolute path to XSL files used for transforming DocBook + # into other formats. + local DOCBOOK_XSL="${TCAR_WORKDIR}/Identity/Webenv/Themes/Default/Docbook/1.69.1/Xsl" + + # Define absolute path to DocBook models. This path must take + # until the directory which holds the main documentation docbook + # file. + local DOCBOOK_MODELS="$(dirname ${TEMPLATE})" + + # Verify absolute path to DocBook models. + cli_checkFiles ${DOCBOOK_MODELS} -d + + # Create the non-translated instance of design model. + cp ${TEMPLATE} ${INSTANCE} + + # Expand common contents inside instance. + docbook_setExpansionLicenses ${INSTANCE} + + # When translated instances are rendered, system entities (e.g., + # `%entity-name;') don't appear in the translated instance (it + # seems that xml2po removes them) and this provokes DocBook + # validation to fail. So in order to pass the validation + # successfully and automate the whole creation of system entities, + # don't let this duty ion users'. Instead, make centos-art.sh + # script responsible of it. + docbook_setExpansionSystemEntities ${INSTANCE} + + # Print validating action. + cli_printMessage "${INSTANCE}" --as-validating-line + + # Validate translated instance before processing it. This step is + # very important in order to detect document's malformations and + # warn you about it, so you can correct them. It is also necessary + # to save them in a new file in order to make translation markers + # expansion possible before transforming the DocBook instance into + # other formats. + xmllint --valid --noent ${INSTANCE} > ${INSTANCE}.tmp + if [[ $? -ne 0 ]];then + cli_printMessage "`gettext "Validation failed."`" --as-error-line + fi + + # Update instance to add translation markers expansion. + mv ${INSTANCE}.tmp ${INSTANCE} + + # Expand translation markers on the temporal instance with + # entities already expanded. + cli_expandTMarkers ${INSTANCE} + + # Verify translation file existence apply translation to docbook + # design model instance in order to produce the translated design + # model instance. + if [[ -f ${TRANSLATION} ]];then + docbook_setTranslation ${INSTANCE} + fi + + # Convert DocBook source files to other formats. + docbook_setConversionXhtmlChunks ${INSTANCE} + docbook_setConversionXhtml ${INSTANCE} + docbook_setConversionText + + # NOTE: The current transformation from DocBook to PDF fails when + # we started to use DocBook tags inside DocBook files. + # Probably we need to test what happen when a newer release of XSL + # is used. Thus, comment production of PDF files until it can be + # produced correctly. + #docbook_setConversionXml2Pdf + + # NOTE: From version 5.0 on, DocBook specification is no longer a + # SGML specification but an XML specification only. Thus, + # transformations related to DocBook SGML specification won't be + # supported in `centos-art.sh' script. + + # Perform format post-rendition. + docbook_setPostRendition + + # Perform format last-rendition. + docbook_setLastRendition + +} diff --git a/Automation/centos-art.sh-mods/Render/Docbook/docbook_setConversionText.sh b/Automation/centos-art.sh-mods/Render/Docbook/docbook_setConversionText.sh new file mode 100755 index 0000000..7c4673c --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Docbook/docbook_setConversionText.sh @@ -0,0 +1,70 @@ +#!/bin/bash +# +# svg_convertToText.sh -- This function takes the XHTML file produced +# by docbook_setConversionXhtml and produces one plain-text file (i.e., +# without markup inside). +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function docbook_setConversionText { + + # Verify existence of HTML file. If `.xhtml' file doesn't exist + # don't create text file. The `.xhtml' file is required in order + # to create the `.txt' file. + if [[ ! -f ${FILE}.xhtml ]];then + return + fi + + local COMMAND='' + local OPTIONS='' + + # Define the command path to text-based web browser and options + # used to produce plain-text files. Most of these programs have a + # dump option that print formatted plain-text versions of given + # HTML file to stdout. + if [[ -x '/usr/bin/lynx' ]];then + COMMAND='/usr/bin/lynx' + OPTIONS='-force_html -nolist -width 70 -dump' + elif [[ -x '/usr/bin/elinks' ]];then + COMMAND='/usr/bin/elinks' + OPTIONS='-force_html -no-numbering -no-references -width 70 -dump' + elif [[ -x '/usr/bin/w3m' ]];then + COMMAND='/usr/bin/w3m' + OPTIONS='-dump' + fi + + if [[ $COMMAND != '' ]];then + + # Print action message. + if [[ -f ${FILE}.txt ]];then + cli_printMessage "${FILE}.txt" --as-updating-line + else + cli_printMessage "${FILE}.txt" --as-creating-line + fi + + # Convert from HTML to plain-text without markup. + ${COMMAND} ${OPTIONS} ${FILE}.xhtml > ${FILE}.txt + + else + cli_printMessage "`gettext "No way to convert from XHTML to plain-text found."`" --as-error-line + fi + +} diff --git a/Automation/centos-art.sh-mods/Render/Docbook/docbook_setConversionXhtml.sh b/Automation/centos-art.sh-mods/Render/Docbook/docbook_setConversionXhtml.sh new file mode 100755 index 0000000..1c9f0a6 --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Docbook/docbook_setConversionXhtml.sh @@ -0,0 +1,79 @@ +#!/bin/bash +# +# docbook_setConversionXhtml.sh -- This function uses DocBook XML as input +# and applies XSL stylesheets to produce a big XHTML files as output. +# The procedure was taken from the documentation of +# `docbook-style-xsl-1.69.1-5.1' package, which says: ---To publish +# HTML from your XML documents, you just need an XSL engine.---. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function docbook_setConversionXhtml { + + local -a STYLE_TEMPLATE + local -a STYLE_INSTANCE + local STYLE_INSTANCE_FINAL='' + + # Define absolute path to DocBook source file. This is the + # repository documentation manual file where DOCTYPE and ENTITY + # definition lines are set. + local SOURCE_FILE=${1} + + # Define absolute path to xhtml target file. This is the final + # location the xhtml file produced as result of DocBook to xhtml + # transformation will be stored in. + local TARGET_FILE=${FILE}-xhtml/$(basename ${FILE}).xhtml + + # Define absolute path to xhtml target file directory. This is the + # location the xhtml target file will be sotred in. + local TARGET_FILE_DIR=$(dirname ${TARGET_FILE}) + + # Print action message. + if [[ -f ${FILE}.xhtml ]];then + cli_printMessage "${TARGET_FILE}" --as-updating-line + else + cli_printMessage "${TARGET_FILE}" --as-creating-line + fi + + # Prepare XSL final instances used in transformations. + docbook_setStyles $(cli_getFilesList \ + ${DOCBOOK_XSL} --pattern='^.*/docbook2xhtml-(single|common)\.xsl$') + + # Clean up output directory. This is required in order to prevent + # old files from remaining therein when they are no longer needed. + if [[ -d ${TARGET_FILE_DIR} ]];then + rm -r "${TARGET_FILE_DIR}" + fi + mkdir ${TARGET_FILE_DIR} + + # Transform DocBook XML to XHTML suppressing all stderr output. + xsltproc --output ${TARGET_FILE} ${STYLE_INSTANCE_FINAL} ${SOURCE_FILE} &> /dev/null + + # Create `css' and `images' directories. In order to save disk + # space, these directories are linked (symbolically) to their + # respective locations inside the working copy. + ln -fs ${TCAR_WORKDIR}/Identity/Webenv/Themes/Default/Docbook/1.69.1/Css ${TARGET_FILE_DIR}/Css + ln -fs ${TCAR_WORKDIR}/Identity/Images/Webenv ${TARGET_FILE_DIR}/Images + + # Remove XSL instance files. + rm ${STYLE_INSTANCE[*]} + +} diff --git a/Automation/centos-art.sh-mods/Render/Docbook/docbook_setConversionXhtmlChunks.sh b/Automation/centos-art.sh-mods/Render/Docbook/docbook_setConversionXhtmlChunks.sh new file mode 100755 index 0000000..4caf61f --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Docbook/docbook_setConversionXhtmlChunks.sh @@ -0,0 +1,73 @@ +#!/bin/bash +# +# docbook_setConversionXhtmlChunks.sh -- This function uses DocBook XML as +# input and applies XSL stylesheets to produce a directory with many +# XHTML files as output. The procedure was taken from the +# documentation of `docbook-style-xsl-1.69.1-5.1' package, which says: +# ---To publish HTML from your XML documents, you just need an XSLT +# engine.---. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function docbook_setConversionXhtmlChunks { + + local -a STYLE_TEMPLATE + local -a STYLE_INSTANCE + local STYLE_INSTANCE_FINAL='' + + # Define absolute path to DocBook source file. This is the + # repository documentation manual file where DOCTYPE and ENTITY + # definition lines are set. + local SOURCE_FILE=${1} + + # Define absolute path to XHTML target file. This is the final + # location the XHTML file produced as result of DocBook to PDF + # transformation will be stored in. + local TARGET_FILE="${FILE}-xhtml-chunks/" + + # Clean up output directory. This is required in order to prevent + # old files from remaining therein when they are no longer needed. + if [[ -d ${TARGET_FILE} ]];then + rm -r "${TARGET_FILE}" + fi + mkdir ${TARGET_FILE} + + # Print action message. + cli_printMessage "${TARGET_FILE}" --as-creating-line + + # Prepare XSL final instances used in transformations. + docbook_setStyles $(cli_getFilesList \ + ${DOCBOOK_XSL} --pattern='^.*/docbook2xhtml-(chunks|common)\.xsl$') + + # Transform DocBook XML to XHTML suppressing all stderr output. + xsltproc --output ${TARGET_FILE} ${STYLE_INSTANCE_FINAL} ${SOURCE_FILE} &> /dev/null + + # Create `css' and `images' directories. In order to save disk + # space, these directories are linked (symbolically) to their + # respective locations inside the working copy. Be sure to remove + # previous links first to prevent a recursive creation of links. + ln -sf ${TCAR_WORKDIR}/Identity/Webenv/Themes/Default/Docbook/1.69.1/Css ${TARGET_FILE}/Css + ln -sf ${TCAR_WORKDIR}/Identity/Images/Webenv ${TARGET_FILE}/Images + + # Remove XSL instance files. + rm ${STYLE_INSTANCE[*]} + +} diff --git a/Automation/centos-art.sh-mods/Render/Docbook/docbook_setConversionXml2Pdf.sh b/Automation/centos-art.sh-mods/Render/Docbook/docbook_setConversionXml2Pdf.sh new file mode 100755 index 0000000..f639e93 --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Docbook/docbook_setConversionXml2Pdf.sh @@ -0,0 +1,113 @@ +#!/bin/bash +# +# docbook_setConversionXml2Pdf.sh -- This function transforms DocBook +# files which have set the XML DTD in them. To produce PDF from +# DocBook XML DTD, we need an XSLT engine (e.g., through `xsltproc' +# command) to produce formatting objects (FO), which then must be +# processed with an FO engine (e.g., through `pdfxmltex' command, +# which uses PassiveTex) to produce the PDF output. +# +# In this configuration and using default configuration settings, I've +# presented the following problems: +# +# 1. Something is wrong with headings. They are not expanded along the +# whole page-body. They seem to be rendered in a reduced width (1 inch +# approximately). This provokes the heading to be broken in a +# two-to-five letters column and sometimes it overlaps the sectioning +# titles (e.g., chapter, section). I tried to customize the value of +# `header.column.widths' and `page.margin.top' but it seems to be not +# there where I need to touch. +# +# 2. TOC's indentation is not rendered. Even the `toc.indent.width' +# property is set to 24 by default. +# +# 3. Inside lists, when items are more than one line, the indentation +# seems to work for the first line only. All other lines in the same +# item are not indented and begin completely unaligned. +# +# 4. Long file paths near the end of page-body aren't hyphenated. +# Even the `hyphenate' property is set to `true' by default. +# +# In this configuration and using default configuration settings, I've +# presented the following advantages: +# +# 1. It is possible to produce localized PDF outputs through +# `xml2po', the default way of producing localized content inside +# the `centos-art.sh' script. +# +# To make the whole process transparent, a temporal directory is +# created for intermediate works and final files are moved then to +# their final location. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function docbook_setConversionXml2Pdf { + + # Print action message. + cli_printMessage "${FILE}.pdf" --as-creating-line + + local -a STYLE_TEMPLATE + local -a STYLE_INSTANCE + local STYLE_INSTANCE_FINAL='' + + # Define absolute path to DocBook source file. This is the + # repository documentation manual file where DOCTYPE and ENTITY + # definition lines are set. + local SRC=${INSTANCE} + + # Define absolute path to PDF target file. This is the final + # location the PDF file produced as result of DocBook to PDF + # transformation will be stored in. + local DST="${FILE}.pdf" + + # Define file name of formatting object (.fo) file. This file is + # an intermediate file needed to produced the PDF. + local FO=$(echo ${INSTANCE} | sed -r 's/docbook$/fo/g') + + # Define file name of PDF file. This is the file we were looking + # for and the one moved, once produced. + local PDF=$(echo ${INSTANCE} | sed -r 's/docbook$/pdf/g') + + # Prepare XSL final instances used in transformations. + docbook_setStyles "${DOCBOOK_XSL}/docbook2fo.xsl" + + # Create link to `Images' directory. This is the directory where + # images used by documentation are stored in. Be sure to remove + # previous links first to prevent a recursive creation of links. + ln -sf ${TCAR_WORKDIR}/Identity/Images/Webenv $(dirname ${INSTANCE})/Images + + # Create formatting object suppressing output from stderr. + xsltproc --output ${FO} ${STYLE_INSTANCE_FINAL} ${SRC} 2> /dev/null + + # Create PDF format from formatting object. Because we are using + # relative path to access `Images', it is necessary to move the + # directory stack into the temporal directory where instance files + # are created. Otherwise, the location used to load images will + # fail. + if [[ $? -eq 0 ]];then + pushd $(dirname ${INSTANCE}) > /dev/null + xmlto -o $(dirname ${FILE}) pdf ${FO} + popd > /dev/null + else + cli_printMessage "`gettext "Cannot produce the PDF file."`" --as-error-line + fi + +} diff --git a/Automation/centos-art.sh-mods/Render/Docbook/docbook_setExpansionLicenses.sh b/Automation/centos-art.sh-mods/Render/Docbook/docbook_setExpansionLicenses.sh new file mode 100755 index 0000000..cb3a032 --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Docbook/docbook_setExpansionLicenses.sh @@ -0,0 +1,73 @@ +#!/bin/bash +# +# docbook_setExpansionLicenses.sh -- This function modifies the final +# DocBook instance to add license information. We are doing this way +# because using XInclude doesn't work and we want to reuse license +# information in all documents. So, if we cannot link the files, we +# modify the final instance and append the license information to it. +# Later, to reuse translation messages, the locale functionality takes +# care of merging po files related to licenses into documentation po +# file so changes made to licenses translations will also be available +# to documentation manuals in different languages. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function docbook_setExpansionLicenses { + + local INSTANCE=$1 + + # Define absolute path to DocBook models. + local DOCBOOK_MODELS="${TCAR_WORKDIR}/Documentation/Models/Docbook" + + # Define list of files holding licenses you want to include. Note + # even this files are not inside the documentation structure + # itself, they are connected with it. The files holding license + # information does contain id information used inside the + # documentation structure at cross references. + local LICENSES="${DOCBOOK_MODELS}/Default/Licenses/Gpl/gpl.docbook \ + ${DOCBOOK_MODELS}/Default/Licenses/Gfdl/gfdl.docbook" + + # Define top level structure in the instance. This is the tag + # defined in the second field of DOCTYPE definition. + local DOCTYPE=$(egrep '^\n" + BLOCK="${BLOCK}\n\n" + BLOCK="${BLOCK}\n`gettext "Licenses"`\n" + BLOCK="${BLOCK}\n$(cat ${LICENSES} | sed -r '/<\?xml/,/]>/d')\n" + BLOCK="${BLOCK}\n\n" + BLOCK="${BLOCK}\n\n" + + # Expand the licenses section. Remove everything in-between + # Licenses and Back matter comment. Recreate the comments to + # support further actualizations and concatenate license + # information without their document type definitions preamble. + # This is required in order to prevent validation errors and reuse + # (through locale functionality) the translation messages already + # available for these license files. Finally, close any open tag. + sed -r -i -e "//,//c$(echo ${BLOCK})" $INSTANCE + +} diff --git a/Automation/centos-art.sh-mods/Render/Docbook/docbook_setExpansionSystemEntities.sh b/Automation/centos-art.sh-mods/Render/Docbook/docbook_setExpansionSystemEntities.sh new file mode 100755 index 0000000..090e09c --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Docbook/docbook_setExpansionSystemEntities.sh @@ -0,0 +1,58 @@ +#!/bin/bash +# +# docbook_setExpansionSystemEntities.sh -- This function expands system +# entities required by DocBook projects stored under +# `Documentation/Manuals' directory. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function docbook_setExpansionSystemEntities { + + # Define absolute path to instance where all operations will take + # place in. + local INSTANCE=$1 + + # Define absolute path to both common and specific system + # entities. + local ENTITIES_PATHS="$(cli_getFilesList ${TCAR_WORKDIR}/Documentation/Models/Docbook/Default/Book $(dirname ${TEMPLATE}) \ + --pattern='^.*/[[:alpha:]-]+\.ent$' --maxdepth=1 --mindepth=1 --type='f')" + + # Build definition of both common and specific system entities. + local ENTITIES="$(\ + for ENTITY_PATH in $ENTITIES_PATHS;do + local ENTITY_NAME=$(basename ${ENTITY_PATH}) + echo '\n\t\n' + echo '\t%'${ENTITY_NAME}';' + done)" + + # Define both xml and docbook public definition. + local PREAMBLE="" + PREAMBLE="${PREAMBLE}\n" + + # Remove both xml and docbook preamble from instance and insert + # it again with definitions of required common and specific system + # entities. + sed -r -i "1,2c$(echo $PREAMBLE)" ${INSTANCE} + +} diff --git a/Automation/centos-art.sh-mods/Render/Docbook/docbook_setLastRendition.sh b/Automation/centos-art.sh-mods/Render/Docbook/docbook_setLastRendition.sh new file mode 100755 index 0000000..7205cd8 --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Docbook/docbook_setLastRendition.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# +# docbook_setLastRendition.sh -- This function performs last-rendition +# actions for DocBook files. These are the actions that take +# base-rendition and post-rendition output as input to produce output +# from it. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function docbook_setLastRendition { + + # Presently, there is no last-rendition action for DocBook base + # rendition but the function should exist for consistency with + # other formats. + return + +} diff --git a/Automation/centos-art.sh-mods/Render/Docbook/docbook_setPostRendition.sh b/Automation/centos-art.sh-mods/Render/Docbook/docbook_setPostRendition.sh new file mode 100755 index 0000000..30afef9 --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Docbook/docbook_setPostRendition.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# +# docbook_setPostRendition.sh -- This function performs post-rendition +# actions for DocBook files. These are the actions that take +# base-rendition output as input to producing output from it. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function docbook_setPostRendition { + + # Presently, there is no post-rendition action for DocBook base + # rendition but the function should exist for consistency with + # other formats. + return + +} diff --git a/Automation/centos-art.sh-mods/Render/Docbook/docbook_setStyles.sh b/Automation/centos-art.sh-mods/Render/Docbook/docbook_setStyles.sh new file mode 100755 index 0000000..8700f0f --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Docbook/docbook_setStyles.sh @@ -0,0 +1,81 @@ +#!/bin/bash +# +# docbook_setStyles.sh -- This function prepares styles' final +# instances, used in transformations and based on XSL or DSL +# templates. There might be translation markers inside the XSL and +# DSL templates that need to be expanded before they can be used for +# transformations. This function creates temporal instances of XSL +# and DSL templates with translation markers expanded inside so as for +# transformation commands (e.g., `xmltproc' or `openjade' through +# `docbook2pdf') to use as style definition. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function docbook_setStyles { + + local STYLE_TEMPLATE_FILE='' + local STYLE_TEMPLATE_FILES=$@ + local STYLE_INSTANCE_COMMON='' + local COUNT=0 + + for STYLE_TEMPLATE_FILE in $STYLE_TEMPLATE_FILES;do + + STYLE_TEMPLATE[((++${#STYLE_TEMPLATE[*]}))]="${STYLE_TEMPLATE_FILE}" + STYLE_INSTANCE[((++${#STYLE_INSTANCE[*]}))]="$(cli_getTemporalFile ${STYLE_TEMPLATE_FILE})" + + # Keep track of array's real index value. Remember, it starts + # at zero but counting starts at 1 instead. So, subtracting 1 + # from counting we have the real index value we need to work + # with the information stored in the array. + COUNT=$(( ${#STYLE_INSTANCE[*]} - 1 )) + + # Create style instance from style template. + cp ${STYLE_TEMPLATE[$COUNT]} ${STYLE_INSTANCE[$COUNT]} + + # Define both final an common style instances based on style + # templates. + if [[ $STYLE_TEMPLATE_FILE =~ 'docbook2fo\.xsl$' ]];then + STYLE_INSTANCE_FINAL=${STYLE_INSTANCE[$COUNT]} + elif [[ $STYLE_TEMPLATE_FILE =~ 'docbook2pdf\.dsl$' ]];then + STYLE_INSTANCE_FINAL=${STYLE_INSTANCE[${COUNT}]} + elif [[ $STYLE_TEMPLATE_FILE =~ 'docbook2xhtml-(chunks|single)\.xsl$' ]];then + STYLE_INSTANCE_FINAL=${STYLE_INSTANCE[${COUNT}]} + elif [[ $STYLE_TEMPLATE_FILE =~ 'docbook2xhtml-common\.xsl$' ]];then + STYLE_INSTANCE_COMMON=${STYLE_INSTANCE[${COUNT}]} + fi + + done + + # Verify style final instance. This is the file used by + # transformation command (`xsltproc' or `openjade') to produce the + # specified output. We cannot continue without it. + cli_checkFiles -e $STYLE_INSTANCE_FINAL + + # Expand common translation markers in the common style instance, + # if it exists. + if [[ -f $STYLE_INSTANCE_COMMON ]];then + cli_expandTMarkers $STYLE_INSTANCE_COMMON + fi + + # Expand specific translation markers in final style instance. + sed -r -i "s!=STYLE_XHTML_COMMON=!${STYLE_INSTANCE_COMMON}!" ${STYLE_INSTANCE_FINAL} + +} diff --git a/Automation/centos-art.sh-mods/Render/Docbook/docbook_setTranslation.sh b/Automation/centos-art.sh-mods/Render/Docbook/docbook_setTranslation.sh new file mode 100755 index 0000000..1d6bad7 --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Docbook/docbook_setTranslation.sh @@ -0,0 +1,90 @@ +#!/bin/bash +# +# docbook_setTranslation.sh -- This function standardizes the way +# translation files are applied to DocBook design models in order to +# produce the translated instance that is used to expand translation +# markers and produce different output formats. +# +# Assuming no translation file exists, an untranslated instance is +# taken from the design model and created (i.e., just a copy) from it. +# Using a design model instance (translated or not) is required in +# order to expand translation markers safely. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function docbook_setTranslation { + + # Print final location of translation file. + cli_printMessage "${TRANSLATION}" --as-translation-line + + # Create translation instance to combine both template translation + # and licenses translations. + local TRANSLATION_INSTANCE=${TMPDIR}/messages.po + + # Define path to DocBook locales using models as reference. + local DOCBOOK_LOCALES=$(cli_getLocalizationDir "$DOCBOOK_MODELS") + + # Define list of all locale files you want to combine. This + # include the localization files related to all different kind of + # licenses you want to use in the main documentation file and the + # localization file of the main documentation file, as well. + local DOCBOOK_PO_FILES="${TCAR_WORKDIR}/Locales/Documentation/Models/Docbook/Default/Licenses/Gfdl/${CLI_LANG_LC}/messages.po \ + ${TCAR_WORKDIR}/Locales/Documentation/Models/Docbook/Default/Licenses/Gpl/${CLI_LANG_LC}/messages.po \ + ${TRANSLATION}" + + # Be sure the files we want to combine do exist. + cli_checkFiles -e ${DOCBOOK_PO_FILES} + + # Combine license translations with template translation in order + # to reuse licenses translations in template files without + # including them in template portable objects. In the case of + # DocBook templates, translations related to licenses are required + # because license content is expanded at execution time inside the + # DocBook instance used by XSL processor during transformation. + msgcat --output=${TRANSLATION_INSTANCE} \ + --width=70 --no-location --use-first ${DOCBOOK_PO_FILES} + + # At this point the translation instance with both licenses and + # manual translations have been saved. Now it is required to + # expand entities so it could be possible to create a translated + # instance with all the content inside. + + # Print action message. + cli_printMessage "${INSTANCE}" --as-translating-line + + # Create the translated instance of design model instance with all + # entities and translation markers expanded. + xml2po -a -l ${CLI_LANG_LL} \ + -p ${TRANSLATION_INSTANCE} \ + -o ${INSTANCE}-${CLI_LANG_LL}.tmp ${INSTANCE} + + # Rename final instance so it can be treated as just instance. + mv ${INSTANCE}-${CLI_LANG_LL}.tmp ${INSTANCE} + + # Remove .xml2po.mo temporal file. + if [[ -f ${PWD}/.xml2po.mo ]];then + rm ${PWD}/.xml2po.mo + fi + + # Verify instance existence. + cli_checkFiles -e $INSTANCE + +} diff --git a/Automation/centos-art.sh-mods/Render/Svg/svg.sh b/Automation/centos-art.sh-mods/Render/Svg/svg.sh new file mode 100755 index 0000000..df419c6 --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Svg/svg.sh @@ -0,0 +1,69 @@ +#!/bin/bash +# +# svg.sh -- This function performs base-rendition action for SVG +# files. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function svg { + + # Apply translation to design model in order to produce the + # translated design model instance. + svg_doTranslation + + # Expand translation markers inside design model instance. + cli_expandTMarkers ${INSTANCE} + + # Initialize the export id used inside design templates. This + # value defines the design area we want to export. + local EXPORTID='CENTOSARTWORK' + + # Verify the export id. + svg_checkModelExportId "$INSTANCE" "$EXPORTID" + + # Check existence of external files. Inside design templates and + # their instances, external files are used to refer the background + # information required by the design template. If such background + # information is not available the image is produced without + # background information. This is something that need to be + # avoided. + svg_checkModelAbsref "$INSTANCE" + + # Render template instance using inkscape and save the output. + local INKSCAPE_OUTPUT="$(\ + inkscape $INSTANCE --export-id=$EXPORTID --export-png=${FILE}.png)" + + # Modify output from inkscape to fit the centos-art.sh script + # output visual style. + cli_printMessage "$(echo "$INKSCAPE_OUTPUT" | egrep '^Area' \ + | sed -r "s!^Area!`gettext "Area"`:!")" --as-inkscape-line + cli_printMessage "$(echo "$INKSCAPE_OUTPUT" | egrep '^Background' \ + | sed -r "s!^Background (RRGGBBAA):(.*)!`gettext "Background"`: \1 \2!")" --as-inkscape-line + cli_printMessage "$(echo "$INKSCAPE_OUTPUT" | egrep '^Bitmap saved as' \ + | sed -r "s!^Bitmap saved as:!`gettext "Saved as"`:!")" --as-inkscape-line + + # Perform format post-rendition. + svg_doPostActions + + # Perform format last-rendition. + svg_doLastActions + +} diff --git a/Automation/centos-art.sh-mods/Render/Svg/svg_checkColorAmount.sh b/Automation/centos-art.sh-mods/Render/Svg/svg_checkColorAmount.sh new file mode 100755 index 0000000..8d25900 --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Svg/svg_checkColorAmount.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# +# svg_checkColorAmount.sh -- This function verifies whether the list +# of colors provided in the first argument matches the amount of +# colors specified by the second argument. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function svg_checkColorAmount { + + # Define list of colors. + local COLORS=$1 + + # Define the amount of colors the list provided must have, in + # order to be considered as valid. + local NUMBER=$2 + + # Verify amount of colors provided in the list. + if [[ $(echo "$COLORS" | wc -l) -ne $NUMBER ]];then + cli_printMessage "`gettext "The palette does not have the correct number of colors."`" --as-error-line + fi + +} diff --git a/Automation/centos-art.sh-mods/Render/Svg/svg_checkColorFormats.sh b/Automation/centos-art.sh-mods/Render/Svg/svg_checkColorFormats.sh new file mode 100755 index 0000000..19ddd9d --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Svg/svg_checkColorFormats.sh @@ -0,0 +1,89 @@ +#!/bin/bash +# +# svg_checkColorFormats.sh -- This function verifies formats of colors +# (i.e., the way color information is specified). +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function svg_checkColorFormats { + + # Define short options. + local ARGSS='' + + # Define long options. + local ARGSL='format:' + + # Initialize pattern used for color sanitation. + local PATTERN='^#[0-9a-f]{6}$' + + # Initialize arguments with an empty value and set it as local + # variable to this function scope. Doing this is very important to + # avoid any clash with higher execution environments. + local ARGUMENTS='' + + # Prepare ARGUMENTS variable for getopt. + cli_parseArgumentsReDef "$@" + + # Redefine ARGUMENTS using getopt(1) command parser. + cli_parseArguments + + # Redefine positional parameters using ARGUMENTS variable. + eval set -- "$ARGUMENTS" + + # Look for options passed through positional parameters. + while true;do + + case "$1" in + + --format ) + + case "$2" in + + rrggbb|*) + PATTERN='^#[0-9a-f]{6}$' + ;; + + esac + shift 2 + ;; + + -- ) + shift 1 + break + ;; + esac + done + + # Define the location we want to apply verifications to. + local COLOR='' + local COLORS="$@" + + # Loop through colors and perform format verification as specified + # by pattern. + for COLOR in $COLORS;do + + if [[ ! $COLOR =~ $PATTERN ]];then + cli_printMessage "`eval_gettext "The \\\"\\\$COLOR\\\" string is not a valid color code."`" --as-error-line + fi + + done + +} diff --git a/Automation/centos-art.sh-mods/Render/Svg/svg_checkModelAbsref.sh b/Automation/centos-art.sh-mods/Render/Svg/svg_checkModelAbsref.sh new file mode 100755 index 0000000..4775e26 --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Svg/svg_checkModelAbsref.sh @@ -0,0 +1,141 @@ +#!/bin/bash +# +# svg_checkModelAbsref.sh -- This function retrives absolute files and +# checks their existence. In order for design templates to point +# different artistic motifs, design templates make use of external +# files which point to specific artistic motif background images. If +# such external files don't exist, try to create the background image +# required by cropping a higher background image (e.g., +# 2048x1536-final.png). If this isn't possible neither, then create +# the background image using a plain color and crop from it then. We +# can't go on without the required background information. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function svg_checkModelAbsref { + + local FILE='' + local BG_DST_FILES='' + local BG_DST_FILE='' + local BG_DST_FILE_WIDTH='' + local BG_DST_FILE_HEIGHT='' + local BG_SRC_FILE='' + local BG_SRC_FILE_COLOR='' + local BG_SRC_FILE_WIDTH='' + local BG_SRC_FILE_HEIGHT='' + + # Define absolute path to the translated instance of design model. + FILE="$1" + + # Verify existence of file we need to retrive absolute paths from. + cli_checkFiles -e "$FILE" + + # Retrive absolute paths from file. + BG_DST_FILES=$(egrep "(sodipodi:absref|xlink:href)=\"${HOME}.+" $FILE \ + | sed -r "s,.+=\"(${HOME}.+\.png)\".*,\1," | sort | uniq) + + # Verify absolute paths retrived from file. + for BG_DST_FILE in $BG_DST_FILES;do + + # Print action message. + cli_printMessage "$BG_DST_FILE" --as-checking-line + + # Verify parent directory of absolute files retrived from + # file. This is required to prevent the construction of paths + # to locations that don't exist. For example, when including + # background images in SVG files, it is possible that the path + # information inside SVG files get outdated temporarly. If in + # that exact moment, you try to render the SVG file it won't + # be possible to create the image used for cropping because + # the path build from the location inside SVG file doesn't + # exist. In this case, centos-art.sh script will end up with + # `file ... doesn't exist' errors. + cli_checkFiles -d "$(dirname ${BG_DST_FILE})" + + if [[ ! -a $BG_DST_FILE ]];then + + # Define the source background file, the image file will + # crop when no specific background informatio be available + # for using. Generally, this is the most reusable + # background file inside the artistic motifs (e.g,. the + # `2048x1536-final.png' file). We can use this image file + # to create almost all artworks inside The CentOS + # Distribution visual manifestation when + # resolution-specific backgrounds don't exist. + BG_SRC_FILE=$(echo $BG_DST_FILE \ + | sed -r "s!(.+)/[[:digit:]]+x[[:digit:]]+(-final\.png)!\1/2048x1536\2!") + + # Verify existence of source background file. If the file + # doesn't exist create it using The CentOS Project default + # background color information, as specified in its + # corporate identity manual. + if [[ ! -f $BG_SRC_FILE ]];then + + # Define plain color that will be used as background. + BG_SRC_FILE_COLOR=$(svg_getColors) + + # Verify format of color value. + svg_checkColorFormats $BG_SRC_FILE_COLOR --format='rrggbb' + + # Define width for the source background file the + # required background information is cropped from. + BG_SRC_FILE_WIDTH=$(echo $BG_SRC_FILE \ + | sed -r 's!.+/([[:digit:]]+)x[[:digit:]]+-final\.png!\1!') + + # Define height for the source background file the + # required background information is cropped from. + BG_SRC_FILE_HEIGHT=$(echo $BG_SRC_FILE \ + | sed -r 's!.+/[[:digit:]]+x([[:digit:]]+)-final\.png!\1!') + + # Print action message. + cli_printMessage "${BG_SRC_FILE} ($BG_SRC_FILE_COLOR)" --as-creating-line + + # Create the source background file. + ppmmake -quiet ${BG_SRC_FILE_COLOR} \ + ${BG_SRC_FILE_WIDTH} ${BG_SRC_FILE_HEIGHT} \ + | pnmtopng > ${BG_SRC_FILE} + + fi + + # Print action message. + cli_printMessage "$BG_SRC_FILE" --as-cropping-line + + # Define the width of the required background information. + BG_DST_FILE_WIDTH=$(echo $BG_DST_FILE \ + | sed -r 's!.+/([[:digit:]]+)x[[:digit:]]+-final\.png!\1!') + + # Define the height of the required background information. + BG_DST_FILE_HEIGHT=$(echo $BG_DST_FILE \ + | sed -r 's!.+/[[:digit:]]+x([[:digit:]]+)-final\.png!\1!') + + # Create required backgrounnd information. + convert -quiet \ + -crop ${BG_DST_FILE_WIDTH}x${BG_DST_FILE_HEIGHT}+0+0 \ + ${BG_SRC_FILE} ${BG_DST_FILE} + + # Verify required background information. + cli_checkFiles -e $BG_DST_FILE + + fi + + done + +} diff --git a/Automation/centos-art.sh-mods/Render/Svg/svg_checkModelExportId.sh b/Automation/centos-art.sh-mods/Render/Svg/svg_checkModelExportId.sh new file mode 100755 index 0000000..2944195 --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Svg/svg_checkModelExportId.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# +# svg_checkModelExportId.sh -- This function standardizes the export +# id used inside svg files and the way of verify them. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function svg_checkModelExportId { + + local INSTANCE="$1" + local EXPORTID="$2" + + # Verify instance. + cli_checkFiles -e $INSTANCE + + # Verify export id. + if [[ $EXPORTID == '' ]];then + cli_printMessage "`gettext "The export id value cannot be empty."`" --as-error-line + fi + + # Check export id inside design templates. + grep "id=\"$EXPORTID\"" $INSTANCE > /dev/null + if [[ $? -gt 0 ]];then + cli_printMessage "`eval_gettext "There is not export id (\\\$EXPORTID) inside \\\"\\\$TEMPLATE\\\"."`" --as-error-line + fi + +} diff --git a/Automation/centos-art.sh-mods/Render/Svg/svg_convertGplToHex.sh b/Automation/centos-art.sh-mods/Render/Svg/svg_convertGplToHex.sh new file mode 100755 index 0000000..51efe26 --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Svg/svg_convertGplToHex.sh @@ -0,0 +1,61 @@ +#!/bin/bash +# +# svg_convertGplToHex.sh -- This function takes one palette produced +# by Gimp (e.g., syslinux.gpl) as input and outputs the list of +# hexadecimal colors and their respective index position the +# `pnmtolss16' program needs (e.g., #RRGGBB=0 #RRGGBB=1 ... [all +# values in the same line]). +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function svg_convertGplToHex { + + # Define path to GPL palette. This is the .gpl file we use to + # retrive color information from. + local PALETTE_GPL="$1" + + # Define path to HEX palette. This is the palette used to stored + # the color information the `ppmtolss16' program needs. + local PALETTE_HEX="$2" + + # Define the number of colors this function should return. + local NUMBER="$3" + + # Define list of colors from GPL palette. + local COLORS=$(svg_getColors $PALETTE_GPL --head=$NUMBER --tail=$NUMBER) + + # Verify number of colors returned in the list. They must match + # exactly the amount specified, no more no less. Sometimes, the + # list of colors may have less colors than it should have, so we + # need to prevent such palettes from being used. + svg_checkColorAmount "$COLORS" "$NUMBER" + + # Verify format of colors. + svg_checkColorFormats "$COLORS" --format='rrggbb' + + # Create list of colors to be processed by `pnmtolss16'. + echo "$COLORS" | nl | gawk '{ printf "%s=%d ", $2, $1 - 1 }' \ + > $PALETTE_HEX + + # Verify HEX palette existence. + cli_checkFiles -e $PALETTE_HEX + +} diff --git a/Automation/centos-art.sh-mods/Render/Svg/svg_convertGplToPpm.sh b/Automation/centos-art.sh-mods/Render/Svg/svg_convertGplToPpm.sh new file mode 100755 index 0000000..559127b --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Svg/svg_convertGplToPpm.sh @@ -0,0 +1,71 @@ +#!/bin/bash +# +# svg_convertGplToPpm.sh -- This function takes one palette produced +# by Gimp (e.g., syslinux.gpl) as input and outputs one PPM file based +# on it (e.g., syslinux.ppm). +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function svg_convertGplToPpm { + + local -a FILES + local COUNT=0 + + # Define path to GPL palette. This is the .gpl file we use to + # retrive color information from. + local PALETTE_GPL="$1" + + # Define path to PPM palette. This is the .ppm file we'll save + # color information to. + local PALETTE_PPM="$2" + + # Define the number of colors this function should return. + local NUMBER="$3" + + # Define list of colors from GPL palette. + local COLOR='' + local COLORS=$(svg_getColors "$PALETTE_GPL" --head=$NUMBER --tail=$NUMBER --format='rrrggbb') + + # Verify amount of colors in the list of colors. + svg_checkColorAmount "$COLORS" "$NUMBER" + + # Verify format of colors. + svg_checkColorFormats $COLORS --format='rrggbb' + + # Create temporal images (of 1x1 pixel each) to store each color + # retrived from Gimp's palette. + for COLOR in $COLORS;do + FILES[$COUNT]=$(cli_getTemporalFile ${COUNT}.ppm) + ppmmake $COLOR 1 1 > ${FILES[$COUNT]} + COUNT=$(($COUNT + 1)) + done + + # Concatenate each temporal image from left to right to create the + # PPM file. + pnmcat -lr ${FILES[*]} > $PALETTE_PPM + + # Remove temporal images used to build the PPM palette file. + rm ${FILES[*]} + + # Verify PPM palette existence. + cli_checkFiles -e "$PALETTE_PPM" + +} diff --git a/Automation/centos-art.sh-mods/Render/Svg/svg_convertPngTo.sh b/Automation/centos-art.sh-mods/Render/Svg/svg_convertPngTo.sh new file mode 100755 index 0000000..9fad7ba --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Svg/svg_convertPngTo.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# +# svg_convertPngTo.sh -- This function provides post-rendition actions +# to use the `convert' command of ImageMagick tool set. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function svg_convertPngTo { + + # Initialize image formats. + local FORMAT='' + local FORMATS=$(render_getConfigOption "$ACTION" '2') + + # Convert from PNG to specified formats. + for FORMAT in $FORMATS;do + cli_printMessage "${FILE}.${FORMAT}" --as-savedas-line + convert -quality 85 ${FILE}.png ${FILE}.${FORMAT} + done + +} diff --git a/Automation/centos-art.sh-mods/Render/Svg/svg_convertPngToBranded.sh b/Automation/centos-art.sh-mods/Render/Svg/svg_convertPngToBranded.sh new file mode 100755 index 0000000..8ffba47 --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Svg/svg_convertPngToBranded.sh @@ -0,0 +1,108 @@ +#!/bin/bash +# +# svg_convertPngToBranded.sh -- This function standardizes image +# branding. Once the base PNG image is rendered and the +# `--with-brands' option is provided, this function composites a new +# branded image using the preferences set in the related +# `branding.conf' file. The `branding.conf' file must be stored +# inside the related design model component used as reference to +# produce the base PNG image. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function svg_convertPngToBranded { + + # Verify whether the option `--with-brands' was provided or not to + # `centos-art.sh' script command-line. + if [[ $FLAG_WITH_BRANDS == 'false' ]];then + return + fi + + local BRANDING_CONF_FILE='' + local BRANDING_CONF_SECTION='' + local BRANDING_CONF_VALUES='' + local BRANDING_CONF_VALUE='' + local BRANDFILE='' + local POSITION='' + local POSITIONS='' + + # Define absolute path to branding configuration file. + BRANDING_CONF_FILE="$(dirname ${TEMPLATE})/branding.conf" + + # Verify absolute path to branding configuration file. This is + # required in order to avoid trying to render branded content + # which doesn't have an associated `branding.conf' file. If there + # is no associated `branding.conf' file don't stop the script + # execution. Instead, continue with the next action in the list. + # This is required in order to perform massive rendition inside + # structures like themes where components might or might not have + # `branding.conf' files associated. For example, the `Concept' + # component doesn't have branding information associated but most + # elements inside `Distro' component do. + if [[ ! -f "$BRANDING_CONF_FILE" ]];then + continue + fi + + # Define regular expression matching the variable name (i.e., the + # left column), inside the configuration line, you want to match + # on. + BRANDING_CONF_VARNAME=$(basename ${TEMPLATE}) + + # Define list of configuration lines related to current design + # model. This are the lines that tell us how and where to apply + # branding information on base PNG image. Be sure that only + # configuration lines from supported section names (e.g., + # `symbol', `type', `logo') be read, no need to waste resources + # with others. + BRANDING_CONF_VALUES=$(\ + for BRANDING_CONF_SECTION in $(echo "types symbols logos");do + cli_getConfigValue "${BRANDING_CONF_FILE}" "${BRANDING_CONF_SECTION}" "${BRANDING_CONF_VARNAME}" + done) + + for BRANDING_CONF_VALUE in $BRANDING_CONF_VALUES;do + + # Define absolute path to image file used as brand. This is + # the image put over the PNG image produced as result of + # design models base rendition. + BRANDFILE=${TCAR_WORKDIR}/Identity/Images/Brands/$(echo $BRANDING_CONF_VALUE \ + | gawk 'BEGIN{ FS=":" } { print $1 }' ) + + # Verify absolute path to image file used as brand. Assuming + # no brand image file is found, continue with the next + # configuration line. + if [[ ! -f $BRANDFILE ]];then + continue + fi + + # Define list of positions using the format of ImageMagick + # `-geometry' option argument. + POSITIONS=$(echo "$BRANDING_CONF_VALUE" | cut -d: -f2- | tr ':' ' ') + + # Loop through list of brand image positions and use the + # composite command from ImageMagick, to overlap the unbranded + # image just rendered with the branded version of itself. + for POSITION in $POSITIONS;do + composite -geometry ${POSITION} ${BRANDFILE} ${FILE}.png ${FILE}.png + done + + done + +} diff --git a/Automation/centos-art.sh-mods/Render/Svg/svg_convertPngToDm.sh b/Automation/centos-art.sh-mods/Render/Svg/svg_convertPngToDm.sh new file mode 100755 index 0000000..4ba8b10 --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Svg/svg_convertPngToDm.sh @@ -0,0 +1,183 @@ +#!/bin/bash +# +# svg_convertPngToDm.sh -- This function standardize production of +# display managers (e.g., Gdm and Kdm). This function copies all files +# needed into a temporal directory, realize expansion of translation +# markers and packs all the files into a tar.gz package that is used +# for installation. This function must be used as last-rendition +# action for Gdm and Kdm directory specific base-rendition actions. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function svg_convertPngToDm { + + # Print separator line. + cli_printMessage '-' --as-separator-line + + # Initialize source and destination local variables. + local SRC='' + local DST='' + + # Initialize display manager type. + local DM=$(render_getConfigOption "${ACTION}" '2') + + # Initialize screen resolutions used by display manager theme. + # These are the different screen resolutions a display manager + # theme is built for. The amount of screen resolution a display + # manager theme can be built for is limited to the amount of + # background files provided by the artistic motif used to build + # the display manager theme. + local RESOLUTION='' + local RESOLUTIONS=$(render_getConfigOption "${ACTION}" '3') + + # Verify screen resolutions. We cannot produce display manager + # theme if no screen resolution has been specified. + if [[ "$RESOLUTIONS" == '' ]];then + cli_printMessage "`gettext "There is no resolution information to process."`" --as-error-line + fi + + # Initialize theme information we are going to build the display + # manager theme for. + local THEME=$(cli_getPathComponent $ACTIONVAL --motif) + local THEME_NAME=$(cli_getPathComponent $ACTIONVAL --motif-name) + + # Initialize temporal directory where we collect all files needed + # in order to create the tar.gz file. This intermediate step is + # also needed in order to expand translation markers from XML and + # Desktop definitions. + local TMPDIR=$(cli_getTemporalFile 'dm') + + # Initialize source location for brands. This is the place where + # brand information, needed to build the display manager theme, is + # retrieved from. + local BRAND_BASEDIR=${TCAR_WORKDIR}/Identity/Images/Brands + + # Initialize source location for artistic motif's backgrounds. + # This is the place where background information needed to ubild + # the display manager theme is retrieved from. + local BGS=${TCAR_WORKDIR}/Identity/Images/Themes/${THEME}/Backgrounds/Img/Png + + # Initialize file variables. File variables are used build and + # process the file relation between source and target locations. + local FILE='' + local FILES='' + + # Define major release from template. + local MAJOR_RELEASE=$(cli_getPathComponent "$TEMPLATE" "--release-major") + + # Define file relation between source and target locations, based + # on whether we are producing GDM or KDM. Use the colon character + # (`:') as separator; on the left side we put the file's source + # location and in the right side the file's target location. + # Presently, both GDM and KDM are very similar on files with the + # exception that GDM does use icons near actions buttons (e.g., + # shutdown, reboot, session, language) and KDM doesn't. + case ${DM} in + + Gdm ) + FILES="\ + ${BRAND_BASEDIR}/Symbols/48/${TCAR_BRAND}.png:${TCAR_BRAND}-symbol.png + ${OUTPUT}/screenshot.png:screenshot.png + $(dirname $TEMPLATE)/GdmGreeterTheme.xml:${THEME_NAME}.xml + $(dirname $TEMPLATE)/GdmGreeterTheme.desktop:GdmGreeterTheme.desktop + $(dirname $TEMPLATE)/icon-language.png:icon-language.png + $(dirname $TEMPLATE)/icon-reboot.png:icon-reboot.png + $(dirname $TEMPLATE)/icon-session.png:icon-session.png + $(dirname $TEMPLATE)/icon-shutdown.png:icon-shutdown.png + " + ;; + + Kdm ) + FILES="\ + ${BRAND_BASEDIR}/Symbols/48/${TCAR_BRAND}.png:${TCAR_BRAND}-symbol.png + ${OUTPUT}/screenshot.png:screenshot.png + $(dirname $TEMPLATE)/GdmGreeterTheme.xml:${THEME_NAME}.xml + $(dirname $TEMPLATE)/GdmGreeterTheme.desktop:GdmGreeterTheme.desktop + " + ;; + + * ) + cli_printMessage "`eval_gettext "The \\\"\\\$DM\\\" display manager is not supported yet."`" --as-error-line + ;; + esac + + for FILE in $FILES;do + + # Define source location. + SRC=$(echo $FILE | cut -d: -f1) + + # Define target location. + DST=${TMPDIR}/${THEME_NAME}/$(echo $FILE | cut -d: -f2) + + # Verify source files. + cli_checkFiles -e $SRC + + # Verify parent directory for target file. + if [[ ! -d $(dirname $DST) ]];then + mkdir -p $(dirname $DST) + fi + + # Copy files from source to target location. + cp ${SRC} ${DST} + + # Expand translation markers. + if [[ ${DST} =~ "\.(xml|desktop)$" ]];then + cli_expandTMarkers "${DST}" + fi + + done + + # Move into temporal directory. + pushd $TMPDIR > /dev/null + + for RESOLUTION in $RESOLUTIONS;do + + # Verify background information. If it doesn't exist go on + # with the next one in the list. + if [[ ! -f $BGS/${RESOLUTION}-final.png ]];then + continue + fi + + # Print action message. + if [[ -f ${RESOLUTION}.tar.gz ]];then + cli_printMessage "${OUTPUT}/${RESOLUTION}.tar.gz" --as-updating-line + else + cli_printMessage "${OUTPUT}/${RESOLUTION}.tar.gz" --as-creating-line + fi + + # Copy background information. + cp $BGS/${RESOLUTION}-final.png ${THEME_NAME}/background.png + + # Create tar.gz file. + tar -czf ${RESOLUTION}.tar.gz ${THEME_NAME} + + # Move from temporal directory to its final location. + mv ${RESOLUTION}.tar.gz ${OUTPUT} + + done + + # Return to where we were initially. + popd > /dev/null + + # Remove temporal directory. + rm -r ${TMPDIR} + +} diff --git a/Automation/centos-art.sh-mods/Render/Svg/svg_convertPngToGrub.sh b/Automation/centos-art.sh-mods/Render/Svg/svg_convertPngToGrub.sh new file mode 100755 index 0000000..00da4d6 --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Svg/svg_convertPngToGrub.sh @@ -0,0 +1,148 @@ +#!/bin/bash +# +# svg_convertPngToGrub.sh -- This function provides post-rendition +# action used to produce GRUB images. +# +# Initially, the color information is defined with GIMP (The GNU Image +# Manipulation Program) as a `.gpl' palette of color. This palette of +# colors contains 14 colors only and is saved in a file named +# `grub.gpl. The `grub.gpl' file is used to build the `grub.ppm' file +# which provide the color information needed to reduce the full color +# PNG image, produced as result of SVG base-rendition, to the amount +# of colors specified (i.e., 14 colors). Later, with the 14 color PNG +# image already created, the `grub.ppm' file is used to build the +# `splash.xpm.gz' file. +# +# In order for this function to work, the `grub.gpl' file should have +# a format similar to the following: +# +# GIMP Palette +# Name: CentOS-TreeFlower-4-Syslinux +# Columns: 14 +# # +# 32 76 141 204c8d +# 36 82 146 245292 +# 52 93 152 345d98 +# 72 108 162 486ca2 +# 102 131 176 6683b0 +# 126 153 190 7e99be +# 146 170 200 92aac8 +# 161 182 209 a1b6d1 +# 182 199 219 b6c7db +# 202 214 228 cad6e4 +# 221 230 238 dde6ee +# 235 241 245 ebf1f5 +# 246 251 254 f6fbfe +# 254 255 252 fefffc +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function svg_convertPngToGrub { + + # Define number of colors the images will be produced on. + local COLORS='14' + + # Define options using those passed to actions from pre-rendition + # configuration script. These options are applied to pnmremap when + # doing color reduction, so any option available for pnmremap + # command can be passed to renderSyslinux functionality. + local OPTIONS=$(render_getConfigOption "$ACTION" '2-') + + # Check options passed to action. This is required in order to + # aviod using options used already in this script. For example + # -verbose and -mapfile options. + for OPTION in $OPTIONS;do + # Remove anything after equal sign inside option. + OPTION=$(echo -n $OPTION | cut -d'=' -f1) + if [[ "$OPTION" =~ "-(mapfile|verbose)" ]];then + cli_printMessage "`eval_gettext "The \\\"\\\$OPTION\\\" option is already used."`" --as-error-line + fi + done + + # Define file name prefix. + local PREFIX="-${COLORS}c" + + # Redefine file name prefix using options as reference. This is + # useful to differenciate final files produced using + # Floyd-Steinberg dithering and files which are not. + if [[ "$OPTIONS" =~ '-floyd' ]];then + PREFIX="${PREFIX}-floyd" + fi + + # Define logs' file. Log files are stored in the same place of + # images and are used to store output information produced by + # programs when the image files are built up. + local LOGS=${FILE}${PREFIX}.log + + # Define absolute path to GPL palette. This palettes should have + # 14 colors only. For more information on this see the GRUB's + # documentation. + local PALETTE_GPL=${MOTIF_DIR}/Palettes/grub.gpl + + # Verify GPL palette existence. If it doesn't exist copy the one + # provided by the design model through subversion (to keep track + # of the change) and expand translation markers in the copied + # instance. + if [[ ! -f $PALETTE_GPL ]];then + cli_runFnEnvironment vcs --copy ${MODEL_BASEDIR}/${FLAG_THEME_MODEL}/Palettes/grub.gpl ${PALETTE_GPL} + cli_expandTMarkers ${PALETTE_GPL} + fi + + # Define absolute path to PPM palette. The PPM palette is built + # from source palette (PALETTE_GPL) and provides the color + # information understood by `ppmremap', the program used to + # produce images in a specific amount of colors. + local PALETTE_PPM=$(cli_getTemporalFile "grub.ppm") + + # Create image in Netpbm superformat (PNM). The PNM image file is + # created from the PNG image rendered previously as centos-art + # base-rendition output. The PNM image is an intermediate format + # used to manipulate images through Netpbm tools. + cli_printMessage "${FILE}.pnm" --as-savedas-line + pngtopnm -verbose \ + < ${FILE}.png 2>${LOGS} > ${FILE}.pnm + + # Print the path to GPL palette. + cli_printMessage "$PALETTE_GPL" --as-palette-line + + # Create PPM palette using GPL palette. + svg_convertGplToPpm "$PALETTE_GPL" "$PALETTE_PPM" "$COLORS" + + # Reduce colors as specified in PPM palette. Here we use the PPM + # palette to enforce the color position in the image index and the + # Floyd-Steinberg dithering in order to improve color reduction. + cli_printMessage "${FILE}${PREFIX}.ppm" --as-savedas-line + pnmremap -verbose -mapfile=$PALETTE_PPM $OPTIONS \ + < ${FILE}.pnm 2>>${LOGS} > ${FILE}${PREFIX}.ppm + + # Remove PPM palette. It is no longer needed. + if [[ -f ${PALETTE_PPM} ]];then + rm $PALETTE_PPM + fi + + # Create the 14 colors xpm.gz file. + cli_printMessage "${FILE}${PREFIX}.xpm.gz" --as-savedas-line + ppmtoxpm \ + < ${FILE}${PREFIX}.ppm 2>>${LOGS} > ${FILE}.xpm \ + && gzip --force ${FILE}.xpm \ + && mv ${FILE}.xpm.gz ${FILE}${PREFIX}.xpm.gz + +} diff --git a/Automation/centos-art.sh-mods/Render/Svg/svg_convertPngToIcons.sh b/Automation/centos-art.sh-mods/Render/Svg/svg_convertPngToIcons.sh new file mode 100755 index 0000000..1c4a1af --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Svg/svg_convertPngToIcons.sh @@ -0,0 +1,77 @@ +#!/bin/bash +# +# svg_convertPngToIcons.sh -- This function provides post-rendition +# actions to produce icon images in different sizes and formats from +# the same SVG design model. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function svg_convertPngToIcons { + + # Define height dimensions you want to produce brands for. + local SIZE="" + local SIZES="16 20 22 24 32 36 40 48 64 96 128 148 164 196 200 512" + + # Define image formats you want to produce brands for. + local FORMAT="" + local FORMATS="" + + for SIZE in ${SIZES};do + + # Redefine absolute path to file location where size-specific + # images will be stored in. + local FINALFILE=$(dirname $FILE)/${SIZE}/$(basename $FILE) + + # Prepare directory where size-specific images will be stored + # in. If it doesn't exist create it. + if [[ ! -d $(dirname $FINALFILE) ]];then + mkdir -p $(dirname $FINALFILE) + fi + + # Print action message. + cli_printMessage "${FINALFILE}.png" --as-creating-line + + # Create size-specific PNG image ommiting all output. + inkscape $INSTANCE --export-id=$EXPORTID \ + --export-png=${FINALFILE}.png --export-height=${SIZE} \ + &> /dev/null + + #for FORMAT in ${FORMATS};do + # + # # Print action message. + # cli_printMessage "${FINALFILE}.${FORMAT}" --as-creating-line + # + # # Convert size-specific PNG image into different formats. + # convert ${FINALFILE}.png ${FINALFILE}.${FORMAT} + # + #done + + # Create copy of size-specific image in 2 colors. + #cli_printMessage "${FINALFILE}.xbm" --as-creating-line + #convert -colorspace gray -colors 2 ${FINALFILE}.png ${FINALFILE}.xbm + + # Create copy of size-specific image with emboss effect. + #cli_printMessage "${FINALFILE}-emboss.png" --as-creating-line + #convert -emboss 1 ${FINALFILE}.png ${FINALFILE}-emboss.png + + done + +} diff --git a/Automation/centos-art.sh-mods/Render/Svg/svg_convertPngToKsplash.sh b/Automation/centos-art.sh-mods/Render/Svg/svg_convertPngToKsplash.sh new file mode 100755 index 0000000..091245d --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Svg/svg_convertPngToKsplash.sh @@ -0,0 +1,79 @@ +#!/bin/bash +# +# svg_convertPngToKsplash.sh -- This function collects KDE splash +# (KSplash) required files and creates a tar.gz package that groups +# them all together. Use this function as last-rendition action for +# KSplash base-rendition action. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function svg_convertPngToKsplash { + + local -a SRC + local -a DST + local FONT='' + local COUNT=0 + + # Define font used to print bottom splash message. + FONT=$(svg_getTTFont "DejaVuLGCSans-Bold") + + # Check existence of font file. + cli_checkFiles -e "$FONT" + + # Define absolute source location of files. + SRC[0]="${OUTPUT}/splash_top.png" + SRC[1]="${OUTPUT}/splash_active_bar.png" + SRC[2]="${OUTPUT}/splash_inactive_bar.png" + SRC[3]="${OUTPUT}/splash_bottom.png" + SRC[4]="$(dirname $TEMPLATE)/Theme.rc" + + # Check absolute source location of files. + cli_checkFiles -e "${SRC[@]}" + + # Define relative target location of files. + DST[0]="${OUTPUT}/splash_top.png" + DST[1]="${OUTPUT}/splash_active_bar.png" + DST[2]="${OUTPUT}/splash_inactive_bar.png" + DST[3]="${OUTPUT}/splash_bottom.png" + DST[4]="${OUTPUT}/Theme.rc" + + # Print action message. + cli_printMessage "${OUTPUT}/Preview.png" --as-creating-line + + # Create `Preview.png' image. + convert -append ${SRC[0]} ${SRC[1]} ${SRC[3]} ${OUTPUT}/Preview.png + + # Add bottom text to Preview.png image. The text position was set + # inside an image of 400x300 pixels. If you change the final + # preview image dimension, you probably need to change the text + # position too. + mogrify -draw 'text 6,295 "KDE is up and running."' \ + -fill \#ffffff \ + -font $FONT \ + ${OUTPUT}/Preview.png + + # Copy `Theme.rc' file. + cp ${SRC[4]} ${DST[4]} + + # Apply common translation markers to Theme.rc file. + cli_expandTMarkers "${DST[4]}" + +} diff --git a/Automation/centos-art.sh-mods/Render/Svg/svg_convertPngToSyslinux.sh b/Automation/centos-art.sh-mods/Render/Svg/svg_convertPngToSyslinux.sh new file mode 100755 index 0000000..d04b0a0 --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Svg/svg_convertPngToSyslinux.sh @@ -0,0 +1,189 @@ +#!/bin/bash +# +# svg_convertPngToSyslinux.sh -- This function provides post-rendition +# action used to produce LSS16 images, the images used by isolinux. +# +# Initially, the color information is defined with GIMP (The GNU Image +# Manipulation Program) as a `.gpl' palette of color. This palette of +# colors contains 16 colors only and is saved in a file named +# `syslinux.gpl. The `syslinux.gpl' file is used to build two other +# files: the `syslinux.ppm' file and the `syslinux.hex' file. The +# `syslinux.ppm' provides the color information needed to reduce the +# full color PNG image, produced as result of SVG base-rendition, to +# the amount of colors specified (i.e., 16 colors). Later, with the 16 +# color PNG image already created, the `syslinux.hex' file is used to +# build the LSS16 image. +# +# In order to produce images in LSS16 format correctly, it is required +# that both the `syslinux.ppm' and `syslinux.hex' files do contain the +# same color information. This is, both `syslinux.ppm' and +# `syslinux.hex' must represent the same color values and in the same +# color index. +# +# In order for this function to work, the `syslinux.gpl' file should +# have a format similar to the following: +# +# GIMP Palette +# Name: CentOS-TreeFlower-4-Syslinux +# Columns: 16 +# # +# 32 76 141 204c8d +# 37 82 146 255292 +# 52 94 153 345e99 +# 73 110 162 496ea2 +# 91 124 172 5b7cac +# 108 136 180 6c88b4 +# 120 146 186 7892ba +# 131 158 193 839ec1 +# 255 255 255 ffffff +# 146 170 200 92aac8 +# 162 182 209 a2b6d1 +# 183 199 219 b7c7db +# 204 216 230 ccd8e6 +# 221 229 238 dde5ee +# 235 241 245 ebf1f5 +# 246 251 254 f6fbfe +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function svg_convertPngToSyslinux { + + # Define number of colors the images will be produced on. + local COLORS='16' + + # Define options using those passed to actions from pre-rendition + # configuration script. These options are applied to pnmremap when + # doing color reduction, so any option available for pnmremap + # command can be passed to renderSyslinux functionality. + local OPTIONS=$(render_getConfigOption "$ACTION" '2-') + + # Check options passed to action. This is required in order to + # aviod using options already used in this script. For example + # -verbose and -mapfile options. + for OPTION in $OPTIONS;do + # Remove anything after equal sign inside option. + OPTION=$(echo $OPTION | cut -d'=' -f1) + if [[ "$OPTION" =~ "-(mapfile|verbose)" ]];then + cli_printMessage "`eval_gettext "The \\\"\\\$OPTION\\\" option is already used."`" --as-error-line + fi + done + + # Define default file name prefix for 16 colors images. + local PREFIX="-${COLORS}c" + + # Re-define 16 colors images default file name prefix using + # options as reference. This is useful to differenciate final + # files produced using Floyd-Steinberg dithering and final files + # which are not. + if [[ "$OPTIONS" =~ '-floyd' ]];then + PREFIX="${PREFIX}-floyd" + fi + + # Define logs' file. Log files are stored in the same place of + # images and are used to store output information produced by + # programs when the image files are built up. + local LOGS=${FILE}${PREFIX}.log + + # Define absolute path to GPL palette. The GPL palette defines the + # color information used to build syslinux images. This palette + # should be set to 16 colors and, as specified in isolinux + # documentation, the background color should be indexed on + # position 0 and the forground in position 7 (see + # /usr/share/doc/syslinux-X.XX/isolinux.doc, for more + # information.) + local PALETTE_GPL=${MOTIF_DIR}/Palettes/syslinux.gpl + + # Verify GPL palette existence. If it doesn't exist copy the one + # provided by the design model through subversion (to keep track + # of the change) and expand translation markers in the copied + # instance. + if [[ ! -f $PALETTE_GPL ]];then + cli_runFnEnvironment vcs --copy ${MODEL_BASEDIR}/${FLAG_THEME_MODEL}/Palettes/syslinux.gpl ${PALETTE_GPL} + cli_expandTMarkers ${PALETTE_GPL} + fi + + # Define absolute path to PPM palette. The PPM palette is built + # from source palette (PALETTE_GPL) and provides the color + # information understood by `ppmremap', the program used to + # produce images in a specific amount of colors. + local PALETTE_PPM=$(cli_getTemporalFile "syslinux.ppm") + + # Define the HEX palette. The HEX palette is built from source + # palette (PALETTE_GPL) and provides the color information in the + # format understood by `ppmtolss16', the program used to produce + # images in LSS16 format. The HEX palette stores just one line + # with the color information as described in isolinux + # documentation (i.e #RRGGBB=0 #RRGGBB=1 ... [all values in the + # same line]) + local PALETTE_HEX=$(cli_getTemporalFile "syslinux.hex") + + # Create image in Netpbm superformat (PNM). The PNM image file is + # created from the PNG image rendered previously as centos-art + # base-rendition output. The PNM image is an intermediate format + # used to manipulate images through Netpbm tools. + cli_printMessage "${FILE}.pnm" --as-savedas-line + pngtopnm -verbose \ + < ${FILE}.png 2>${LOGS} > ${FILE}.pnm + + # Print the path to GPL palette. + cli_printMessage "$PALETTE_GPL" --as-palette-line + + # Create PPM palette using GPL palette. + svg_convertGplToPpm "$PALETTE_GPL" "$PALETTE_PPM" "$COLORS" + + # Create HEX palette using GPL palette. + svg_convertGplToHex "$PALETTE_GPL" "$PALETTE_HEX" "$COLORS" + + # Reduce colors as specified in PPM palette. Here we use the PPM + # palette to enforce the color position in the image index and the + # Floyd-Steinberg dithering in order to improve color reduction. + cli_printMessage "${FILE}${PREFIX}.pnm" --as-savedas-line + pnmremap -verbose -mapfile=$PALETTE_PPM $OPTIONS \ + < ${FILE}.pnm 2>> ${LOGS} > ${FILE}${PREFIX}.pnm + + # Create LSS16 image. + cli_printMessage "${FILE}${PREFIX}.lss" --as-savedas-line + ppmtolss16 $(cat $PALETTE_HEX) \ + < ${FILE}${PREFIX}.pnm 2>>${LOGS} > ${FILE}${PREFIX}.lss + + # Remove HEX palette. It is no longer needed. + if [[ -f ${PALETTE_HEX} ]];then + rm $PALETTE_HEX + fi + + # Create PPM image indexed to 16 colors. Also the colormap used in + # the LSS16 image is saved on ${FILE}.log; this is useful to + # verify the correct order of colors in the image index. + cli_printMessage "${FILE}${PREFIX}.ppm" --as-savedas-line + lss16toppm -map \ + < ${FILE}${PREFIX}.lss 2>>${LOGS} > ${FILE}${PREFIX}.ppm + + # Create PNG image indexed to 16 colors. + cli_printMessage "${FILE}${PREFIX}.png" --as-savedas-line + pnmtopng -verbose \ + < ${FILE}${PREFIX}.pnm 2>>${LOGS} > ${FILE}${PREFIX}.png + + # Remove PPM palette. It is no longer needed. + if [[ -f ${PALETTE_PPM} ]];then + rm $PALETTE_PPM + fi + +} diff --git a/Automation/centos-art.sh-mods/Render/Svg/svg_convertPngToThumbnail.sh b/Automation/centos-art.sh-mods/Render/Svg/svg_convertPngToThumbnail.sh new file mode 100755 index 0000000..52dcf3b --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Svg/svg_convertPngToThumbnail.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# +# svg_convertPngToThumbnail.sh -- This function provides +# post-rendition to create thumbnails from images produced by +# centos-art base-rendition. Thumbnails are created in PNG and JPG +# format for you to decide which is the more appropriate one. When no +# size is specified, thumbnails are created at 250 pixels width and +# height is automatically calculated to match the image ratio. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function svg_convertPngToThumbnail { + + # Get image size. + local SIZE='' + local SIZES=$(render_getConfigOption "$ACTION" '2-') + + # Check image sizes and do convertion. + if [[ "$SIZES" == "" ]];then + SIZES='250' + fi + + # Check base file existence. + cli_checkFiles -e "${FILE}.png" + + # Create thumbnails. + for SIZE in $SIZES;do + cli_printMessage "${FILE}-thumb-${SIZE}.png" --as-savedas-line + convert -thumbnail ${SIZE} ${FILE}.png ${FILE}-thumb-${SIZE}.png + cli_printMessage "${FILE}-thumb-${SIZE}.jpg" --as-savedas-line + convert -thumbnail ${SIZE} ${FILE}-thumb-${SIZE}.png ${FILE}-thumb-${SIZE}.jpg + cli_printMessage "${FILE}-thumb-${SIZE}.pdf" --as-savedas-line + convert -thumbnail ${SIZE} ${FILE}-thumb-${SIZE}.png ${FILE}-thumb-${SIZE}.pdf + done + +} diff --git a/Automation/centos-art.sh-mods/Render/Svg/svg_doLastActions.sh b/Automation/centos-art.sh-mods/Render/Svg/svg_doLastActions.sh new file mode 100755 index 0000000..5562eeb --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Svg/svg_doLastActions.sh @@ -0,0 +1,72 @@ +#!/bin/bash +# +# svg_doLastActions.sh -- This function performs last-rendition +# actions for SVG files. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function svg_doLastActions { + + # Verify position of file being produced in the list of files been + # currently processed. + if [[ $THIS_FILE_DIR == $NEXT_FILE_DIR ]];then + return + fi + + local ACTION='' + + # Redefine SVG last-rendition actions as local to avoid undesired + # concatenation when massive rendition is performed. + local -a LASTACTIONS + + # Define SVG directory-specific actions. This is required in order + # to provide a predictable way of producing content inside the + # repository and save you the time of writing long several + # commands each time you need to produce images inside the + # repository. + if [[ $FLAG_DONT_DIRSPECIFIC == 'false' ]];then + if [[ $TEMPLATE =~ "Distro/$(cli_getPathComponent --release-pattern)/Gdm/.+\.svg$" ]];then + LASTACTIONS[((++${#LASTACTIONS[*]}))]='convertPngToDm:Gdm:800x600 1024x768 1280x1024 1360x768 2048x1536 2560x1240' + elif [[ $TEMPLATE =~ "Distro/$(cli_getPathComponent --release-pattern)/Kdm/.+\.svg$" ]];then + LASTACTIONS[((++${#LASTACTIONS[*]}))]='convertPngToDm:Kdm:800x600 1024x768 1280x1024 1360x768 2048x1536 2560x1240' + elif [[ $TEMPLATE =~ "Distro/$(cli_getPathComponent --release-pattern)/Ksplash/.+\.svg$" ]];then + LASTACTIONS[((++${#LASTACTIONS[*]}))]='convertPngToKsplash:' + fi + fi + + # Define SVG last-rendition actions. Since last-rendition makes + # use of all files in the output directory structure and + # directory-specific rendition modifies all the files in the + # output directory structure as well, these actions must be + # defined after the directory-specific definition. Otherwise, + # modifications impossed by these actions may interfier the whole + # purpose of having a directory-specific rendition. + [[ $FLAG_LASTRENDITION != '' ]] && LASTACTIONS[((++${#LASTACTIONS[*]}))]="doLastActions:(png|jpg):${FLAG_LASTRENDITION}" + + # At this point centos-art.sh should be producing the last file + # from the same unique directory structure, so, before producing + # images for the next directory structure lets execute the list of + # last-rendition actions for the current directory structure. + for ACTION in "${LASTACTIONS[@]}"; do + svg_$(echo "$ACTION" | cut -d: -f1) + done + +} diff --git a/Automation/centos-art.sh-mods/Render/Svg/svg_doLastCommand.sh b/Automation/centos-art.sh-mods/Render/Svg/svg_doLastCommand.sh new file mode 100755 index 0000000..458ec6b --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Svg/svg_doLastCommand.sh @@ -0,0 +1,71 @@ +#!/bin/bash +# +# svg_doLastCommand.sh -- This function standardizes the way +# last-rendition commands are applied to base-rendition and +# post-rendition outputs. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function svg_doLastCommand { + + # Define the file extensions. This value is a regular expression + # pattern which must match the file extensions that last-rendition + # actions will be applied to. + local EXTENSION=$(render_getConfigOption "$ACTION" '2') + + # Define the command string that will be evaluated as + # last-rendition action. Only commands that perform in-place + # modifications can be passed here. + local COMMAND=$(render_getConfigOption "$ACTION" '3-') + + # Define the list of files to process. This value contain all the + # files in the output directory which extension match the + # extension pattern previously defined. + local FILE='' + local FILES=$(cli_getFilesList $OUTPUT --pattern="^.+\.${EXTENSION}$") + + for FILE in $FILES;do + + # Identify file before processing it. Only formats recognized + # by ImageMagick are supported. In case the file isn't + # supported by ImageMagick, continue with the next file in the + # list. + identify -quiet ${FILE} > /dev/null + if [[ $? -ne 0 ]];then + continue + fi + + # Print action message. + cli_printMessage "${FILE}" --as-updating-line + + # Execute mogrify action on all files inside the same + # directory structure. + eval ${COMMAND} ${FILE} + + # Be sure the command was executed correctly. Otherwise stop + # script execution. + if [[ $? -ne 0 ]];then + exit + fi + + done + +} diff --git a/Automation/centos-art.sh-mods/Render/Svg/svg_doPostActions.sh b/Automation/centos-art.sh-mods/Render/Svg/svg_doPostActions.sh new file mode 100755 index 0000000..86b998e --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Svg/svg_doPostActions.sh @@ -0,0 +1,91 @@ +#!/bin/bash +# +# svg_doPostActions.sh -- This function performs post-rendition +# actions for SVG files. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function svg_doPostActions { + + local ACTION='' + + # Redefine SVG post-rendition actions as local to avoid undesired + # concatenation when massive rendition is performed. + local -a POSTACTIONS + + # Define default comment written to base-rendition output. + local COMMENT="`gettext "Created in CentOS Artwork Repository"` ($(cli_printUrl '--svn')artwork/)" + + # Define SVG post-rendition actions. Since these actions are + # applied to base-rendition output and base-rendition output is + # used as reference to perform directory-specific rendition, these + # action must be defined before directory-specific rendition. + # Otherwise it wouldn't be possible to propagate changes imposed + # by these actions to new files produced as result of + # directory-specific rendition. + POSTACTIONS[((++${#POSTACTIONS[*]}))]="doPostCommand:png:mogrify -comment '$COMMENT'" + [[ $FLAG_POSTRENDITION != '' ]] && POSTACTIONS[((++${#POSTACTIONS[*]}))]="doPostCommand:png:${FLAG_POSTRENDITION}" + + # Define SVG directory-specific rendition. Directory-specfic + # rendition provides a predictable way of producing content inside + # the repository. + if [[ $FLAG_DONT_DIRSPECIFIC == 'false' ]];then + + if [[ $TEMPLATE =~ "Identity/(Models|Images)/Themes/.+\.${RENDER_EXTENSION}$" ]];then + + POSTACTIONS[((++${#POSTACTIONS[*]}))]="convertPngToBranded" + + if [[ $TEMPLATE =~ "Backgrounds/.+\.${RENDER_EXTENSION}$" ]];then + POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngTo:jpg' + POSTACTIONS[((++${#POSTACTIONS[*]}))]='groupBy:png jpg' + + elif [[ $TEMPLATE =~ "Concept/.+\.${RENDER_EXTENSION}$" ]];then + POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngTo:jpg pdf' + POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngToThumbnail:250' + + elif [[ $TEMPLATE =~ "Distro/$(cli_getPathComponent --release-pattern)/Syslinux/.+\.${RENDER_EXTENSION}$" ]];then + POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngToSyslinux:' + POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngToSyslinux:-floyd' + + elif [[ $TEMPLATE =~ "Distro/$(cli_getPathComponent --release-pattern)/Grub/.+\.${RENDER_EXTENSION}$" ]];then + POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngToGrub:' + POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngToGrub:-floyd' + + elif [[ $TEMPLATE =~ "Posters/.+\.${RENDER_EXTENSION}$" ]];then + POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngTo:jpg pdf' + fi + + elif [[ $TEMPLATE =~ "Identity/Models/Icons/.+\.${RENDER_EXTENSION}$" ]];then + POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngToIcons' + + elif [[ $TEMPLATE =~ "Identity/Models/Manuals.+\.${RENDER_EXTENSION}$" ]];then + POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngTo:jpg pdf' + + fi + + fi + + # Execute SVG post-rendition actions. + for ACTION in "${POSTACTIONS[@]}"; do + svg_$(echo "$ACTION" | cut -d: -f1) + done + +} diff --git a/Automation/centos-art.sh-mods/Render/Svg/svg_doPostCommand.sh b/Automation/centos-art.sh-mods/Render/Svg/svg_doPostCommand.sh new file mode 100755 index 0000000..42c7738 --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Svg/svg_doPostCommand.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# +# svg_doPostCommand.sh -- This function standardizes the way +# post-rendition commands are applied to base-rendition output. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function svg_doPostCommand { + + # Define the file extension of base-rendition output. + local EXTENSION=$(render_getConfigOption "$ACTION" '2') + + # Define the command string. + local COMMAND=$(render_getConfigOption "$ACTION" '3-') + + # Verify the absolute path of base-rendition output. + cli_checkFiles -e ${FILE}.${EXTENSION} + + # Execute the command string on base-rendition output. + eval $COMMAND ${FILE}.${EXTENSION} + + # Be sure the command string was executed correctly. Otherwise + # stop the script execution. + if [[ $? -ne 0 ]];then + exit + fi + +} diff --git a/Automation/centos-art.sh-mods/Render/Svg/svg_doTranslation.sh b/Automation/centos-art.sh-mods/Render/Svg/svg_doTranslation.sh new file mode 100755 index 0000000..2dc359e --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Svg/svg_doTranslation.sh @@ -0,0 +1,96 @@ +#!/bin/bash +# +# svg_doTranslation.sh -- This function standardizes the way +# translation files are applied to SVG design models in order to +# produce the translated instance that is used to expand translation +# markers and produce PNG output in different languages. +# +# Assuming no translation file exists, an untranslated instace is +# taken from the design model and created (i.e., just a copy) from it. +# Using a design model instance (translated or not) is required in +# order to expand translation markers safetly. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function svg_doTranslation { + + # Define which command will be used to output the template + # content. This is required because template files might be found + # as compressed files inside the repository. + local COMMAND="/bin/cat" + if [[ $(file -b -i $TEMPLATE) =~ '^application/x-gzip$' ]];then + COMMAND="/bin/zcat" + fi + + # Move into template's directory in order to satisfy relative + # entities. Take care that some XML documents (e.g., DocBook + # documents) can use entities relatively from their base + # locations. In order to process such documents, it is necessary + # to put the template directory up in the directory stack and + # create the instance from there. Thus, it is possible to expand + # relative entities correctly when validating the document. + pushd $(dirname $TEMPLATE) > /dev/null + + # Verify translation file existence and create template + # instance accordingly. + if [[ -f ${TRANSLATION} ]];then + + # Print final location of translation file. + cli_printMessage "${TRANSLATION}" --as-translation-line + + # Create translation instance to combine both template + # translation and licenses translations. + local TRANSLATION_INSTANCE=${TMPDIR}/message.po + + # In the case of SVG and other files, license translations is + # not required so we don't combine it into the template + # translation. + cp ${TRANSLATION} ${TRANSLATION_INSTANCE} + + # Create the translated instance of design model. + ${COMMAND} ${TEMPLATE} | xml2po -a -l ${CLI_LANG_LL} \ + -p ${TRANSLATION_INSTANCE} -o ${INSTANCE} - + + # Remove .xml2po.mo temporal file. + if [[ -f ${PWD}/.xml2po.mo ]];then + rm ${PWD}/.xml2po.mo + fi + + # Remove instance created to store both licenses and template + # translations. + if [[ -f ${TRANSLATION_INSTANCE} ]];then + rm ${TRANSLATION_INSTANCE} + fi + + else + + # Create the non-translated instance of design model. + ${COMMAND} ${TEMPLATE} > ${INSTANCE} + + fi + + # Return to where we were. + popd > /dev/null + + # Verify instance existence. + cli_checkFiles -e $INSTANCE + +} diff --git a/Automation/centos-art.sh-mods/Render/Svg/svg_getColors.sh b/Automation/centos-art.sh-mods/Render/Svg/svg_getColors.sh new file mode 100755 index 0000000..2b4ccd9 --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Svg/svg_getColors.sh @@ -0,0 +1,154 @@ +#!/bin/bash +# +# svg_getColors.sh -- This function takes one palette produced by Gimp +# (e.g., syslinux.gpl) as input and outputs a list of colors in the +# specified format. In order for this function to output the color in +# the format specified, it is needed that the fourth column in the gpl +# palette be set in the `rrggbb' format and the appropriate conversion +# be implemented here. +# +# Notice that using both the `--head' and `--tail' options it is +# possible to control how many consecutive items does the list of +# colors is going to have. It is possible to output all colors in the +# list, or a consecutive range of them. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function svg_getColors { + + # Define short options. + local ARGSS='' + + # Define long options. + local ARGSL='head:,tail:,format:' + + # Initialize both head and tail values to return the first line of + # color information from the palette. + local HEAD=1 + local TAIL=1 + + # Initialize format value used as default when no format option be + # provided. + local FORMAT='rrggbb' + + # Initialize list of colors. + local COLORS='' + + # Initialize arguments with an empty value and set it as local + # variable to this function scope. Doing this is very important to + # avoid any clash with higher execution environments. + local ARGUMENTS='' + + # Prepare ARGUMENTS variable for getopt. + cli_parseArgumentsReDef "$@" + + # Redefine ARGUMENTS using getopt(1) command parser. + cli_parseArguments + + # Redefine positional parameters using ARGUMENTS variable. + eval set -- "$ARGUMENTS" + + # Look for options passed through positional parameters. + while true;do + + case "$1" in + + --head ) + HEAD=$2 + shift 2 + ;; + + --tail ) + TAIL=$2 + shift 2 + ;; + + --format ) + FORMAT=$2 + shift 2 + ;; + + -- ) + shift 1 + break + ;; + esac + done + + # Define path to gpl palette. This is the first file we use to + # retrieve color information from. Only the first file provided + # will be used. + local PALETTE=$(echo $@ | cut -d' ' -f1) + + if [[ ! -f $PALETTE ]];then + + # Define palette path inside the theme's artistic motif. + local MOTIF_PALETTE=${TCAR_WORKDIR}/Identity/Images/Themes/$(cli_getPathComponent $ACTIONVAL --motif)/Palettes/grub.gpl + + # Define palette path inside the theme's design model. + local MODEL_PALETTE=${TCAR_WORKDIR}/Identity/Models/Themes/${THEME_MODEL_NAME}/Palettes/grub.gpl + + # Redefine default background color using palettes provided by + # artistic motif first, and design model later. Assuming none + # of them is present, use The CentOS Project default color + # then. + if [[ -f $MOTIF_PALETTE ]];then + COLORS=$(svg_getColors $MOTIF_PALETTE --head=1 --tail=1) + elif [[ -f $MODEL_PALETTE ]];then + COLORS=$(svg_getColors $MODEL_PALETTE --head=1 --tail=1) + else + COLORS='#204c8d' + fi + + else + + # Retrieve the fourth column from GPL palette. The fourth + # column of a GPL palette contains the palette commentary + # field. The palette commentary field can be anything, but for + # the sake of our own convenience we use it to store the color + # value in hexadecimal format (e.g., rrggbb). Notice that you + # can put your comments from the fifth column on using an + # space as field separator. + COLORS=$(sed -r '1,/^#/d' $PALETTE \ + | awk '{ printf "%s\n", $4 }' | head -n $HEAD | tail -n $TAIL) + + fi + + # Implement color formats conversions from rrggbb to other formats + # that you might need to use. + for COLOR in $COLORS;do + + case $FORMAT in + + rrggbb|* ) + if [[ ! $COLOR =~ '^#' ]];then + COLOR="#${COLOR}" + fi + ;; + + esac + + # Output color value. + echo "$COLOR" + + done + +} diff --git a/Automation/centos-art.sh-mods/Render/Svg/svg_getTTFont.sh b/Automation/centos-art.sh-mods/Render/Svg/svg_getTTFont.sh new file mode 100755 index 0000000..78b6050 --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Svg/svg_getTTFont.sh @@ -0,0 +1,71 @@ +#!/bin/bash +# +# cli_getFont.sh -- This function creates a list of all True Type +# Fonts (TTF) installed in your workstation and returns the absolute +# path of the file matching the pattern passed as first argument. +# Assuming more than one value matches, the first one in the list is +# used. In case no match is found, the function verifies if there is +# any file in the list that can be used (giving preference to sans +# files). If no file is found at this point, an error will be printed +# out. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function svg_getTTFont { + + local -a FONT_PATTERNS + local FONT_PATTERN='' + local FONT_FILE='' + + # Define list of patterns used to build the list of TTF files. + FONT_PATTERNS[((++${#FONT_PATTERNS[*]}))]="/${1}\.ttf$" + FONT_PATTERNS[((++${#FONT_PATTERNS[*]}))]="sans\.ttf$" + FONT_PATTERNS[((++${#FONT_PATTERNS[*]}))]="\.ttf$" + + # Define directory location where fonts are installed in your + # workstation. + local FONT_DIR='/usr/share/fonts' + + # Define list of all TTF files installed in your workstation. + local FONT_FILES=$(cli_getFilesList ${FONT_DIR} --pattern="^.+\.ttf$") + + # Define TTF absolute path based on pattern. Notice that if the + # pattern matches more than one value, only the first one of a + # sorted list will be used. + for FONT_PATTERN in ${FONT_PATTERNS[@]};do + + FONT_FILE=$(echo "$FONT_FILES" | egrep ${FONT_PATTERN} \ + | head -n 1) + + if [[ -f $FONT_FILE ]];then + break + fi + + done + + # Output TTF absolute path. + if [[ -f $FONT_FILE ]];then + echo $FONT_FILE + else + cli_printMessage "`gettext "The font provided doesn't exist."`" --as-error-line + fi + +} diff --git a/Automation/centos-art.sh-mods/Render/Svg/svg_groupBy.sh b/Automation/centos-art.sh-mods/Render/Svg/svg_groupBy.sh new file mode 100755 index 0000000..25d334c --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/Svg/svg_groupBy.sh @@ -0,0 +1,70 @@ +#!/bin/bash +# +# svg_groupBy.sh -- This function provides post-rendition action to +# group files inside directories named as their file extensions. For +# example: if the current file is a .png file, it is moved inside a +# Png/ directory; if the current file is a .jpg file, it is stored +# inside a Jpg/ directory, and so on. +# +# For this function to work correctly, you need to specify which file +# type you want to group. This is done in the post-rendition ACTIONS +# array inside the appropriate `render.conf.sh' pre-configuration +# script. This function cannot be used as last-rendition action. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function svg_groupBy { + + local SOURCE='' + local TARGET='' + + # Sanitate file types passed from render.conf.sh pre-rendition + # configuration script. + local FORMAT='' + local FORMATS=$(render_getConfigOption "$ACTION" '2-') + + for FORMAT in $FORMATS;do + + # Redifine source file we want to move. + SOURCE=${FILE}.${FORMAT} + + # Define target directory where source file will be moved + # into. + TARGET=$(dirname "$FILE")/$(cli_getRepoName $FORMAT -d) + + # Check existence of source file. + cli_checkFiles -e $SOURCE + + # Check existence of target directory. + if [[ ! -d $TARGET ]];then + mkdir -p $TARGET + fi + + # Redifine file path to add file and its type. + TARGET=${TARGET}/$(cli_getRepoName $FILE -f).${FORMAT} + + # Move file into its final location. + cli_printMessage "$TARGET" --as-movedto-line + mv ${SOURCE} ${TARGET} + + done + +} diff --git a/Automation/centos-art.sh-mods/Render/render.sh b/Automation/centos-art.sh-mods/Render/render.sh new file mode 100755 index 0000000..d271baa --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/render.sh @@ -0,0 +1,151 @@ +#!/bin/bash +# +# render.sh -- This function standardizes the way source files are +# rendered inside the working copy. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function render { + + local ACTIONNAM='' + local ACTIONVAL='' + + # Initialize `--releasever' option. The release version option + # controls the release number used to produce release-specific + # content. By default, the release number of The CentOS + # Distribution you have installed in your workstation is used. + local FLAG_RELEASEVER=$(cat /etc/redhat-release \ + | gawk '{ print $3 }') + + # Initialize `--basearch' option. The base architecture option + # controls the architecture type used to produce + # architecture-specific content. By default, the hardware + # platform of your workstation is used. + local FLAG_BASEARCH=$(uname -i) + + # Initialize `--theme-model' option. The theme model option + # specifies the theme model name used to produce theme + # artistic motifs. + local FLAG_THEME_MODEL='Default' + + # Initialize `--post-rendition' option. This option defines what + # command to use as post-rendition. Post-rendition takes place + # over base-rendition output. + local FLAG_POSTRENDITION='' + + # Initialize `--last-rendition' option. This option defines what + # command to use as last-rendition. Last-rendition takes place + # once both base-rendition and post-rendition has been performed + # in the same directory structure. + local FLAG_LASTRENDITION='' + + # Initialize `--dont-dirspecific' option. This option can take two + # values only (e.g., `true' or `false') and controls whether to + # perform or not directory-specific rendition. Directory-specific + # rendition may use any of the three types of renditions (e.g., + # base-rendition, post-rendition and last-rendition) to accomplish + # specific tasks when specific directory structures are detected + # in the rendition flow. By default, the centos-art.sh script + # performs directory-specific rendition. + local FLAG_DONT_DIRSPECIFIC='false' + + # Initialize `--with-brands' option. This option controls whether + # to brand output images or not. By default output images are not + # branded. + local FLAG_WITH_BRANDS='false' + + # Initialize list of supported file extensions. These file + # extensions are used to build the list of source files we'll use + # to create images from. The order in which these extensions are + # listed here determines the order in which they are process if + # more than one is found in the same location. + local RENDER_EXTENSIONS='svgz svg docbook conf' + + # Initialize the rendition format name as an empty value. The name + # of rendition format is determined later at rendition time, based + # on template file extension. + local RENDER_FORMAT='' + + # Initialize absolute path to format's base directory, the place + # where format-specific directories are stored in. + local RENDER_FORMAT_DIR="${CLI_FUNCDIR}/${CLI_FUNCDIRNAM}" + + # Interpret arguments and options passed through command-line. + render_getOptions + + # Redefine positional parameters using ARGUMENTS. At this point, + # option arguments have been removed from ARGUMENTS variable and + # only non-option arguments remain in it. + eval set -- "$ARGUMENTS" + + # Define action value. We use non-option arguments to define the + # action value (ACTIONVAL) variable. + for ACTIONVAL in "$@";do + + # Sanitate non-option arguments to be sure they match the + # directory conventions established by centos-art.sh script + # against source directory locations in the working copy. + ACTIONVAL=$(cli_checkRepoDirSource ${ACTIONVAL}) + + # Verify non-option arguments passed to centos-art.sh + # command-line. The path provided as argument must exist in + # the repository. Otherwise, it would be possible to create + # arbitrary directories inside the repository without any + # meaning. In order to be sure all required directories are + # available in the repository it is necessary use the prepare + # functionality. + #cli_checkFiles ${ACTIONVAL} -d + + # Define render-able directories and the way they are + # produced. To describe the way render-able directories are + # produced, we take the action value (ACTIONVAL) as reference + # and describe the production through an action name + # (ACTIONNAM). + if [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/Identity/Images/Themes" ]];then + ACTIONNAM="render_setThemes" + elif [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/Identity/Images/Brands" ]];then + ACTIONNAM="render_setBrands" + elif [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/Identity/Images" ]];then + ACTIONNAM="render_setBaseRendition" + elif [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/Documentation/Manuals/(Docbook|Svg)/[[:alnum:]-]+" ]];then + ACTIONNAM="render_setBaseRendition" + else + cli_printMessage "`gettext "The path provided doesn't support rendition."`" --as-error-line + fi + + # Synchronize changes between repository and working copy. At + # this point, changes in the repository are merged in the + # working copy and changes in the working copy committed up to + # repository. + cli_synchronizeRepoChanges "${ACTIONVAL}" + + # Execute action name. + ${ACTIONNAM} + + # Synchronize changes between repository and working copy. At + # this point, changes in the repository are merged in the + # working copy and changes in the working copy committed up to + # repository. + cli_synchronizeRepoChanges "${ACTIONVAL}" + + done + +} diff --git a/Automation/centos-art.sh-mods/Render/render_getConfigOption.sh b/Automation/centos-art.sh-mods/Render/render_getConfigOption.sh new file mode 100755 index 0000000..dbf1937 --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/render_getConfigOption.sh @@ -0,0 +1,71 @@ +#!/bin/bash +# +# render_getConfigOption.sh -- This function standardizes the +# configuration fields are retrived from some action-specific +# definitions. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function render_getConfigOption { + + # Initialize action string. + local ACTION="$1" + + # Initialize field definition. + local FIELD="$2" + + # Initialize configuration options. + local OPTION='' + + # Check action string. The action string must be present in order + # for this function to work. It provides the information needed to + # retrive configurantion options from. + if [[ "$ACTION" == '' ]];then + cli_printMessage "`gettext "There is no action string to work with."`" --as-error-line + fi + + # Check field definition. The field definition must match any of + # the formats specified by the `-f' option of `cut' command. + if [[ ! "$FIELD" =~ '^([0-9]+|[0-9]+-|-[0-9]+|[0-9]+-[0-9]+)$' ]];then + cli_printMessage "`gettext "The field definition is not valid."`" --as-error-line + fi + + # Get configuration option from action string. + OPTION=$(echo -n "$ACTION" | cut -d: -f${FIELD}) + + # Sanitate configuration option retrived from action string. + OPTION=$(echo -n "${OPTION}" \ + | sed -r 's!^ *!!g' \ + | sed -r 's!( |,|;) *! !g' \ + | sed -r 's! *$!!g') + + # Print out the configuration option retrived from action string, + # only if it is not an empty value. Do not use `echo' or `printf' + # built-in commands here. Use the `cli_printMessage' functionality + # instead. This is required in order to reverse the apostrophe + # codification accomplished when options were retrived from + # command-line (cli_parseArgumentsReDef) in the argument of + # options like `--post-rendition' and `--last-rendition'. + if [[ $OPTION != '' ]];then + cli_printMessage "$OPTION" --as-stdout-line + fi + +} diff --git a/Automation/centos-art.sh-mods/Render/render_getDirOutput.sh b/Automation/centos-art.sh-mods/Render/render_getDirOutput.sh new file mode 100755 index 0000000..ffc475e --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/render_getDirOutput.sh @@ -0,0 +1,83 @@ +#!/bin/bash +# +# render_getDirOutput.sh -- This function defines the final +# absolute path the centos-art.sh script uses to store identity +# contents produced at rendition time. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function render_getDirOutput { + + # Define base output directory using design model path as + # reference. + OUTPUT=$(dirname $FILE | sed -r \ + -e "s!Identity/Models!Identity/Images!" \ + -e "s!Themes/${FLAG_THEME_MODEL}!Themes/$(cli_getPathComponent $ACTIONVAL --motif)!" \ + -e "s!Documentation/Models!Documentation/Manuals!" \ + -e "s!/Models!!") + + # By default, images rendered are stored under Identity/Images + # directory structure. But if an `Images/' directory exists in the + # current location use it instead. + if [[ -d "${OUTPUT}/Images" ]];then + OUTPUT=${OUTPUT}/Images + fi + + # Redefine base output directory to introduce specific information + # like release number and architecture. This information is + # require by directories (e.g., the `Media' directory inside + # themes and the `Documentation/Manuals/Docbook/Distro' directory + # ) whose need this information to be passed explicitly at the + # command-line through the `--releasever' and `--basearch' + # options. Other directories take such information from the path + # they are stored in (e.g., the `Distro/5/Anaconda' directory + # inside themes.). So, we need to differentiate the way + # information like release numbers and architectures are retrieved + # in order to build the output path correctly at rendition time. + if [[ $OUTPUT =~ "^${MOTIF_DIR}/Media$" ]];then + OUTPUT=${OUTPUT}/${FLAG_RELEASEVER}/${FLAG_BASEARCH} + elif [[ $OUTPUT =~ 'Documentation/Manuals/Docbook/Distro$' ]];then + OUTPUT=${OUTPUT}/${FLAG_RELEASEVER} + else + OUTPUT=${OUTPUT} + fi + + # Define whether to use or not locale-specific directory to store + # content, using current locale information as reference. As + # convection, when we produce content, only specific locations + # use locale-specific directories to organize language-specific + # content (e.g., Manuals, Anaconda, Installation media, etc.). All + # other locations do not use locale-specific directories to + # organize content. This convection is important in order for + # the `prepare' functionality of centos-art.sh script to produce + # content in the correct location. Otherwise, we might end up + # duplicating content (e.g., icons, brands, etc.) which doesn't + # have any translation, nor any need to be translated. + if [[ ! ${CLI_LANG_LC} =~ '^en' ]];then + OUTPUT=${OUTPUT}/${CLI_LANG_LC} + fi + + # Create final output directory, if it doesn't exist yet. + if [[ ! -d ${OUTPUT} ]];then + mkdir -p ${OUTPUT} + fi + +} diff --git a/Automation/centos-art.sh-mods/Render/render_getDirTemplate.sh b/Automation/centos-art.sh-mods/Render/render_getDirTemplate.sh new file mode 100755 index 0000000..9c6058a --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/render_getDirTemplate.sh @@ -0,0 +1,84 @@ +#!/bin/bash +# +# render_getDirTemplate.sh -- This function defines the way renderable +# directories are processed inside the repository. Inside the +# repository, renderable directories are processed either through +# direct or theme-specific rendition. +# +# Direct rendition takes one XML file from design model +# (`Identity/Models') directory structure and produces one file +# in `Identity/Images' directory strucutre. In this +# configuration, the organization used to stored the design model is +# taken as reference to build the path required to store the image +# related to it under `Identity/Images' directory structure. +# +# Theme-specific rendition takes one design model from +# `Identity/Models/Themes' directory structure to produce one or +# more images in `Identity/Images/Themes/$THEME/$VERSION/$MODEL' +# directory structure. In this configuration we have many different +# artistic motifs that use one unique design model directory structure +# as reference to produce images. +# +# Since theme design models are unified to be reused by more +# than one artistic motif, it is not possible to render artistic +# motifs in a lineal manner (i.e., as we do with direct rendition) +# because we need to establish the relation between the artistic motif +# renderable directory structure and the design model first and that +# relation happens when renderable directory structures inside +# artistic motifs are processed individually. +# +# In the first rendition category, we use a design model directory +# structure as reference to produce images one by one. In the second +# rendition category, we can't use the same procedure because one +# design model directory structure is used to produce several +# renderable directory structures, not just one. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function render_getDirTemplate { + + # Initialize design models location used as reference to process + # renderable directory structures. + TEMPLATE=$ACTIONVAL + + # Define absolute path to input files using absolute path from + # output files. + if [[ -d ${TEMPLATE}/Models ]];then + TEMPLATE=${TEMPLATE}/Models + else + TEMPLATE=$(echo "$TEMPLATE" | sed -r \ + -e "s!/Themes/$(cli_getPathComponent $ACTIONVAL --motif)!/Themes/${FLAG_THEME_MODEL}!" \ + -e "s!/(Manuals|Images)!/Models!") + fi + + # Verify absolute path to input file. This verification is + # specially needed in those situations when the artistic motif + # directory structure has an organization different to that in + # design models directory structure. Since the path to design + # models is built from artistic motif directory structure, if + # artistic motifs directory structure is different from design + # model directory structure, as result we'll have a path to a + # design model that may not exist and that would make + # centos-art.sh script to fail. So, verify the absolute path to + # the input file and stop script execution if it doesn't exist. + cli_checkFiles -e $TEMPLATE + +} diff --git a/Automation/centos-art.sh-mods/Render/render_getOptions.sh b/Automation/centos-art.sh-mods/Render/render_getOptions.sh new file mode 100755 index 0000000..6598f99 --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/render_getOptions.sh @@ -0,0 +1,131 @@ +#!/bin/bash +# +# render_getOptions.sh -- This function interprets option parameters +# passed to `render' functionality and calls actions accordingly. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function render_getOptions { + + # Define short options we want to support. + local ARGSS="h,q" + + # Define long options we want to support. + local ARGSL="help,quiet,filter:,answer-yes,dont-dirspecific,releasever:,basearch:,post-rendition:,last-rendition:,theme-model:,with-brands,synchronize" + + # Redefine ARGUMENTS using getopt(1) command parser. + cli_parseArguments + + # Redefine positional parameters using ARGUMENTS variable. + eval set -- "$ARGUMENTS" + + # Look for options passed through command-line. + while true; do + + case "$1" in + + -h | --help ) + cli_runFnEnvironment help --read --format="texinfo" "tcar-fs::scripts:bash-functions-render" + shift 1 + exit + ;; + + -q | --quiet ) + FLAG_QUIET="true" + shift 1 + ;; + + --filter ) + FLAG_FILTER="$2" + shift 2 + ;; + + --answer-yes ) + FLAG_ANSWER="true" + shift 1 + ;; + + --dont-dirspecific ) + FLAG_DONT_DIRSPECIFIC="true" + shift 1 + ;; + + --post-rendition ) + FLAG_POSTRENDITION="$2" + shift 2 + ;; + + --last-rendition ) + FLAG_LASTRENDITION="$2" + shift 2 + ;; + + --basearch ) + FLAG_BASEARCH="$2" + if [[ ! $FLAG_BASEARCH =~ $(cli_getPathComponent --architecture-pattern) ]];then + cli_printMessage "`gettext "The architecture provided is not supported."`" --as-error-line + fi + shift 2 + ;; + + --releasever ) + FLAG_RELEASEVER="$2" + if [[ ! $FLAG_RELEASEVER =~ $(cli_getPathComponent --release-pattern) ]];then + cli_printMessage "`gettext "The release version provided is not supported."`" --as-error-line + fi + shift 2 + ;; + + --theme-model ) + FLAG_THEME_MODEL=$(cli_getRepoName $2 -d) + shift 2 + ;; + + --with-brands ) + FLAG_WITH_BRANDS='true' + shift 1 + ;; + + --synchronize ) + FLAG_SYNCHRONIZE='true' + shift 1 + ;; + + -- ) + # Remove the `--' argument from the list of arguments + # in order for processing non-option arguments + # correctly. At this point all option arguments have + # been processed already but the `--' argument still + # remains to mark ending of option arguments and + # beginning of non-option arguments. The `--' argument + # needs to be removed here in order to avoid + # centos-art.sh script to process it as a path inside + # the repository, which obviously is not. + shift 1 + break + ;; + esac + done + + # Redefine ARGUMENTS variable using current positional parameters. + cli_parseArgumentsReDef "$@" + +} diff --git a/Automation/centos-art.sh-mods/Render/render_setBaseRendition.sh b/Automation/centos-art.sh-mods/Render/render_setBaseRendition.sh new file mode 100755 index 0000000..8591dec --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/render_setBaseRendition.sh @@ -0,0 +1,276 @@ +#!/bin/bash +# +# render_setBaseRendition.sh -- This function performs base-rendition +# action for all files. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function render_setBaseRendition { + + local -a FILES + local FILE='' + local OUTPUT='' + local TEMPLATE='' + local TEMPLATES='' + local PARENTDIR='' + local TRANSLATION='' + local EXTERNALFILE='' + local EXTERNALFILES='' + local THIS_FILE_DIR='' + local NEXT_FILE_DIR='' + local RENDER_EXTENSION='' + local EXPORTID='' + local COUNT=0 + + # Verify default directory where design models are stored in. + cli_checkFiles -e "${TCAR_WORKDIR}/Identity/Models/Themes/${FLAG_THEME_MODEL}" + + # Redefine parent directory for current workplace. + PARENTDIR=$(basename "${ACTIONVAL}") + + # Loop through list of supported file extensions. + for RENDER_EXTENSION in ${RENDER_EXTENSIONS};do + + # Redefine rendition format name based on supported file + # extension. + if [[ $RENDER_EXTENSION =~ '^(svgz|svg)$' ]];then + RENDER_FORMAT='svg' + elif [[ $RENDER_EXTENSION =~ '^(docbook)$' ]];then + RENDER_FORMAT='docbook' + elif [[ $RENDER_EXTENSION =~ '^(conf)$' ]];then + RENDER_FORMAT='conf' + else + cli_printMessage "`eval_gettext "The \\\"\\\$RENDER_EXTENSION\\\" file extension is not supported yet."`" --as-error-line + fi + + # Redefine specific function export id. + EXPORTID="${CLI_FUNCDIRNAM}/$(cli_getRepoName ${RENDER_FORMAT} -d)/$(cli_getRepoName ${RENDER_FORMAT} -f)" + + # Define base location of template files using paths passed to + # centos-art.sh script as argument to. + render_getDirTemplate + + # Verify whether or not the source location of the path + # provided as argument to centos-art.sh script accepts or not + # localization messages. Don't produce localized content for + # repository components that don't accept it. + if [[ ! ${CLI_LANG_LC} =~ '^en' ]];then + cli_runFnEnvironment locale --is-localizable ${TEMPLATE} + fi + + # Define the list of files to process. Use an array variable + # to store the list of files to process. This make possible to + # realize verifications like: is the current base directory + # equal to the next one in the list of files to process? + # Questions like this let us to know when centos-art.sh is + # leaving a directory structure and entering another. This + # information is required in order for centos-art.sh to know + # when to apply last-rendition actions. + # + # Another issue is that some directories might be named as if + # they were files (e.g., using a render able extension like + # .docbook). In these situations we need to avoid such + # directories from being interpreted as a render able file. + # For this, pass the `--type="f"' option when building the + # list of files to process in order to retrieve regular files + # only. + # + # Another issue to consider here is that, in some cases, both + # templates and outputs might be in the same location. In + # these cases localized content are stored in the same + # location where template files are retrieved from and we need + # to avoid using localized content from being interpreted as + # design models. In that sake, build the list of files to + # process using the files directly stored in the directory + # passed as argument to centos-art.sh command-line. Don't go + # recursively here. + # + # Another issue to consider here, is the way of restricting + # the list of files to process. We cannot expand the pattern + # specified by FLAG_FILTER with a `.*' here (e.g., + # "${FLAG_FILTER}.*\.${RENDER_EXTENSION}") because that would + # suppress any possibility from the user to specify just one + # file name in locations where more than one file with the + # same name as prefix exists (e.g., `repository.docbook', + # `repository-preamble.docbook' and + # `repository-parts.docbook'). Instead, pass filtering + # control to the user whom can use regular expression markup + # in the `--filter' option to decide whether to match + # `repository.docbook' only (e.g., through + # `--filter="repository"') or `repository-preamble.docbook' + # and `repository-parts.docbook' but not `repository.docbook' + # (e.g., through `--filter="repository-.*"'). + if [[ ${RENDER_FORMAT} =~ "^docbook$" ]];then + + # When the render format is docbook, don't build a list of + # files to process. Instead, build the absolute path of + # the main file used to render docbook from models to + # final output manuals. This file must be stored directly + # inside the main manual's directory and named as it but + # with all letters in lowercase. + for FILE in $(cli_getFilesList ${TEMPLATE} \ + --maxdepth="1" --mindepth="1" \ + --pattern="^.*$(cli_getRepoName ${TEMPLATE} -f)\.${RENDER_EXTENSION}$" \ + --type="f");do + FILES[((++${#FILES[*]}))]=$FILE + done + + elif [[ ${RENDER_FORMAT} =~ "^conf$" ]];then + + # When the render format is conf, be sure it refers to + # image.conf files only. Other configuration files (e.g., + # branding.conf) cannot be processed this way because + # their configuration options and values haven't any + # meaning in this context. + for FILE in $(cli_getFilesList ${TEMPLATE} \ + --pattern="^.+/images\.${RENDER_EXTENSION}$" \ + --type="f");do + FILES[((++${#FILES[*]}))]=$FILE + done + + else + + # For all other cases, build a list of files to process + # using the path value pass as argument. + for FILE in $(cli_getFilesList ${TEMPLATE} \ + --pattern="^.+/${FLAG_FILTER}.*\.${RENDER_EXTENSION}$" \ + --type="f");do + FILES[((++${#FILES[*]}))]=$FILE + done + + fi + + # Verify list of files to process. Assuming no file was found, + # evaluate the next supported file extension. + if [[ ${#FILES[*]} -eq 0 ]];then + continue + fi + + # Initialize format-specific functionalities. + cli_exportFunctions "${EXPORTID}" + + # Start processing the base rendition list of FILES. Fun part + # approaching :-). + while [[ $COUNT -lt ${#FILES[*]} ]];do + + # Define base file. + FILE=${FILES[$COUNT]} + + # Define the base directory path for the current file being + # process. + THIS_FILE_DIR=$(dirname ${FILES[$COUNT]}) + + # Define the base directory path for the next file that will + # be process. + if [[ $(($COUNT + 1)) -lt ${#FILES[*]} ]];then + NEXT_FILE_DIR=$(dirname ${FILES[$(($COUNT + 1))]}) + else + NEXT_FILE_DIR='' + fi + + # Print separator line. + cli_printMessage '-' --as-separator-line + + # Print action message based on file extension. + if [[ ${FILE} =~ 'images\.conf$' ]] && [[ $FLAG_WITH_BRANDS == 'true' ]];then + cli_printMessage "${FILE}" --as-processing-line + elif [[ ${FILE} =~ 'brands\.conf$' ]];then + continue + else + cli_printMessage "${FILE}" --as-template-line + fi + + # Verify design models file existence. We cannot continue + # with out it. + cli_checkFiles ${FILE} -f + + # Define final location of translation file. + TRANSLATION=$(dirname ${FILE} \ + | sed -r 's!(Documentation|Identity)!Locales/\1!')/${CLI_LANG_LC}/messages.po + + # Define final location of template file. + TEMPLATE=${FILE} + + # Define final location of output directory. + render_getDirOutput + + # Get relative path to file. The path string (stored in + # FILE) has two parts: 1. the variable path and 2. the + # common path. The variable path is before the common + # point in the path string. The common path is after the + # common point in the path string. The common point is the + # name of the parent directory (stored in PARENTDIR). + # + # Identity/Models/Themes/.../Firstboot/3/splash-small.svg + # -------------------------^| the |^------------^ + # variable path | common | common path + # -------------------------v| point | v------------v + # Identity/Images/Themes/.../Firstboot/Img/3/splash-small.png + # + # What we do here is remove the variable path, the common + # point, and the file extension parts in the string + # holding the path retrieved from design models directory + # structure. Then we use the common path as relative path + # to store the final image file. + # + # The file extension is removed from the common path + # because it is set when we create the final image file. + # This configuration let us use different extensions for + # the same file name. + # + # When we render using base-rendition action, the + # structure of files under the output directory will be + # the same used after the common point in the related + # design model directory structure. + FILE=$(echo ${FILE} \ + | sed -r "s!.*${PARENTDIR}/!!" \ + | sed -r "s/\.${RENDER_EXTENSION}$//") + + # Define absolute path to final file (without extension). + FILE=${OUTPUT}/$(basename "${FILE}") + + # Define instance name from design model. + INSTANCE=$(cli_getTemporalFile ${TEMPLATE}) + + # Perform format base-rendition. + ${RENDER_FORMAT} + + # Remove template instance. + if [[ -f $INSTANCE ]];then + rm $INSTANCE + fi + + # Increment file counter. + COUNT=$(($COUNT + 1)) + + done + + # Reset counter to prevent accumulation of values. + COUNT=0 + + # Unset format-specific functionalities. + cli_unsetFunctions "${EXPORTID}" + + # Unset files list to prevent accumulation of values. + unset FILES + + done +} diff --git a/Automation/centos-art.sh-mods/Render/render_setBrands.sh b/Automation/centos-art.sh-mods/Render/render_setBrands.sh new file mode 100755 index 0000000..187c4df --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/render_setBrands.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# +# render_setBrands.sh -- This function performs brand-specific +# rendition. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function render_setBrands { + + local BRANDS_MODELS_DIR=${TCAR_WORKDIR}/Identity/Models/Brands + local BRANDS_IMAGES_DIR=${TCAR_WORKDIR}/Identity/Images/Brands + + render_setBrandsDirValidates ${BRANDS_IMAGES_DIR} ${ACTIONVAL} + render_setBrandsDirStructure ${BRANDS_MODELS_DIR} ${BRANDS_IMAGES_DIR} + + render_setBaseRendition + +} diff --git a/Automation/centos-art.sh-mods/Render/render_setBrandsDirStructure.sh b/Automation/centos-art.sh-mods/Render/render_setBrandsDirStructure.sh new file mode 100755 index 0000000..453e90c --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/render_setBrandsDirStructure.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# +# render_setBrandsDirectoryStructure.sh -- This function verifies the +# directory structure of brands images using the directory structure +# of brands models as reference. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function render_setBrandsDirStructure { + + local BRANDS_SOURCE_DIR=$(cli_checkRepoDirSource ${1}) + local BRANDS_TARGET_DIR=$(cli_checkRepoDirSource ${2}) + + cli_printMessage "${BRANDS_TARGET_DIR} `gettext "directory structures..."`" --as-checking-line + + cli_runFnEnvironment prepare ${BRANDS_SOURCE_DIR} ${BRANDS_TARGET_DIR} --directories + +} diff --git a/Automation/centos-art.sh-mods/Render/render_setBrandsDirValidates.sh b/Automation/centos-art.sh-mods/Render/render_setBrandsDirValidates.sh new file mode 100755 index 0000000..8622474 --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/render_setBrandsDirValidates.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# +# render_setBrandsDirVerification.sh -- This function standardize path +# verification between path provided in the command line and +# repository directory structure. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + + +function render_setBrandsDirValidates { + + local BRANDS_PATH_OK=$(cli_checkRepoDirSource ${1}) + local BRANDS_PATH_UNKNOWN=$(cli_checkRepoDirSource ${2}) + + cli_checkFiles ${BRANDS_PATH_UNKNOWN} --match="^${BRANDS_PATH_OK}" + + local BRANDS_PATH_UNKNOWN_MODEL=$(echo ${BRANDS_PATH_UNKNOWN} \ + | sed -r "s,/Images/,/Models/,") + + cli_checkFiles ${BRANDS_PATH_UNKNOWN_MODEL} -d + +} diff --git a/Automation/centos-art.sh-mods/Render/render_setThemes.sh b/Automation/centos-art.sh-mods/Render/render_setThemes.sh new file mode 100755 index 0000000..134d6aa --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/render_setThemes.sh @@ -0,0 +1,153 @@ +#!/bin/bash +# +# render_setThemes.sh -- This function performs theme-specific +# rendition. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function render_setThemes { + + local -a DIRS + local COUNT=0 + local NEXTDIR='' + local MOTIF_NAME='' + local MOTIF_DIR='' + + # Define base directory of artistic motifs. This is the location + # where all artistic motifs are stored in. + local MOTIF_BASEDIR="${TCAR_WORKDIR}/Identity/Images/Themes" + + # Define base directory of design models. This is the location + # where all design models are stored in. + local MODEL_BASEDIR="${TCAR_WORKDIR}/Identity/Models/Themes" + + # Verify directory structure for all theme-specific directories. + render_setThemesDirStructure "${MODEL_BASEDIR}/${FLAG_THEME_MODEL}" "${MOTIF_BASEDIR}" + + # Define directory structure of design models. Design models + # directory structures are used as reference to create artistic + # motifs directory structure. Use the `--pattern' option to be + # sure any modification to FLAG_FILTER won't affect the output + # result. We need to make matching everything here, no matter what + # the FLAG_FILTER value be. + local MODEL_DIR='' + local MODEL_DIRS="$(cli_getFilesList ${MODEL_BASEDIR}/${FLAG_THEME_MODEL} \ + --pattern='^.+/[^.svn][[:alnum:]_/-]+$' --type="d" \ + | sed -e "s!^.*/${FLAG_THEME_MODEL}!!" \ + -e '/^[[:space:]]*$/d' \ + -e 's!^/!!')" + + # Define design model regular expression patterns from design + # models directory structure. + local MODEL_PATTERN=$(echo "$MODEL_DIRS" | tr "\n" '|' \ + | sed -e 's!^|!!' -e 's!|$!!') + + # Define regular expression pattern that match the theme artistic + # motif component inside the path strings. + local MOTIF_PATTERN=$(cli_getPathComponent --motif-pattern) + + # Define list of render-able directory structures inside the + # artistic motif. As reference, to build this list, use design + # model directory structure. The more specific you be in the path + # specification the more specific theme rendition will be. Thus, + # we use the path provided as argument and the --filter option as + # reference to control the amount of directories considered + # render-able directory. + local MOTIF_RENDERABLE_DIR='' + local MOTIF_RENDERABLE_DIRS=$(cli_getFilesList ${MOTIF_BASEDIR} \ + --pattern="^${TCAR_WORKDIR}/${MOTIF_PATTERN}/($MODEL_PATTERN)$" --type="d" \ + | grep "$(echo ${ACTIONVAL} | sed -r 's,/$,,')") + + # When no render-able directories are found, finish the script + # execution with an error message. There is an obvious typo in the + # path provided. + if [[ -z ${MOTIF_RENDERABLE_DIRS} ]];then + cli_printMessage "`gettext "No related model was found for the path provided."`" --as-error-line + fi + + # Rebuild list of render-able directory structures using an array + # variable. This let us to predict what directory is one step + # forward or backward from the current directory structure. + for MOTIF_RENDERABLE_DIR in $MOTIF_RENDERABLE_DIRS;do + DIRS[((++${#DIRS[*]}))]=${MOTIF_RENDERABLE_DIR} + done + + # Define total number of directories to process. This is required + # in order to correct the counting value and so, make it to match + # the zero based nature of bash array variables. + local DIRS_TOTAL=$((${#DIRS[*]} - 1)) + + while [[ $COUNT -le ${DIRS_TOTAL} ]];do + + # Redefine action value to refer the theme-specific render-able + # directory. + ACTIONVAL=${DIRS[$COUNT]} + + # Refine artistic motif name using the current action value. + MOTIF_NAME=$(cli_getPathComponent $ACTIONVAL --motif) + + # Verify artistic motif name. The name of the artistic motif + # must be present in order for theme rendition to happen. + # Theme rendition takes place inside artistic motifs and the + # artistic motif name is an indispensable part of it. Take + # care of not using design models directory structure as name + # for artistic motifs. They, sometimes, match the pattern used + # to verify artistic motifs names but must not be confused. + if [[ $MOTIF_NAME == '' ]] || [[ $MOTIF_NAME =~ "^($MODEL_PATTERN)" ]];then + COUNT=$(($COUNT + 1)) + continue + fi + + # Refine artistic motif directory. This is the top directory + # where all visual manifestations of an artistic motif are + # stored in (e.g., Backgrounds, Brushes, Concept, Distro, + # etc.). + MOTIF_DIR="${MOTIF_BASEDIR}/${MOTIF_NAME}" + + # Define what is the next directory in the list, so we could + # verify whether to render or not the current theme-specific + # render-able directory. + if [[ $COUNT -lt ${DIRS_TOTAL} ]];then + NEXTDIR=$(dirname ${DIRS[(($COUNT + 1))]}) + else + NEXTDIR='' + fi + + # Verify whether to render or not the current theme's + # render-able directory. This verification is needed in order + # to avoid unnecessary rendition loops. For example, don't + # render `path/to/dir/A' when `path/to/dir/A/B' does exist, + # that configuration would produce `/path/to/dir/A/B twice. + if [[ $ACTIONVAL =~ '[[:digit:]]$' ]] || [[ $ACTIONVAL == $NEXTDIR ]];then + COUNT=$(($COUNT + 1)) + continue + fi + + # Execute direct rendition on theme specific render-able + # directory as specified by action value. + render_setBaseRendition + + # Increment counter to match the correct count value. + COUNT=$(($COUNT + 1)) + + done + +} diff --git a/Automation/centos-art.sh-mods/Render/render_setThemesDirStructure.sh b/Automation/centos-art.sh-mods/Render/render_setThemesDirStructure.sh new file mode 100755 index 0000000..ed98d3d --- /dev/null +++ b/Automation/centos-art.sh-mods/Render/render_setThemesDirStructure.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# +# render_setThemeDirectoryStructre.sh -- This function verifies +# theme-specific directory structures using common theme models +# directory structure as pattern. If there are missing directories inside +# theme-specific directories, this function will create it. This is a +# requisite of rendition process, so be sure to call this function +# before building the list of render-able theme directories. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + + +function render_setThemesDirStructure { + + local THEMES_SOURCE_DIR=$(cli_checkRepoDirSource "${1}") + local THEMES_TARGET_DIR=$(cli_checkRepoDirSource "${2}") + + local THEMES_FILTER=${THEMES_TARGET_DIR}/$(cli_getPathComponent --motif ${ACTIONVAL}) + + THEMES_TARGET_DIRS=$(cli_getFilesList ${THEMES_TARGET_DIR} \ + --pattern=".+/[[:digit:]]+$" --maxdepth=2 --mindepth=2 \ + | grep "${THEMES_FILTER}") + + for THEMES_TARGET_DIR in $THEMES_TARGET_DIRS;do + cli_printMessage "$THEMES_TARGET_DIR `gettext "directory structure..."`" --as-checking-line + cli_runFnEnvironment prepare ${THEMES_SOURCE_DIR} ${THEMES_TARGET_DIR} --directories + done + +} diff --git a/Automation/centos-art.sh-mods/Tuneup/Sh/Config/topcomment.sed b/Automation/centos-art.sh-mods/Tuneup/Sh/Config/topcomment.sed new file mode 100755 index 0000000..8b56461 --- /dev/null +++ b/Automation/centos-art.sh-mods/Tuneup/Sh/Config/topcomment.sed @@ -0,0 +1,55 @@ +#!/bin/sed +# +# topcomment.sed -- This file standardizes the top comment inside +# centos-art.sh scripts. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- +/^# +Copyright .*$/a\ +# Copyright (C) 2009-=COPYRIGHT_YEAR_LAST= =COPYRIGHT_HOLDER=\ +#\ +# 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.\ +#\ +# ---------------------------------------------------------------------- + +# Remove previous copyright notice, just to be sure the one above be +# used always. +/^# +Copyright .*$/,/^# -{70}$/{ +d +} + +# Remove more than one space after comments. +s/^# +/# / + +# Define script first line. +1c\ +#!/bin/bash diff --git a/Automation/centos-art.sh-mods/Tuneup/Sh/sh.sh b/Automation/centos-art.sh-mods/Tuneup/Sh/sh.sh new file mode 100755 index 0000000..cd59368 --- /dev/null +++ b/Automation/centos-art.sh-mods/Tuneup/Sh/sh.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# +# sh.sh -- This function standardizes maintainance tasks for Shell +# script files. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function sh { + + # Rebuild top comment inside shell scripts, mainly to update + # copyright information. + sh_doTopComment + +} diff --git a/Automation/centos-art.sh-mods/Tuneup/Sh/sh_doTopComment.sh b/Automation/centos-art.sh-mods/Tuneup/Sh/sh_doTopComment.sh new file mode 100755 index 0000000..808dafa --- /dev/null +++ b/Automation/centos-art.sh-mods/Tuneup/Sh/sh_doTopComment.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# +# sh_doTopComment.sh -- This function standardizes the top comment +# section inside shell scripts (*.sh) using a predefined template. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function sh_doTopComment { + + # Define absolute path to template file. + local TEMPLATE="${TUNEUP_CONFIG_DIR}/topcomment.sed" + + # Check template file existence. + cli_checkFiles -e $TEMPLATE + + # Define file name to template instance. + local INSTANCE=$(cli_getTemporalFile $TEMPLATE) + + # Create template instance. + cp $TEMPLATE $INSTANCE + + # Check template instance. We cannot continue if template instance + # couldn't be created. + cli_checkFiles -e $INSTANCE + + # Expand translation markers in template instance. + cli_expandTMarkers $INSTANCE + + # Apply template instance to file. + sed -r -i -f $INSTANCE $FILE + + # Remove template instance. + if [[ -f ${INSTANCE} ]];then + rm ${INSTANCE} + fi + +} diff --git a/Automation/centos-art.sh-mods/Tuneup/Svg/Config/metadata.sed b/Automation/centos-art.sh-mods/Tuneup/Svg/Config/metadata.sed new file mode 100755 index 0000000..199c44d --- /dev/null +++ b/Automation/centos-art.sh-mods/Tuneup/Svg/Config/metadata.sed @@ -0,0 +1,64 @@ +# This file is the metadata information used by CentOS Artwork SIG on +# its scalable vector graphics (SVG) files. This files is used with +# the regular expression '.*\.svg$' only. +# --------------------------------------------------- +# $Id$ +# --------------------------------------------------- +/\ + \ + \ + image/svg+xml\ + \ + \ + =TITLE=\ + =DATE=\ + \ + \ + =COPYRIGHT_HOLDER=\ + \ + \ + \ + \ + =COPYRIGHT_HOLDER=\ + \ + \ + \ + \ + =COPYRIGHT_HOLDER=\ + \ + \ + =URL=\ + =URL=\ + =URL=\ + =LOCALE=\ + \ + \ +=KEYWORDS=\ + \ + \ + =COPYRIGHT_HOLDER=\ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + diff --git a/Automation/centos-art.sh-mods/Tuneup/Svg/svg.sh b/Automation/centos-art.sh-mods/Tuneup/Svg/svg.sh new file mode 100755 index 0000000..ac7a22b --- /dev/null +++ b/Automation/centos-art.sh-mods/Tuneup/Svg/svg.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# +# svg.sh -- This function standardizes maintainance of SVG files. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function svg { + + # Update metadata information. + svg_doMetadata + + # Remove all unused items. + svg_doVacuumDefs + +} diff --git a/Automation/centos-art.sh-mods/Tuneup/Svg/svg_doMetadata.sh b/Automation/centos-art.sh-mods/Tuneup/Svg/svg_doMetadata.sh new file mode 100755 index 0000000..32865e0 --- /dev/null +++ b/Automation/centos-art.sh-mods/Tuneup/Svg/svg_doMetadata.sh @@ -0,0 +1,88 @@ +#!/bin/bash +# +# svg_doMetadata.sh -- This function updates metadata values inside +# scalable vector graphic (SVG) files using default values from The +# CentOS Project. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function svg_doMetadata { + + # Define template file name. + local TEMPLATE="${TUNEUP_CONFIG_DIR}/metadata.sed" + + # Check template file existence. + cli_checkFiles -e $TEMPLATE + + # Build title from file path. + local TITLE=$(basename "$FILE") + + # Build url from file path. + local URL=$(echo $FILE | sed 's!/home/centos!https://projects.centos.org/svn!') + + # Build keywords from file path. Do not include filename, it is + # already on title. + local KEY='' + local KEYS=$(dirname "$FILE" | cut -d/ -f6- | tr '/' '\n') + + # Build keywords using SVG standard format. Note that this + # information is inserted inside template file. The template file + # is a replacement set of sed commands so we need to escape the + # new line of each line using one backslash (\). As we are doing + # this inside bash, it is required to escape the backslash with + # another backslash so one of them passes literally to template + # file. + KEYS=$(\ + for KEY in $KEYS;do + echo " $KEY\\" + done) + + # Redefine template instance file name. + local INSTANCE=$(cli_getTemporalFile $TEMPLATE) + + # Create instance. + cp $TEMPLATE $INSTANCE + + # Check template instance. We cannot continue if the template + # instance couldn't be created. + cli_checkFiles -e $INSTANCE + + # Expand translation markers inside template instance. + sed -r -i \ + -e "s!=TITLE=!$TITLE!" \ + -e "s!=URL=!$URL!" \ + -e "s!=DATE=!$(date "+%Y-%m-%d")!" $INSTANCE + sed -i -r "/=KEYWORDS=/c\\${KEYS}" $INSTANCE + sed -i -r 's/>$/>\\/g' $INSTANCE + cli_expandTMarkers $INSTANCE + + # Update scalable vector graphic using template instance. + sed -i -f $INSTANCE $FILE + + # Remove template instance. + if [[ -f $INSTANCE ]];then + rm $INSTANCE + fi + + # Sanitate scalable vector graphic. + sed -i -r '/^[[:space:]]*$/d' $FILE + +} diff --git a/Automation/centos-art.sh-mods/Tuneup/Svg/svg_doVacuumDefs.sh b/Automation/centos-art.sh-mods/Tuneup/Svg/svg_doVacuumDefs.sh new file mode 100755 index 0000000..58d60fc --- /dev/null +++ b/Automation/centos-art.sh-mods/Tuneup/Svg/svg_doVacuumDefs.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# +# svg_doVacuumDefs.sh -- This function removes all unused items from +# the defs section of the SVG file. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function svg_doVacuumDefs { + + # Vacuum unused svg definition using inkscape. + inkscape --vacuum-defs $FILE &> /dev/null + +} diff --git a/Automation/centos-art.sh-mods/Tuneup/Xhtml/Config/toc.awk b/Automation/centos-art.sh-mods/Tuneup/Xhtml/Config/toc.awk new file mode 100755 index 0000000..d4e9d75 --- /dev/null +++ b/Automation/centos-art.sh-mods/Tuneup/Xhtml/Config/toc.awk @@ -0,0 +1,79 @@ +#!/usr/bin/gawk +# +# toc.awk -- This file provides the output format required by +# `xhtml_makeToc' function, inside centos-art.sh script, to produce +# the table of contents correctly. +# +# Copyright (C) 2009-2012 The CentOS Project +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Pubdtc License as pubdtshed 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 usefdl, but +# WITHOUT ANY WARRANTY; without even the impdted warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Pubdtc License for more details. +# +# You shodld have received a copy of the GNU General Pubdtc License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +BEGIN {FS=":"} + +{ + if ($1 == 0 && $2 == $3) { + opentags = "
" + closetags = "" + } + + if ($1 > 0 && $2 > $3) { + opentags = "
" + closetags = "" + } + + if ($1 > 0 && $2 == $3) { + opentags = "
" + closetags = "" + } + + if ($1 > 0 && $2 < $3) { + opentags = "" + for (i = 1; i <= ($3 - $2); i++) { + opentags = opentags "
" + closetags = "" + } + opentags = opentags "
" + } + + printf "%s%s%s\n",opentags,$4,closetags + +} + +END { + + if ($1 > 0 && $2 >= $3 && $3 > 1) { + for (i = 1; i <= $3; i++) { + print "
" + } + } + + if ($1 > 0 && $2 >= $3 && $3 == 1) { + print "" + print "" + } + + if ($1 > 0 && $2 < $3) { + for (i = 1; i <= $2; i++) { + print "" + } + } + + print "
" +} diff --git a/Automation/centos-art.sh-mods/Tuneup/Xhtml/xhtml.sh b/Automation/centos-art.sh-mods/Tuneup/Xhtml/xhtml.sh new file mode 100755 index 0000000..f758f8f --- /dev/null +++ b/Automation/centos-art.sh-mods/Tuneup/Xhtml/xhtml.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# +# xhtml.sh -- This function standardizes maintainance tasks of XHTML +# files. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function xhtml { + + # Transforms xhtml headings to make them accessible (e.g., through + # a table of contents). + xhtml_doToc + +} diff --git a/Automation/centos-art.sh-mods/Tuneup/Xhtml/xhtml_doToc.sh b/Automation/centos-art.sh-mods/Tuneup/Xhtml/xhtml_doToc.sh new file mode 100755 index 0000000..e75698e --- /dev/null +++ b/Automation/centos-art.sh-mods/Tuneup/Xhtml/xhtml_doToc.sh @@ -0,0 +1,160 @@ +#!/bin/bash +# +# xhtml_doToc.sh -- This functionality transforms web page headings to +# make them accessible through a table of contents. The table of +# contents is expanded in place, wherever the
+# piece of code be in the page. Once the
+# piece of code has be expanded, there is no need to put anything else +# in the page. +# +# In order for the tuneup functionality to transform headings, you +# need to put headings in just one line using one of the following +# forms: +# +#

Title

+#

Title

+#

Title

+# +# In the example above, h1 can vary from h1 to h6. Closing tag must be +# present and also match the openning tag. The value of `name' and +# `href' options from the anchor element are set dynamically using the +# md5sum output of combining the page location, the head- string and +# the heading string. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function xhtml_doToc { + + # Define variables as local to avoid conflicts outside. + local COUNT=0 + local PREVCOUNT=0 + local -a FINAL + local -a TITLE + local -a MD5SM + local -a OPTNS + local -a CLASS + local -a LEVEL + local -a PARENT + local -a TOCENTRIES + local -a LINK + + # Define table of content configuration file, the file used to + # produce the table of content XHTML output code. + local TOC_CONFIG=${TUNEUP_CONFIG_DIR}/toc.awk + + # Verify table of content configuration file. + cli_checkFiles -e ${TOC_CONFIG} + + # Define html heading regular expression pattern. Use parenthisis + # to save html action name, action value, and heading title. + local PATTERN='(]>)(.*[^<])' + + # Verify list of html files. Are files really html files? If they + # don't, continue with the next one in the list. + if [[ ! $(file --brief $FILE) =~ '^(XHTML|HTML|XML)' ]];then + continue + fi + + # Define list of headings to process. When building the heading, + # it is required to change spaces characters from its current + # decimal output to something different (e.g., its \040 octal + # alternative). This is required because the space character is + # used as egrep default field separator and spaces can be present + # inside heading strings we don't want to separate. + for HEADING in $(egrep "$PATTERN" $FILE \ + | sed -r -e 's!^[[:space:]]+!!' -e "s! !\\\040!g");do + + # Define previous counter value using current counter + # value as reference. + if [[ $COUNT -ne 0 ]];then + PREVCOUNT=$(($COUNT-1)) + fi + + # Define initial heading information. + FIRST[$COUNT]=$(echo $HEADING | sed -r "s!\\\040! !g") + TITLE[$COUNT]=$(echo ${FIRST[$COUNT]} | sed -r "s!$PATTERN!\4!") + MD5SM[$COUNT]=$(echo "${FILE}${FIRST[$COUNT]}" | md5sum | sed -r 's![[:space:]]+-$!!') + OPTNS[$COUNT]=$(echo ${FIRST[$COUNT]} | sed -r "s!$PATTERN!\3!") + CLASS[$COUNT]=$(echo ${FIRST[$COUNT]} | sed -r "s!$PATTERN!\2!") + LEVEL[$COUNT]=$(echo ${FIRST[$COUNT]} | sed -r "s!$PATTERN!\1!") + PARENT[$COUNT]=${LEVEL[$PREVCOUNT]} + + # Transform heading information using initial heading + # information as reference. + if [[ ${OPTNS[$COUNT]} =~ '^$' ]];then + OPTNS[$COUNT]='' + elif [[ ${OPTNS[$COUNT]} =~ '^$' ]];then + OPTNS[$COUNT]='' + elif [[ ${OPTNS[$COUNT]} =~ '^$' ]];then + OPTNS[$COUNT]='' + fi + + # Build final html heading structure. + FINAL[$COUNT]=''${OPTNS[$COUNT]}${TITLE[$COUNT]}'' + + # Build html heading link structure. These links are used by + # the table of contents later. + LINK[$COUNT]=''${TITLE[$COUNT]}'' + + # Build table of contents entry with numerical + # identifications. The numerical identification is what we use + # to determine the correct position of each heading link on + # the table of content. + TOCENTRIES[$COUNT]="$COUNT:${LEVEL[$COUNT]}:${PARENT[$COUNT]}:${LINK[$COUNT]}" + + # Update heading information inside the current file being + # processed. Use the first and final heading information. + sed -i -r "s!${FIRST[$COUNT]}!${FINAL[$COUNT]}!" $FILE + + # Increase heading counter. + COUNT=$(($COUNT + 1)) + + done + + # Build the table of contents using heading numerical + # identifications as reference. The numerical identification + # describes the order of headings in one xhtml file. This + # information is processed by awk to make the appropriate + # replacements. Finnally, the result is stored in the TOC + # variable. + TOC=$(echo '
' + echo "

`gettext "Table of contents"`

" + for TOCENTRY in "${TOCENTRIES[@]}";do + echo $TOCENTRY + done \ + | awk -f ${TOC_CONFIG}) + + # Update table of contents inside the current file being + # processed. + sed -i -r '/
[^<\/div].*<\/div>/c'"$(echo -e $TOC)" $FILE + + # Clean up variables to receive the next file. + unset FINAL + unset TITLE + unset MD5SM + unset OPTNS + unset CLASS + unset LEVEL + unset PARENT + unset TOCENTRIES + unset LINK + +} diff --git a/Automation/centos-art.sh-mods/Tuneup/tuneup.sh b/Automation/centos-art.sh-mods/Tuneup/tuneup.sh new file mode 100755 index 0000000..07f96fc --- /dev/null +++ b/Automation/centos-art.sh-mods/Tuneup/tuneup.sh @@ -0,0 +1,92 @@ +#!/bin/bash +# +# tuneup.sh -- This function standardizes maintainance tasks for files +# inside the repository. Maintainance tasks are applied to files using +# file extension as reference. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function tuneup { + + local ACTIONNAM='' + local ACTIONVAL='' + + # Initialize name of rendition format as an empty value. The name + # of rendition format is determined automatically based on + # template file extension, later, when files are processed. + local TUNEUP_FORMAT='' + + # Initialize absolute path to format's base directory, the place + # where format-specific directories are stored in. + local TUNEUP_BASEDIR="${CLI_FUNCDIR}/${CLI_FUNCDIRNAM}" + + # Initialize list of supported file extensions. This is, the file + # extensions we want to perform maintenance tasks for. + local TUNEUP_EXTENSIONS='svg xhtml sh' + + # Interpret arguments and options passed through command-line. + tuneup_getOptions + + # Redefine positional parameters using ARGUMENTS. At this point, + # option arguments have been removed from ARGUMENTS variable and + # only non-option arguments remain in it. + eval set -- "$ARGUMENTS" + + # Define action name. No matter what option be passed to + # centos-art, there is only one action to perform (i.e., build the + # list of files and interpretation of file extensions for further + # processing). + ACTIONNAM="tuneup_doBaseActions" + + # Define action value. We use non-option arguments to define the + # action value (ACTIONVAL) variable. + for ACTIONVAL in "$@";do + + # Sanitate non-option arguments to be sure they match the + # directory conventions established by centos-art.sh script + # against source directory locations in the working copy. + ACTIONVAL=$(cli_checkRepoDirSource ${ACTIONVAL}) + + # Verify source location absolute path. It should point to + # existent directories under version control inside the + # working copy. Otherwise, if it doesn't point to an existent + # file under version control, finish the script execution with + # an error message. + cli_checkFiles ${ACTIONVAL} -d --is-versioned + + # Synchronize changes between repository and working copy. At + # this point, changes in the repository are merged in the + # working copy and changes in the working copy committed up to + # repository. + cli_synchronizeRepoChanges "${ACTIONVAL}" + + # Execute action name. + ${ACTIONNAM} + + # Synchronize changes between repository and working copy. At + # this point, changes in the repository are merged in the + # working copy and changes in the working copy committed up to + # repository. + cli_synchronizeRepoChanges "${ACTIONVAL}" + + done + +} diff --git a/Automation/centos-art.sh-mods/Tuneup/tuneup_doBaseActions.sh b/Automation/centos-art.sh-mods/Tuneup/tuneup_doBaseActions.sh new file mode 100755 index 0000000..dc25fb8 --- /dev/null +++ b/Automation/centos-art.sh-mods/Tuneup/tuneup_doBaseActions.sh @@ -0,0 +1,98 @@ +#!/bin/bash +# +# tuneup_doBaseActions.sh -- This function builds one list of files to +# process for each file extension supported and applies maintainance +# tasks file by file for each one of them. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function tuneup_doBaseActions { + + local TUNEUP_CONFIG_DIR='' + local TUNEUP_FORMAT_DIR='' + local TUNEUP_FORMAT_INIT='' + local TUNEUP_EXTENSION='' + local EXPORTID='' + local FILE='' + local FILES='' + + # Print separator line. + cli_printMessage '-' --as-separator-line + + # Loop through list of supported file extensions. + for TUNEUP_EXTENSION in ${TUNEUP_EXTENSIONS};do + + # Define format name based on supported file extensions. + TUNEUP_FORMAT="${TUNEUP_EXTENSION}" + + # Define specific functions export id. + EXPORTID="${CLI_FUNCDIRNAM}/$(cli_getRepoName ${TUNEUP_FORMAT} -d)/${TUNEUP_FORMAT}" + + # Define absolute path to directory where format-specific + # functionalities are stored in. + TUNEUP_FORMAT_DIR="${TUNEUP_BASEDIR}/$(cli_getRepoName \ + ${TUNEUP_FORMAT} -d)" + + # Define absolute path to format initialization script. + TUNEUP_FORMAT_INIT="${TUNEUP_FORMAT_DIR}/$(cli_getRepoName ${TUNEUP_FORMAT} -f).sh" + + # Verify absolute path to format initialization script. When + # a file extension is provided, but no format initialization + # script exists for it, continue with the next file extension + # in the list. + if [[ ! -f ${TUNEUP_FORMAT_INIT} ]];then + continue + fi + + # Define absolute path to directory where format-specific + # configurations are retrieved from. + TUNEUP_CONFIG_DIR="${TUNEUP_FORMAT_DIR}/Config" + + # Build list of files to process using action value as + # reference. + FILES=$(cli_getFilesList ${ACTIONVAL} --pattern="^.*${FLAG_FILTER}\.${TUNEUP_EXTENSION}$") + + # Verify list of files to process. Assuming no file is found, + # evaluate the next supported file extension. + if [[ $FILES == '' ]];then + continue + fi + + # Export format-specific functionalities up to the + # execution environment. + cli_exportFunctions "${EXPORTID}" + + # Execute format-specific maintenance tasks. + for FILE in $FILES;do + cli_printMessage "$FILE" --as-tuningup-line + ${TUNEUP_FORMAT} + done + + # Unset format-specific functionalities from execution + # environment. This is required to prevent end up with more + # than one format-specific function initialization, in those + # cases when different template files are rendered in just one + # execution of `centos-art.sh' script. + cli_unsetFunctions "${EXPORTID}" + + done + +} diff --git a/Automation/centos-art.sh-mods/Tuneup/tuneup_getOptions.sh b/Automation/centos-art.sh-mods/Tuneup/tuneup_getOptions.sh new file mode 100755 index 0000000..0cf8d33 --- /dev/null +++ b/Automation/centos-art.sh-mods/Tuneup/tuneup_getOptions.sh @@ -0,0 +1,90 @@ +#!/bin/bash +# +# tuneup_getOptions.sh -- This function interprets option parameters +# passed to `tuneup' functionality and calls actions accordingly. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function tuneup_getOptions { + + # Define short options we want to support. + local ARGSS="h,q" + + # Define long options we want to support. + local ARGSL="help,quiet,filter:,answer-yes,synchronize" + + # Redefine ARGUMENTS using getopt(1) command parser. + cli_parseArguments + + # Redefine positional parameters using ARGUMENTS variable. + eval set -- "$ARGUMENTS" + + # Look for options passed through command-line. + while true; do + + case "$1" in + + -h | --help ) + cli_runFnEnvironment help --read --format="texinfo" "tcar-fs::scripts:bash-functions-tuneup" + shift 1 + exit + ;; + + -q | --quiet ) + FLAG_QUIET="true" + shift 1 + ;; + + --filter ) + FLAG_FILTER="$2" + shift 2 + ;; + + --answer-yes ) + FLAG_ANSWER="true" + shift 1 + ;; + + --synchronize ) + FLAG_SYNCHRONIZE="true" + shift 1 + ;; + + -- ) + # Remove the `--' argument from the list of arguments + # in order for processing non-option arguments + # correctly. At this point all option arguments have + # been processed already but the `--' argument still + # remains to mark ending of option arguments and + # begining of non-option arguments. The `--' argument + # needs to be removed here in order to avoid + # centos-art.sh script to process it as a path inside + # the repository, which obviously is not. + shift 1 + break + ;; + esac + done + + # Redefine ARGUMENTS variable using current positional parameters. + cli_parseArgumentsReDef "$@" + +} diff --git a/Automation/centos-art.sh-mods/Vcs/Git/git.sh b/Automation/centos-art.sh-mods/Vcs/Git/git.sh new file mode 100755 index 0000000..0f6bdd5 --- /dev/null +++ b/Automation/centos-art.sh-mods/Vcs/Git/git.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# +# git.sh -- This function standardizes Git tasks inside the +# repository. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function git { + + # Redefine positional parameters using ARGUMENTS. At this point, + # option arguments have been removed from ARGUMENTS variable and + # only non-option arguments remain in it. + eval set -- "$ARGUMENTS" + + # Don't realize action value verification here. There are actions + # like `copy' and `rename' that require two arguments from which + # the last one doesn't exist at the moment of executing the + # command. This will provoke the second action value verification + # to fail when indeed is should not. Thus, go to action names + # processing directly. + + # All git actions will be performed against the working copy. + # Otherwise, errors like `fatal: Not a git repository (or any of + # the parent directories): .git' or `Unable to determine absolute + # path of git directory' might occur. So, move from whenever you + # be right now up to the git working copy. + pushd ${TCAR_WORKDIR} > /dev/null + + # Execute action names. This is required in order to realize + # actions like copy and rename which need two values as argument. + # Otherwise, it wouldn't be possible to execute them because + # action values would be processed one a time. Thus, lets work + # with `$@' instead. + for ACTIONNAM in $ACTIONNAMS;do + $ACTIONNAM "$@" + done + + # Return to the place you were initially. + popd > /dev/null + +} diff --git a/Automation/centos-art.sh-mods/Vcs/Git/git_commitRepoChanges.sh b/Automation/centos-art.sh-mods/Vcs/Git/git_commitRepoChanges.sh new file mode 100755 index 0000000..f965966 --- /dev/null +++ b/Automation/centos-art.sh-mods/Vcs/Git/git_commitRepoChanges.sh @@ -0,0 +1,118 @@ +#!/bin/bash +# +# git_commitRepoChanges.sh -- This function standardizes the way local +# changes are committed up to central repository. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function git_commitRepoChanges { + + local -a FILES + local -a INFO + local -a FILESNUM + local COUNT=0 + local STATUSOUT='' + local PREDICATE='' + local CHNGTOTAL=0 + local LOCATION=$(cli_checkRepoDirSource "${1}") + + # Verify source location absolute path. It should point to + # existent files or directories. They don't need to be under + # version control. + cli_checkFiles ${LOCATION} -e + + # Print action message. + cli_printMessage "`gettext "Checking changes in the working copy"`" --as-banner-line + + # Build list of files that have received changes in its version + # status. Be sure to keep output files off from this list. + # Remember, output files are not version inside the working copy, + # so they are not considered for evaluation here. But take care, + # sometimes output files are in the same format of source files, + # so we need to differentiate them using their locations. + STATUSOUT="$(${COMMAND} status --porcelain ${LOCATION})" + + # Process location based on its path information. Both + # by-extension and by-location exclusions are no longer needed + # here. They are already set in the `.git/info/exclude' file. + + # Define path to files considered recent modifications from + # working copy up to local repository. + FILES[0]=$(echo "$STATUSOUT" | egrep "^[[:space:]]M") + FILES[1]=$(echo "$STATUSOUT" | egrep "^\?\?") + FILES[2]=$(echo "$STATUSOUT" | egrep "^[[:space:]]D") + FILES[3]=$(echo "$STATUSOUT" | egrep "^[[:space:]]A") + FILES[4]=$(echo "$STATUSOUT" | egrep "^(A|M|R|C)( |M|D)") + + # Define description of files considered recent modifications from + # working copy up to local repository. + INFO[0]="`gettext "Modified"`" + INFO[1]="`gettext "Untracked"`" + INFO[2]="`gettext "Deleted"`" + INFO[3]="`gettext "Added"`" + INFO[4]="`gettext "Staged"`" + + while [[ $COUNT -ne ${#FILES[*]} ]];do + + # Define total number of files. Avoid counting empty line. + if [[ "${FILES[$COUNT]}" == '' ]];then + FILESNUM[$COUNT]=0 + else + FILESNUM[$COUNT]=$(echo "${FILES[$COUNT]}" | wc -l) + fi + + # Calculate total amount of changes. + CHNGTOTAL=$(($CHNGTOTAL + ${FILESNUM[$COUNT]})) + + # Build report predicate. Use report predicate to show any + # information specific to the number of files found. For + # example, you can use this section to show warning messages, + # notes, and so on. By default we use the word `file' or + # `files' at ngettext's consideration followed by change + # direction. + PREDICATE[$COUNT]=`ngettext "file in the working copy" \ + "files in the working copy" $((${FILESNUM[$COUNT]} + 1))` + + # Output report line. + cli_printMessage "${INFO[$COUNT]}: ${FILESNUM[$COUNT]} ${PREDICATE[$COUNT]}" --as-stdout-line + + # Increase counter. + COUNT=$(($COUNT + 1)) + + done + + # Stage files + cli_printMessage "`gettext "Do you want to stage files?"`" --as-yesornorequest-line + ${COMMAND} add ${LOCATION} + + # See staged differences. + cli_printMessage "`gettext "Do you want to see staged files differences?"`" --as-yesornorequest-line + ${COMMAND} diff --staged ${LOCATION} | less + + # Commit staged files. + cli_printMessage "`gettext "Do you want to commit staged files differences?"`" --as-yesornorequest-line + ${COMMAND} commit ${LOCATION} + + # Push committed files. + cli_printMessage "`gettext "Do you want to push committed files?"`" --as-yesornorequest-line + ${COMMAND} push + +} diff --git a/Automation/centos-art.sh-mods/Vcs/Git/git_copyRepoFile.sh b/Automation/centos-art.sh-mods/Vcs/Git/git_copyRepoFile.sh new file mode 100755 index 0000000..28e9cab --- /dev/null +++ b/Automation/centos-art.sh-mods/Vcs/Git/git_copyRepoFile.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# +# git_copyRepoFile.sh -- This function standardizes the way files +# (including directories) are duplicated inside the working copy. This +# function is an interface for git's `copy' command. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function git_copyRepoFile { + + local SOURCE=$(cli_checkRepoDirSource ${1}) + local TARGET=$(cli_checkRepoDirSource ${2}) + + # Verify source location absolute path. It should point to + # existent files or directories. They don't need to be under + # version control. + cli_checkFiles ${SOURCE} -e + + # Print action reference. + if [[ -f ${SOURCE} ]];then + cli_printMessage "${TARGET}/$(basename ${SOURCE})" --as-creating-line + else + cli_printMessage "${TARGET}" --as-creating-line + fi + + # Copy source location to its target using version control. I + # didn't find a copy command for Git. If you know a better way to + # track a copy action through Git, set it here. + /bin/cp ${SOURCE} ${TARGET} + if [[ $? -eq 0 ]];then + ${COMMAND} add ${TARGET} + fi + +} diff --git a/Automation/centos-art.sh-mods/Vcs/Git/git_deleteRepoFile.sh b/Automation/centos-art.sh-mods/Vcs/Git/git_deleteRepoFile.sh new file mode 100755 index 0000000..3623084 --- /dev/null +++ b/Automation/centos-art.sh-mods/Vcs/Git/git_deleteRepoFile.sh @@ -0,0 +1,58 @@ +#!/bin/bash +# +# git_deleteRepoFile.sh -- This function standardizes the way +# centos-art.sh script deletes files and directories inside the +# working copy. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function git_deleteRepoFile { + + local TARGET=$(cli_checkRepoDirSource ${1}) + + # Print action reference. + cli_printMessage "${TARGET}" --as-deleting-line + + # Reset target to its default status before remove it from the + # work copy. + if [[ $(cli_runFnEnvironment vcs --status ${TARGET}) =~ '^(A|M|R)$' ]];then + ${COMMAND} reset HEAD ${TARGET} --quiet + fi + + # Remove target based on whether it is under version control or + # not. + if [[ $(cli_runFnEnvironment vcs --status ${TARGET}) =~ '^\?\?$' ]];then + # Target isn't under version control. + if [[ -d ${TARGET} ]];then + rm -r ${TARGET} + else + rm ${TARGET} + fi + else + # Target is under version control. + if [[ -d ${TARGET} ]];then + ${COMMAND} rm ${TARGET} -r --force --quiet + else + ${COMMAND} rm ${TARGET} --force --quiet + fi + fi + +} diff --git a/Automation/centos-art.sh-mods/Vcs/Git/git_getRepoStatus.sh b/Automation/centos-art.sh-mods/Vcs/Git/git_getRepoStatus.sh new file mode 100755 index 0000000..b54bd51 --- /dev/null +++ b/Automation/centos-art.sh-mods/Vcs/Git/git_getRepoStatus.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# +# git_getRepoStatus.sh -- This function requests the working copy +# using the status command and returns the first character in the +# output line, as described in git help status, for the LOCATION +# specified. Use this function to perform verifications based a +# repository LOCATION status. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function git_getRepoStatus { + + local LOCATION=$(cli_checkRepoDirSource "$1") + + # Verify source location absolute path. It should point either to + # existent files or directories both under version control inside + # the working copy. Otherwise, if it doesn't point to an existent + # file under version control, finish the script execution with an + # error message. + cli_checkFiles ${LOCATION} -e + + # Define regular expression pattern to retrieve the work tree + # status. This is the second character of the first column + # returned by `git status --porcelain' command. + local PATTERN='^(.)(.)[[:space:]]+.+$' + + # Output the work tree status. + ${COMMAND} status "$LOCATION" --porcelain \ + | sed -r "s/${PATTERN}/\2/" + +} diff --git a/Automation/centos-art.sh-mods/Vcs/Git/git_isVersioned.sh b/Automation/centos-art.sh-mods/Vcs/Git/git_isVersioned.sh new file mode 100755 index 0000000..0b8c814 --- /dev/null +++ b/Automation/centos-art.sh-mods/Vcs/Git/git_isVersioned.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# +# git_isVersioned.sh -- This function determines whether a location is +# under version control or not. When the location is under version +# control, this function returns `0'. When the location isn't under +# version control, this function returns `1'. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function git_isVersioned { + + # Define the location absolute path we want to determine whether + # it is under version control or not. Only the first non-option + # argument passed to centos-art.sh command-line will be used. + local LOCATION=$(cli_checkRepoDirSource "${1}") + + # Use Git to determine whether the location is under version + # control or not. + local OUTPUT=$(${COMMAND} status --porcelain ${LOCATION} \ + | egrep "\?\? ${LOCATION}") + + # If there are unversioned files inside location, stop the script + # execution with an error message. All files must be under version + # control except those set in the `.git/info/exclude/' file. + if [[ ! -z ${OUTPUT} ]];then + cli_printMessage "${LOCATION} `gettext " contains untracked files."`" --as-error-line + fi + +} diff --git a/Automation/centos-art.sh-mods/Vcs/Git/git_mkRepoDirectory.sh b/Automation/centos-art.sh-mods/Vcs/Git/git_mkRepoDirectory.sh new file mode 100755 index 0000000..fd9fe0b --- /dev/null +++ b/Automation/centos-art.sh-mods/Vcs/Git/git_mkRepoDirectory.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# +# git_mkRepoDirectory.sh -- This function standardizes the way +# centos-art.sh script creates directories inside the working copy. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function git_mkRepoDirectory { + + local TARGET=$(cli_checkRepoDirSource ${1}) + + # Print action reference. + cli_printMessage "${TARGET}" --as-creating-line + + # Copy source location to its target using version control. + /bin/mkdir ${TARGET} + ${COMMAND} add ${TARGET} + +} diff --git a/Automation/centos-art.sh-mods/Vcs/Git/git_syncRepoChanges.sh b/Automation/centos-art.sh-mods/Vcs/Git/git_syncRepoChanges.sh new file mode 100755 index 0000000..c2aa395 --- /dev/null +++ b/Automation/centos-art.sh-mods/Vcs/Git/git_syncRepoChanges.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# +# git_syncRepoChanges.sh -- This function standardizes the way changes +# are brought from central repository and merged into the local +# repository. It also standardizes the way local changes are send from +# the local repository up to central repository. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function git_syncRepoChanges { + + local LOCATION='' + local LOCATIONS="${@}" + + for LOCATION in $LOCATIONS;do + + # Verify whether the location is valid or not. + LOCATION=$(cli_checkRepoDirSource ${LOCATION}) + + # Verify source location absolute path. It should point either + # to existent files or directories both under version control + # inside the working copy. Otherwise, if it doesn't point to + # an existent file under version control, finish the script + # execution with an error message. + cli_checkFiles ${LOCATION} -e --is-versioned + + # Bring changes from the repository into the working copy. + git_updateRepoChanges ${LOCATION} + + # Check changes in the working copy. + git_commitRepoChanges ${LOCATION} + + done + +} diff --git a/Automation/centos-art.sh-mods/Vcs/Git/git_updateRepoChanges.sh b/Automation/centos-art.sh-mods/Vcs/Git/git_updateRepoChanges.sh new file mode 100755 index 0000000..f24f399 --- /dev/null +++ b/Automation/centos-art.sh-mods/Vcs/Git/git_updateRepoChanges.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# +# git_updateRepoChanges.sh -- This function standardizes the way +# changes are merged into the repository's local working copy. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function git_updateRepoChanges { + + # Print action message. + cli_printMessage "`gettext "Bringing changes from the repository into the working copy"`" --as-banner-line + + # Update working copy and retrieve update output. When we use + # git, it is not possible to bring changes for specific + # directories trees but the whole repository tree. So, we need to + # position the script in the local working copy directory and + # execute the pull command therein. + # + # NOTE: The `${COMMAND} pull' command triggers the error `Unable + # to determine absolute path of git directory' while fetch and + # merge equivalents seems to do what we expect without any visible + # error. + ${COMMAND} fetch + ${COMMAND} merge FETCH_HEAD + +} diff --git a/Automation/centos-art.sh-mods/Vcs/Subversion/subversion.sh b/Automation/centos-art.sh-mods/Vcs/Subversion/subversion.sh new file mode 100755 index 0000000..a534496 --- /dev/null +++ b/Automation/centos-art.sh-mods/Vcs/Subversion/subversion.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# +# subversion.sh -- This function standardizes Subversion tasks inside +# the repository. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function subversion { + + # Redefine positional parameters using ARGUMENTS. At this point, + # option arguments have been removed from ARGUMENTS variable and + # only non-option arguments remain in it. + eval set -- "$ARGUMENTS" + + # Don't realize action value verification here. There are actions + # like `copy' and `rename' that require two arguments from which + # the last one doesn't exist at the moment of executing the + # command. This will provoke the second action value verification + # to fail when indeed is should not. Thus, go to action names + # processing directly. + + # Execute action names. This is required in order to realize + # actions like copy and rename which need two values as argument. + # Otherwise, it wouldn't be possible to execute them because + # action values would be processed one a time. Thus, lets work + # with `$@' instead. + for ACTIONNAM in $ACTIONNAMS;do + $ACTIONNAM "$@" + done + +} diff --git a/Automation/centos-art.sh-mods/Vcs/Subversion/subversion_commitRepoChanges.sh b/Automation/centos-art.sh-mods/Vcs/Subversion/subversion_commitRepoChanges.sh new file mode 100755 index 0000000..84d0ce7 --- /dev/null +++ b/Automation/centos-art.sh-mods/Vcs/Subversion/subversion_commitRepoChanges.sh @@ -0,0 +1,154 @@ +#!/bin/bash +# +# subversion_commitRepoChanges.sh -- This function explores the +# working copy and commits changes up to central repository after +# checking changes and adding files which aren't under version +# control. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function subversion_commitRepoChanges { + + local -a FILES + local -a INFO + local -a FILESNUM + local COUNT=0 + local STATUSOUT='' + local PREDICATE='' + local CHNGTOTAL=0 + local LOCATION=$(cli_checkRepoDirSource "$1") + + # Verify source location absolute path. It should point either to + # existent files or directories both under version control inside + # the working copy. Otherwise, if it doesn't point to an existent + # file under version control, finish the script execution with an + # error message. + cli_checkFiles ${LOCATION} -e --is-versioned + + # Print action message. + cli_printMessage "`gettext "Checking changes in the working copy"`" --as-banner-line + + # Build list of files that have received changes in its version + # status. Be sure to keep output files off from this list. + # Remember, output files are not version inside the working copy, + # so they are not considered for evaluation here. But take care, + # sometimes output files are in the same format of source files, + # so we need to differentiate them using their locations. + + # Process location based on its path information. + if [[ ${LOCATION} =~ 'Documentation/Manuals/Texinfo)' ]];then + STATUSOUT="$(${COMMAND} status ${LOCATION} | egrep -v '(pdf|txt|xhtml|xml|docbook|bz2)$')\n$STATUSOUT" + elif [[ $LOCATION =~ 'Documentation/Manuals/Docbook' ]];then + STATUSOUT="$(${COMMAND} status ${LOCATION} | egrep -v '(pdf|txt|xhtml)$')\n$STATUSOUT" + elif [[ $LOCATION =~ 'Identity' ]];then + STATUSOUT="$(${COMMAND} status ${LOCATION} | egrep -v '(pdf|png|jpg|rc|xpm|xbm|tif|ppm|pnm|gz|lss|log)$')\n$STATUSOUT" + else + STATUSOUT="$(${COMMAND} status ${LOCATION})\n$STATUSOUT" + fi + + # Sanitate status output. Expand new lines, remove leading spaces + # and empty lines. + STATUSOUT=$(echo -e "$STATUSOUT" | sed -r 's!^[[:space:]]*!!' | egrep -v '^[[:space:]]*$') + + # Define path to files considered recent modifications from + # working copy up to central repository. + FILES[0]=$(echo "$STATUSOUT" | egrep "^M" | sed -r "s,^.+${TCAR_WORKDIR}/,,") + FILES[1]=$(echo "$STATUSOUT" | egrep "^\?" | sed -r "s,^.+${TCAR_WORKDIR}/,,") + FILES[2]=$(echo "$STATUSOUT" | egrep "^D" | sed -r "s,^.+${TCAR_WORKDIR}/,,") + FILES[3]=$(echo "$STATUSOUT" | egrep "^A" | sed -r "s,^.+${TCAR_WORKDIR}/,,") + + # Define description of files considered recent modifications from + # working copy up to central repository. + INFO[0]="`gettext "Modified"`" + INFO[1]="`gettext "Unversioned"`" + INFO[2]="`gettext "Deleted"`" + INFO[3]="`gettext "Added"`" + + while [[ $COUNT -ne ${#FILES[*]} ]];do + + # Define total number of files. Avoid counting empty line. + if [[ "${FILES[$COUNT]}" == '' ]];then + FILESNUM[$COUNT]=0 + else + FILESNUM[$COUNT]=$(echo "${FILES[$COUNT]}" | wc -l) + fi + + # Calculate total amount of changes. + CHNGTOTAL=$(($CHNGTOTAL + ${FILESNUM[$COUNT]})) + + # Build report predicate. Use report predicate to show any + # information specific to the number of files found. For + # example, you can use this section to show warning messages, + # notes, and so on. By default we use the word `file' or + # `files' at ngettext's consideration followed by change + # direction. + PREDICATE[$COUNT]=`ngettext "file in the working copy" \ + "files in the working copy" $((${FILESNUM[$COUNT]} + 1))` + + # Output report line. + cli_printMessage "${INFO[$COUNT]}: ${FILESNUM[$COUNT]} ${PREDICATE[$COUNT]}" --as-stdout-line + + # Increase counter. + COUNT=$(($COUNT + 1)) + + done + + # When files have changed in the target location, show which these + # files are and request user to see such changes and then, for + # committing them up to the central repository. + if [[ ${FILESNUM[0]} -gt 0 ]];then + + cli_printMessage "`gettext "Do you want to see changes now?"`" --as-yesornorequest-line + ${COMMAND} diff ${LOCATION} | less + + # Commit changes up to central repository. + cli_printMessage "`gettext "Do you want to commit changes now?"`" --as-yesornorequest-line + ${COMMAND} commit ${LOCATION} + + fi + + # When there are unversioned files in the target location, show + # which these files are and request user to add such files into + # the working copy. + if [[ ${FILESNUM[1]} -gt 0 ]];then + + cli_printMessage '-' --as-separator-line + cli_printMessage "`gettext "Do you want to add unversioned files now?"`" --as-yesornorequest-line + for FILE in ${FILES[1]};do + ${COMMAND} add "${TCAR_WORKDIR}/$FILE" + done + + # Commit changes up to central repository. + cli_printMessage "`gettext "Do you want to commit changes now?"`" --as-yesornorequest-line + ${COMMAND} commit ${LOCATION} + + fi + + # When there are added files in the target location, show which + # these files are and request user to commit them up to central + # repository. + if [[ ${FILESNUM[3]} -gt 0 ]];then + cli_printMessage '-' --as-separator-line + cli_printMessage "`gettext "Do you want to commit changes now?"`" --as-yesornorequest-line + ${COMMAND} commit ${LOCATION} + fi + +} diff --git a/Automation/centos-art.sh-mods/Vcs/Subversion/subversion_copyRepoFile.sh b/Automation/centos-art.sh-mods/Vcs/Subversion/subversion_copyRepoFile.sh new file mode 100755 index 0000000..10729c5 --- /dev/null +++ b/Automation/centos-art.sh-mods/Vcs/Subversion/subversion_copyRepoFile.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# +# subversion_copyRepoFile.sh -- This function standardizes the way +# files (including directories) are duplicated inside the working +# copy. This function is an interface for subversion's `copy' command. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function subversion_copyRepoFile { + + local SOURCE=$(cli_checkRepoDirSource ${1}) + local TARGET=$(cli_checkRepoDirSource ${2}) + + # Verify source location absolute path. It should point either to + # existent files or directories both under version control inside + # the working copy. Otherwise, if it doesn't point to an existent + # file under version control, finish the script execution with an + # error message. + cli_checkFiles ${SOURCE} -e --is-versioned + + # Print action reference. + if [[ -f ${SOURCE} ]];then + cli_printMessage "${TARGET}/$(basename ${SOURCE})" --as-creating-line + else + cli_printMessage "${TARGET}" --as-creating-line + fi + + # Copy source location to its target using version control. + ${COMMAND} copy ${SOURCE} ${TARGET} --quiet + +} diff --git a/Automation/centos-art.sh-mods/Vcs/Subversion/subversion_deleteRepoFile.sh b/Automation/centos-art.sh-mods/Vcs/Subversion/subversion_deleteRepoFile.sh new file mode 100755 index 0000000..5874af8 --- /dev/null +++ b/Automation/centos-art.sh-mods/Vcs/Subversion/subversion_deleteRepoFile.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# +# subversion_deleteRepoFile.sh -- This function standardizes the way +# centos-art.sh script deletes files and directories inside the +# working copy. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function subversion_deleteRepoFile { + + local TARGET=$(cli_checkRepoDirSource ${1}) + + # Print action reference. + cli_printMessage "${TARGET}" --as-deleting-line + + # Verify target existence. Be sure it is under version control. + cli_checkFiles "${TARGET}" --is-versioned + + # Revert changes before deleting related files. + ${COMMAND} revert ${TARGET} --quiet --recursive + + # Delete source location. + ${COMMAND} delete ${TARGET} --quiet --force + +} diff --git a/Automation/centos-art.sh-mods/Vcs/Subversion/subversion_getRepoStatus.sh b/Automation/centos-art.sh-mods/Vcs/Subversion/subversion_getRepoStatus.sh new file mode 100755 index 0000000..f4eb4bf --- /dev/null +++ b/Automation/centos-art.sh-mods/Vcs/Subversion/subversion_getRepoStatus.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# +# subversion_getRepoStatus.sh -- This function requests the working +# copy using the svn status command and returns the first character in +# the output line, as described in svn help status, for the LOCATION +# specified. Use this function to perform verifications based a +# repository LOCATION status. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function subversion_getRepoStatus { + + local LOCATION=$(cli_checkRepoDirSource "$1") + + # Verify source location absolute path. It should point either to + # existent files or directories both under version control inside + # the working copy. Otherwise, if it doesn't point to an existent + # file under version control, finish the script execution with an + # error message. + cli_checkFiles ${LOCATION} -e --is-versioned + + # Define regular expression pattern to retrieve first column, + # returned by subversion status command. This column is one + # character column as describes `svn help status' command. + local PATTERN='^( |A|C|D|I|M|R|X|!|~).+$' + + # Output specific state of location using subversion `status' + # command. + ${COMMAND} status "$LOCATION" -N --quiet | sed -r "s/${PATTERN}/\1/" + +} diff --git a/Automation/centos-art.sh-mods/Vcs/Subversion/subversion_isVersioned.sh b/Automation/centos-art.sh-mods/Vcs/Subversion/subversion_isVersioned.sh new file mode 100755 index 0000000..92f5a48 --- /dev/null +++ b/Automation/centos-art.sh-mods/Vcs/Subversion/subversion_isVersioned.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# +# subversion_isVersioned.sh -- This function determines whether a +# location is under version control or not. When the location is under +# version control, this function returns `0'. When the location isn't +# under version control, this function returns `1'. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function subversion_isVersioned { + + # Define the location absolute path we want to determine whether + # it is under version control or not. Only the first non-option + # argument passed to centos-art.sh command-line will be used. + local LOCATION=$(cli_checkRepoDirSource "${1}") + + # Use Subversion to determine whether the location is under + # version control or not. + ${COMMAND} info ${LOCATION} > /dev/null 2>&1 + + # Verify Subversion's exit status. + if [[ $? -ne 0 ]];then + cli_printMessage "${LOCATION} `gettext "isn't under version control."`" --as-error-line + fi + +} diff --git a/Automation/centos-art.sh-mods/Vcs/Subversion/subversion_mkRepoDirectory.sh b/Automation/centos-art.sh-mods/Vcs/Subversion/subversion_mkRepoDirectory.sh new file mode 100755 index 0000000..2e28067 --- /dev/null +++ b/Automation/centos-art.sh-mods/Vcs/Subversion/subversion_mkRepoDirectory.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# +# subversion_mkRepoDirectory.sh -- This function standardizes the way +# centos-art.sh script creates directories inside the working copy. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function subversion_mkRepoDirectory { + + local TARGET=$(cli_checkRepoDirSource ${1}) + + # Print action reference. + cli_printMessage "${TARGET}" --as-creating-line + + # Copy source location to its target using version control. + ${COMMAND} mkdir ${TARGET} --quiet + +} diff --git a/Automation/centos-art.sh-mods/Vcs/Subversion/subversion_syncRepoChanges.sh b/Automation/centos-art.sh-mods/Vcs/Subversion/subversion_syncRepoChanges.sh new file mode 100755 index 0000000..1171c4f --- /dev/null +++ b/Automation/centos-art.sh-mods/Vcs/Subversion/subversion_syncRepoChanges.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# +# subversion_syncRepoChanges.sh -- This function synchronizes both +# central repository and working copy directory structures by +# performing a subversion update command first and a subversion commit +# command later. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function subversion_syncRepoChanges { + + local LOCATION='' + local LOCATIONS="${@}" + + for LOCATION in $LOCATIONS;do + + # Verify whether the location is valid or not. + LOCATION=$(cli_checkRepoDirSource ${LOCATION}) + + # Verify source location absolute path. It should point either + # to existent files or directories both under version control + # inside the working copy. Otherwise, if it doesn't point to + # an existent file under version control, finish the script + # execution with an error message. + cli_checkFiles ${LOCATION} -e --is-versioned + + # Bring changes from the repository into the working copy. + subversion_updateRepoChanges ${LOCATION} + + # Check changes in the working copy. + subversion_commitRepoChanges ${LOCATION} + + done + +} diff --git a/Automation/centos-art.sh-mods/Vcs/Subversion/subversion_updateRepoChanges.sh b/Automation/centos-art.sh-mods/Vcs/Subversion/subversion_updateRepoChanges.sh new file mode 100755 index 0000000..5b24acb --- /dev/null +++ b/Automation/centos-art.sh-mods/Vcs/Subversion/subversion_updateRepoChanges.sh @@ -0,0 +1,94 @@ +#!/bin/bash +# +# subversion_updateRepoChanges.sh -- This function realizes a +# subversion update command against the working copy in order to bring +# changes from the central repository into the working copy. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function subversion_updateRepoChanges { + + local -a FILES + local -a INFO + local -a FILESNUM + local COUNT=0 + local UPDATEOUT='' + local PREDICATE='' + local CHNGTOTAL=0 + local LOCATION=$(cli_checkRepoDirSource "$1") + + # Verify source location absolute path. It should point either to + # existent files or directories both under version control inside + # the working copy. Otherwise, if it doesn't point to an existent + # file under version control, finish the script execution with an + # error message. + cli_checkFiles ${LOCATION} -e --is-versioned + + # Update working copy and retrieve update output. + cli_printMessage "`gettext "Bringing changes from the repository into the working copy"`" --as-banner-line + UPDATEOUT=$(${COMMAND} update ${LOCATION} --quiet) + + # Define path of files considered recent modifications from + # central repository to working copy. + FILES[0]=$(echo "$UPDATEOUT" | egrep "^A" | sed -r "s,^.+${TCAR_WORKDIR},,") + FILES[1]=$(echo "$UPDATEOUT" | egrep "^D" | sed -r "s,^.+${TCAR_WORKDIR},,") + FILES[2]=$(echo "$UPDATEOUT" | egrep "^U" | sed -r "s,^.+${TCAR_WORKDIR},,") + FILES[3]=$(echo "$UPDATEOUT" | egrep "^C" | sed -r "s,^.+${TCAR_WORKDIR},,") + FILES[4]=$(echo "$UPDATEOUT" | egrep "^G" | sed -r "s,^.+${TCAR_WORKDIR},,") + + # Define description of files considered recent modifications from + # central repository to working copy. + INFO[0]="`gettext "Added"`" + INFO[1]="`gettext "Deleted"`" + INFO[2]="`gettext "Updated"`" + INFO[3]="`gettext "Conflicted"`" + INFO[4]="`gettext "Merged"`" + + while [[ $COUNT -ne ${#FILES[*]} ]];do + + # Define total number of files. Avoid counting empty line. + if [[ "${FILES[$COUNT]}" == '' ]];then + FILESNUM[$COUNT]=0 + else + FILESNUM[$COUNT]=$(echo "${FILES[$COUNT]}" | wc -l) + fi + + # Calculate total amount of changes. + CHNGTOTAL=$(($CHNGTOTAL + ${FILESNUM[$COUNT]})) + + # Build report predicate. Use report predicate to show any + # information specific to the number of files found. For + # example, you can use this section to show warning messages, + # notes, and so on. By default we use the word `file' or + # `files' at ngettext's consideration followed by change + # direction. + PREDICATE[$COUNT]=`ngettext "file from the repository" \ + "files from the repository" $((${FILESNUM[$COUNT]} + 1))` + + # Output report line. + cli_printMessage "${INFO[$COUNT]}: ${FILESNUM[$COUNT]} ${PREDICATE[$COUNT]}" --as-stdout-line + + # Increase counter. + COUNT=$(($COUNT + 1)) + + done + +} diff --git a/Automation/centos-art.sh-mods/Vcs/vcs.sh b/Automation/centos-art.sh-mods/Vcs/vcs.sh new file mode 100755 index 0000000..7585198 --- /dev/null +++ b/Automation/centos-art.sh-mods/Vcs/vcs.sh @@ -0,0 +1,80 @@ +#!/bin/bash +# +# vcs.sh -- This function standardizes version control tasks inside +# the repository. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function vcs { + + local ACTIONNAM='' + local ACTIONNAMS='' + local ACTIONVAL='' + + # Verify whether version control actions should be performed or + # not inside the repository directory structure. + local ENABLED=$(cli_getConfigValue "${CLI_BASEDIR}/${CLI_NAME}.conf" "version_control" "enabled") + if [[ ! ${ENABLED} =~ '^(yes|ye|y|1)$' ]];then + return + fi + + # Initialize version control system to use inside the repository. + local PACKAGE=$(cli_getConfigValue "${CLI_BASEDIR}/${CLI_NAME}.conf" "version_control" "package") + + # Set possible values to packages used as version control system. + if [[ ${PACKAGE} =~ '^(git|subversion)$' ]];then + + # Initialize the absolute path to commands we'll use as + # version control system in the working copy. + case ${PACKAGE} in + + 'git' ) + COMMAND=/usr/bin/git + ;; + + 'subversion' ) + COMMAND=/usr/bin/svn + ;; + esac + + else + cli_printMessage "${PACKAGE} `gettext "isn't supported as version control system."`" --as-error-line + fi + + # Verify whether the related package is installed or not. + cli_checkFiles ${PACKAGE} --is-installed + + # Interpret arguments and options passed through command-line. + vcs_getOptions + + # Initialize function specific export id. + local EXPORTID="${CLI_FUNCDIRNAM}/$(cli_getRepoName ${PACKAGE} -d)/$(cli_getRepoName ${PACKAGE} -f)" + + # Export specific functionalities to the script environment. + cli_exportFunctions "${EXPORTID}" + + # Execute version control. + ${PACKAGE} + + # Unset specific functionalities from the script environment. + cli_unsetFunctions "${EXPORTID}" + +} diff --git a/Automation/centos-art.sh-mods/Vcs/vcs_getOptions.sh b/Automation/centos-art.sh-mods/Vcs/vcs_getOptions.sh new file mode 100755 index 0000000..3a0fcb6 --- /dev/null +++ b/Automation/centos-art.sh-mods/Vcs/vcs_getOptions.sh @@ -0,0 +1,117 @@ +#!/bin/bash +# +# vcs_getOptions.sh -- This function interprets option parameters +# passed to `vcs' functionality and calls actions accordingly. This +# function serves as interface to Subversion and Git +# sub-functionalities. +# +# 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. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function vcs_getOptions { + + # Define short options we want to support. + local ARGSS="h,q" + + # Define long options we want to support. + local ARGSL="help,quiet,synchronize,update,commit,is-versioned,status,mkdir,copy,delete" + + # Redefine ARGUMENTS using getopt(1) command parser. + cli_parseArguments + + # Redefine positional parameters using ARGUMENTS variable. + eval set -- "$ARGUMENTS" + + # Look for options passed through command-line. + while true; do + + case "$1" in + + -h | --help ) + cli_runFnEnvironment help --read --format="texinfo" "tcar-fs::scripts:bash-functions-vcs" + shift 1 + exit + ;; + + -q | --quiet ) + FLAG_QUIET="true" + shift 1 + ;; + + --synchronize ) + ACTIONNAMS="${ACTIONNAMS} ${PACKAGE}_syncRepoChanges" + shift 1 + ;; + + --commit ) + ACTIONNAMS="${ACTIONNAMS} ${PACKAGE}_commitRepoChanges" + shift 1 + ;; + + --update ) + ACTIONNAMS="${ACTIONNAMS} ${PACKAGE}_updateRepoChanges" + shift 1 + ;; + + --is-versioned ) + ACTIONNAMS="${ACTIONNAMS} ${PACKAGE}_isVersioned" + shift 1 + ;; + + --status ) + ACTIONNAMS="${ACTIONNAMS} ${PACKAGE}_getRepoStatus" + shift 1 + ;; + + --copy ) + ACTIONNAMS="${ACTIONNAMS} ${PACKAGE}_copyRepoFile" + shift 1 + ;; + + --mkdir ) + ACTIONNAMS="${ACTIONNAMS} ${PACKAGE}_mkRepoDirectory" + shift 1 + ;; + + --delete ) + ACTIONNAMS="${ACTIONNAMS} ${PACKAGE}_deleteRepoFile" + shift 1 + ;; + + -- ) + # Remove the `--' argument from the list of arguments + # in order for processing non-option arguments + # correctly. At this point all option arguments have + # been processed already but the `--' argument still + # remains to mark ending of option arguments and + # beginning of non-option arguments. The `--' argument + # needs to be removed here in order to avoid + # centos-art.sh script to process it as a path inside + # the repository, which obviously is not. + shift 1 + break + ;; + esac + done + + # Redefine ARGUMENTS variable using current positional parameters. + cli_parseArgumentsReDef "$@" + +} diff --git a/Documentation/Artworks/Models/Svg/Repository/directory-structure.svgz b/Documentation/Artworks/Models/Svg/Repository/directory-structure.svgz index d766542..1cd77e4 100644 Binary files a/Documentation/Artworks/Models/Svg/Repository/directory-structure.svgz and b/Documentation/Artworks/Models/Svg/Repository/directory-structure.svgz differ