diff --git a/Scripts/Bash/Functions/Verify/verify_getActions.sh b/Scripts/Bash/Functions/Verify/verify_getActions.sh index e82d7cc..0806d45 100755 --- a/Scripts/Bash/Functions/Verify/verify_getActions.sh +++ b/Scripts/Bash/Functions/Verify/verify_getActions.sh @@ -32,7 +32,9 @@ function verify_getActions { ;; --paths ) - verify_getPaths + verify_pathToCli + verify_pathToFonts + verify_pathToInkscape ;; * ) diff --git a/Scripts/Bash/Functions/Verify/verify_getPackages.sh b/Scripts/Bash/Functions/Verify/verify_getPackages.sh deleted file mode 100644 index dedc624..0000000 --- a/Scripts/Bash/Functions/Verify/verify_getPackages.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -# -# verify_getPackages.sh -- This function queries your system's -# rpm database to verify centos-art.sh required packages existence. -# If there is any missing package, leave a message and quit script -# execution. -# -# Copyright (C) 2009-2010 Alain Reguera Delgado -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public 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$ -# ---------------------------------------------------------------------- - -function verify_getPackages { - - # Define variables as local to avoid conflicts outside. - local PACKAGE='' - local PACKAGES='' - local PACKAGE_INFO='' - - # Define required packages needed by centos-art.sh script. - PACKAGES="bash inkscape ImageMagick netpbm netpbm-progs - syslinux gimp coreutils texinfo info tetex-latex tetex-fonts - tetex-doc tetex-xdvi tetex-dvips gettext texi2html" - - # Define, from required packages, packages being from third - # parties (i.e., packages not included in rhel, nor centos [base] - # repository.). - PACKAGES_FROM_THIRDS="(inkscape|blender)" - - # Output table of packages needed by centos-art.sh script. - for PACKAGE in $PACKAGES;do - PACKAGE_INFO=$(rpm -q --queryformat "%{SUMMARY}" $PACKAGE \ - | tr "\n" ' ' | sed -r 's!^([[:alpha:]])!\u\1!' ) - cli_printMessage "$PACKAGE | $PACKAGE_INFO" - done \ - | egrep -i $REGEX \ - | awk 'BEGIN {FS="|"; format ="%15s|%s\n" - printf "--------------------------------------------------------------------------------\n" - printf format, "'`gettext "Package"`' ", " '`gettext "Description"`'" - printf "--------------------------------------------------------------------------------\n"} - {printf format, substr($1,0,15), $2} - END {printf "--------------------------------------------------------------------------------\n"}' - - cli_printMessage "$(caller)" "AsToKnowMoreLine" -} diff --git a/Scripts/Bash/Functions/Verify/verify_getPathCli.sh b/Scripts/Bash/Functions/Verify/verify_getPathCli.sh deleted file mode 100755 index 3e891bd..0000000 --- a/Scripts/Bash/Functions/Verify/verify_getPathCli.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash -# -# verify_getPathCli.sh -- This function -# -# Copyright (C) 2009-2010 Alain Reguera Delgado -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public 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$ -# ---------------------------------------------------------------------- - -function verify_getPathCli { - - # Define variables as local to avoid conflicts outside. - local -a REPODIRS - local -a REPOFILES - local -a REPOLINKS - - # Define directories required by the centos-art.sh script command - # line interface. - REPODIRS[0]=/home/centos - REPODIRS[1]=/home/centos/bin - REPODIRS[2]=/home/centos/artwork/trunk/Scripts/Bash - - # Define files required by the centos-art.sh script command line - # interface. - REPOFILES=${REPODIRS[2]}/centos-art.sh - - # Define symbolic links required by the centos-art.sh script - # command line interface. - REPOLINKS=${REPODIRS[1]}/centos-art - - # Check defined directories, files, and symbolic links. - cli_checkFiles ${REPOFILES[@]} 'f' - cli_checkFiles ${REPOLINKS[@]} 'h' - -} diff --git a/Scripts/Bash/Functions/Verify/verify_getPathFonts.sh b/Scripts/Bash/Functions/Verify/verify_getPathFonts.sh deleted file mode 100644 index ccb9272..0000000 --- a/Scripts/Bash/Functions/Verify/verify_getPathFonts.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash -# -# verify_getPathFonts.sh -- This function checks user's fonts -# directory. In order for some artworks to be rendered correctly, -# denmark font needs to be available. By default, denmark font doesn't -# come with CentOS distribution so create a symbolic link (from the -# one we have inside repository) to make it available if it isn't yet. -# -# Copyright (C) 2009-2010 Alain Reguera Delgado -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public 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$ -# ---------------------------------------------------------------------- - -function verify_getPathFonts { - - # Define variables as local to avoid conflicts outside. - local -a REPODIRS - local -a REPOFILES - local -a REPOLINKS - - # Define font related directories. - REPODIRS[0]=/home/centos/.fonts - REPODIRS[1]=/home/centos/artwork/trunk/Identity/Fonts/Ttf - - # Define font related files. - REPOFILES=${REPODIRS[0]}/denmark.ttf - - # Define font related symbolic links. - REPOLINKS=${REPODIRS[1]}/denmark.ttf - - # Check defined directories, files, and symbolic links. - cli_checkFiles "${REPODIRS[@]}" - cli_checkFiles "${REPOFILES[@]}" - cli_checkFiles "${REPOLINKS[@]}" - -} diff --git a/Scripts/Bash/Functions/Verify/verify_getPathInkscape.sh b/Scripts/Bash/Functions/Verify/verify_getPathInkscape.sh deleted file mode 100755 index 2a27bc4..0000000 --- a/Scripts/Bash/Functions/Verify/verify_getPathInkscape.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -# -# verify_getPathInkscape.sh -- This function prepares user's -# ~/.inkscape configurations directory to use CentOS defaults (e.g., -# palettes, patterns, etc). -# -# Copyright (C) 2009-2010 Alain Reguera Delgado -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public 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$ -# ---------------------------------------------------------------------- - -function verify_getPathInkscape { - - # Define variables as local to avoid conflicts outside. - local -a REPODIRS - local -a REPOFILES - local -a REPOLINKS - - # Define directories required by the centos-art.sh script command - # line interface. - REPODIRS[0]=/home/centos/.inkscape/palettes - REPODIRS[1]=/home/centos/artwork/trunk/Identity/Colors - - # Define files required by the centos-art.sh script command line - # interface. - REPOFILES=${REPODIRS[1]}/CentOS.gpl - - # Define symbolic links required by the centos-art.sh script - # command line interface. - REPOLINKS=${REPODIRS[0]}/CentOS.gpl - - # Check defined directories, files, and symbolic links. - cli_checkFiles "${REPODIRS[@]}" - cli_checkFiles "${REPOFILES[@]}" - cli_checkFiles "${REPOLINKS[@]}" - -} diff --git a/Scripts/Bash/Functions/Verify/verify_getPaths.sh b/Scripts/Bash/Functions/Verify/verify_getPaths.sh deleted file mode 100644 index 208d8ab..0000000 --- a/Scripts/Bash/Functions/Verify/verify_getPaths.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -# -# verify_getPaths.sh -- This function verifies centos-art.sh -# required paths existence. If there is any missing path, leave a -# message and quit script execution. -# -# Copyright (C) 2009-2010 Alain Reguera Delgado -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public 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$ -# ---------------------------------------------------------------------- - -function verify_getPaths { - - verify_getPathCli - verify_getPathFonts - verify_getPathInkscape - -} diff --git a/Scripts/Bash/Functions/Verify/verify_pathToCli.sh b/Scripts/Bash/Functions/Verify/verify_pathToCli.sh new file mode 100755 index 0000000..d523f4e --- /dev/null +++ b/Scripts/Bash/Functions/Verify/verify_pathToCli.sh @@ -0,0 +1,63 @@ +#!/bin/bash +# +# verify_pathToCli.sh -- This function +# +# Copyright (C) 2009-2010 Alain Reguera Delgado +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public 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$ +# ---------------------------------------------------------------------- + +function verify_pathToCli { + + # Define variables as local to avoid conflicts outside. + local -a REPODIRS + local -a REPOFILES + local -a REPOLINKS + local FILE='' + + # Define directories required by the centos-art.sh script command + # line interface. + REPODIRS[0]=/home/centos + REPODIRS[1]=/home/centos/bin + REPODIRS[2]=/home/centos/artwork/trunk/Scripts/Bash + + # Define files required by the centos-art.sh script command line + # interface. + REPOFILES=${REPODIRS[2]}/centos-art.sh + + # Define symbolic links required by the centos-art.sh script + # command line interface. + REPOLINKS=${REPODIRS[1]}/centos-art + + # Check defined directories. + for FILE in "${REPODIRS[@]}";do + cli_checkFiles $FILE 'd' + done + + # Check defined files. + for FILE in "${REPOFILES[@]}";do + cli_checkFiles $FILE 'f' + done + + # Check defined symbolic links. + for FILE in "${REPOLINKS[@]}";do + cli_checkFiles $FILE 'h' + done + +} diff --git a/Scripts/Bash/Functions/Verify/verify_pathToFonts.sh b/Scripts/Bash/Functions/Verify/verify_pathToFonts.sh new file mode 100644 index 0000000..52e4857 --- /dev/null +++ b/Scripts/Bash/Functions/Verify/verify_pathToFonts.sh @@ -0,0 +1,63 @@ +#!/bin/bash +# +# verify_pathToFonts.sh -- This function checks user's fonts +# directory. In order for some artworks to be rendered correctly, +# denmark font needs to be available. By default, denmark font doesn't +# come with CentOS distribution so create a symbolic link (from the +# one we have inside repository) to make it available if it isn't yet. +# +# Copyright (C) 2009-2010 Alain Reguera Delgado +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public 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$ +# ---------------------------------------------------------------------- + +function verify_pathToFonts { + + # Define variables as local to avoid conflicts outside. + local -a REPODIRS + local -a REPOFILES + local -a REPOLINKS + local FILE='' + + # Define font related directories. + REPODIRS[0]=/home/centos/.fonts + REPODIRS[1]=/home/centos/artwork/trunk/Identity/Fonts/Ttf + + # Define font related files. + REPOFILES=${REPODIRS[1]}/denmark.ttf + + # Define font related symbolic links. + REPOLINKS=${REPODIRS[0]}/denmark.ttf + + # Check defined directories. + for FILE in "${REPODIRS[@]}";do + cli_checkFiles $FILE 'd' + done + + # Check defined files. + for FILE in "${REPOFILES[@]}";do + cli_checkFiles $FILE 'f' + done + + # Check defined symbolic links. + for FILE in "${REPOLINKS[@]}";do + cli_checkFiles $FILE 'h' + done + +} diff --git a/Scripts/Bash/Functions/Verify/verify_pathToInkscape.sh b/Scripts/Bash/Functions/Verify/verify_pathToInkscape.sh new file mode 100755 index 0000000..176166f --- /dev/null +++ b/Scripts/Bash/Functions/Verify/verify_pathToInkscape.sh @@ -0,0 +1,64 @@ +#!/bin/bash +# +# verify_pathToInkscape.sh -- This function prepares user's +# ~/.inkscape configurations directory to use CentOS defaults (e.g., +# palettes, patterns, etc). +# +# Copyright (C) 2009-2010 Alain Reguera Delgado +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public 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$ +# ---------------------------------------------------------------------- + +function verify_pathToInkscape { + + # Define variables as local to avoid conflicts outside. + local -a REPODIRS + local -a REPOFILES + local -a REPOLINKS + local FILE='' + + # Define directories required by the centos-art.sh script command + # line interface. + REPODIRS[0]=/home/centos/.inkscape/palettes + REPODIRS[1]=/home/centos/artwork/trunk/Identity/Colors + + # Define files required by the centos-art.sh script command line + # interface. + REPOFILES=${REPODIRS[1]}/CentOS.gpl + + # Define symbolic links required by the centos-art.sh script + # command line interface. + REPOLINKS=${REPODIRS[0]}/CentOS.gpl + + # Check defined directories. + for FILE in "${REPODIRS[@]}";do + cli_checkFiles $FILE 'd' + done + + # Check defined files. + for FILE in "${REPOFILES[@]}";do + cli_checkFiles $FILE 'f' + done + + # Check defined symbolic links. + for FILE in "${REPOLINKS[@]}";do + cli_checkFiles $FILE 'h' + done + +} diff --git a/Scripts/Bash/Functions/Verify/verify_pathToPackages.sh b/Scripts/Bash/Functions/Verify/verify_pathToPackages.sh new file mode 100644 index 0000000..dedc624 --- /dev/null +++ b/Scripts/Bash/Functions/Verify/verify_pathToPackages.sh @@ -0,0 +1,61 @@ +#!/bin/bash +# +# verify_getPackages.sh -- This function queries your system's +# rpm database to verify centos-art.sh required packages existence. +# If there is any missing package, leave a message and quit script +# execution. +# +# Copyright (C) 2009-2010 Alain Reguera Delgado +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public 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$ +# ---------------------------------------------------------------------- + +function verify_getPackages { + + # Define variables as local to avoid conflicts outside. + local PACKAGE='' + local PACKAGES='' + local PACKAGE_INFO='' + + # Define required packages needed by centos-art.sh script. + PACKAGES="bash inkscape ImageMagick netpbm netpbm-progs + syslinux gimp coreutils texinfo info tetex-latex tetex-fonts + tetex-doc tetex-xdvi tetex-dvips gettext texi2html" + + # Define, from required packages, packages being from third + # parties (i.e., packages not included in rhel, nor centos [base] + # repository.). + PACKAGES_FROM_THIRDS="(inkscape|blender)" + + # Output table of packages needed by centos-art.sh script. + for PACKAGE in $PACKAGES;do + PACKAGE_INFO=$(rpm -q --queryformat "%{SUMMARY}" $PACKAGE \ + | tr "\n" ' ' | sed -r 's!^([[:alpha:]])!\u\1!' ) + cli_printMessage "$PACKAGE | $PACKAGE_INFO" + done \ + | egrep -i $REGEX \ + | awk 'BEGIN {FS="|"; format ="%15s|%s\n" + printf "--------------------------------------------------------------------------------\n" + printf format, "'`gettext "Package"`' ", " '`gettext "Description"`'" + printf "--------------------------------------------------------------------------------\n"} + {printf format, substr($1,0,15), $2} + END {printf "--------------------------------------------------------------------------------\n"}' + + cli_printMessage "$(caller)" "AsToKnowMoreLine" +}