Blame Scripts/Bash/Functions/Verify/verify_requiredPackages.sh

4c79b5
#!/bin/bash
4c79b5
#
30055d
# verify_requiredPackages.sh -- This function queries your system's
4c79b5
# rpm database to verify centos-art.sh required packages existence.
4c79b5
# If there is any missing package, leave a message and quit script
4c79b5
# execution.
4c79b5
#
4c79b5
# Copyright (C) 2009-2010 Alain Reguera Delgado
4c79b5
# 
4c79b5
# This program is free software; you can redistribute it and/or modify
4c79b5
# it under the terms of the GNU General Public License as published by
4c79b5
# the Free Software Foundation; either version 2 of the License, or
4c79b5
# (at your option) any later version.
4c79b5
# 
4c79b5
# This program is distributed in the hope that it will be useful, but
4c79b5
# WITHOUT ANY WARRANTY; without even the implied warranty of
4c79b5
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4c79b5
# General Public License for more details.
4c79b5
#
4c79b5
# You should have received a copy of the GNU General Public License
4c79b5
# along with this program; if not, write to the Free Software
4c79b5
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
4c79b5
# USA.
4c79b5
# 
4c79b5
# ----------------------------------------------------------------------
3b853a
# $Id$
4c79b5
# ----------------------------------------------------------------------
4c79b5
30055d
function verify_requiredPackages {
4c79b5
4c79b5
    # Define variables as local to avoid conflicts outside.
4c79b5
    local PACKAGE=''
4c79b5
    local PACKAGES=''
3b853a
    local PACKAGE_INFO=''
4c79b5
4c79b5
    # Define required packages needed by centos-art.sh script.
4c79b5
    PACKAGES="bash inkscape ImageMagick netpbm netpbm-progs
4c79b5
        syslinux gimp coreutils texinfo info tetex-latex tetex-fonts
3b853a
        tetex-doc tetex-xdvi tetex-dvips gettext texi2html"
4c79b5
4c79b5
    # Define, from required packages, packages being from third
4c79b5
    # parties (i.e., packages not included in rhel, nor centos [base]
4c79b5
    # repository.).
4c79b5
    PACKAGES_FROM_THIRDS="(inkscape|blender)"
4c79b5
3b853a
    # Output table of packages needed by centos-art.sh script.
6a01d0
    rpm -q --queryformat "%{NAME}: %{SUMMARY}\n" $PACKAGES \
6a01d0
        | egrep -i $REGEX
3b853a
3b853a
    cli_printMessage "$(caller)" "AsToKnowMoreLine"
4c79b5
}