Blame Scripts/Bash/centos-art/Functions/Verify/verify_doLinks.sh

08abde
#!/bin/bash
08abde
#
08abde
# verify_doLinks.sh -- This function verifies required links your
08abde
# workstation needs in order to run the centos-art command correctly.
08abde
# If any required link is missing, the `centos-art.sh' script asks you
08abde
# to confirm their installation. When installing links, the
08abde
# `centos-art.sh' script uses the `ln' command to achieve the task.
08abde
#
9f5f2e
# Copyright (C) 2009-2011 Alain Reguera Delgado
08abde
# 
7cd8e9
# This program is free software; you can redistribute it and/or
7cd8e9
# modify it under the terms of the GNU General Public License as
7cd8e9
# published by the Free Software Foundation; either version 2 of the
7cd8e9
# License, or (at your option) any later version.
08abde
# 
08abde
# This program is distributed in the hope that it will be useful, but
08abde
# WITHOUT ANY WARRANTY; without even the implied warranty of
08abde
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
08abde
# General Public License for more details.
08abde
#
08abde
# You should have received a copy of the GNU General Public License
08abde
# along with this program; if not, write to the Free Software
08abde
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
08abde
# USA.
08abde
# 
08abde
# ----------------------------------------------------------------------
08abde
# $Id$
08abde
# ----------------------------------------------------------------------
08abde
08abde
function verify_doLinks {
08abde
08abde
    local -a LINKS
08abde
    local -a TARGETS
08abde
    local -a LINKS_MISSING
08abde
    local LINKS_MISSING_ID=''
08abde
08abde
    # Define link names.
7b46a4
    LINKS[0]=${HOME}/bin/centos-art
7b46a4
    LINKS[1]=${HOME}/.fonts/denmark.ttf
7b46a4
    LINKS[2]=${HOME}/.inkscape/palettes/CentOS.gpl
7b46a4
    LINKS[3]=${HOME}/.$(rpm -q gimp | cut -d. -f-2)/palettes/CentOS.gpl
7b46a4
    LINKS[4]=${HOME}/artwork/branches/Scripts
08abde
08abde
    # Define link targets. Use array index as reference to know
08abde
    # relation between link names and targets. Be sure both link names
08abde
    # and link targets use the same array index value.
7b46a4
    TARGETS[0]=${CLI_BASEDIR}/init.sh
7b46a4
    TARGETS[1]=$(cli_getRepoTLDir)/Identity/Fonts/Ttf/denmark.ttf
7b46a4
    TARGETS[2]=$(cli_getRepoTLDir)/Identity/Colors/CentOS.gpl
08abde
    TARGETS[3]=${TARGETS[2]}
7b46a4
    TARGETS[4]=$(cli_getRepoTLDir)/Scripts/
08abde
08abde
    verify_doLinkCheck
08abde
    verify_doLinkReport
08abde
    verify_doLinkInstall
08abde
08abde
    # At this point all required links must be installed. To confirm
08abde
    # required links installation let's verify them once more.
08abde
    verify_doLinks
08abde
08abde
}