|
|
878a2b |
#!/bin/bash
|
|
|
878a2b |
#
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
# system's execution path and make common brushes, patterns, palettes
|
|
|
878a2b |
|
|
|
878a2b |
# use of them without loosing version control over them.
|
|
|
878a2b |
#
|
|
|
03486a |
# Copyright (C) 2009, 2010, 2011, 2012 The CentOS Project
|
|
|
878a2b |
#
|
|
|
878a2b |
# This program is free software; you can redistribute it and/or modify
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
#
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
# General Public License for more details.
|
|
|
878a2b |
#
|
|
|
878a2b |
|
|
|
878a2b |
# along with this program; if not, write to the Free Software
|
|
|
878a2b |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
878a2b |
#
|
|
|
878a2b |
# ----------------------------------------------------------------------
|
|
|
878a2b |
# $Id$
|
|
|
878a2b |
# ----------------------------------------------------------------------
|
|
|
878a2b |
|
|
|
878a2b |
function prepare_updateLinks {
|
|
|
878a2b |
|
|
|
878a2b |
local -a LINKS_SRC
|
|
|
878a2b |
local -a LINKS_DST
|
|
|
878a2b |
local USERFILES=''
|
|
|
878a2b |
local PALETTE=''
|
|
|
878a2b |
local BRUSH=''
|
|
|
878a2b |
local PATTERN=''
|
|
|
878a2b |
local FONT=''
|
|
|
878a2b |
local FILE=''
|
|
|
878a2b |
local COUNT=0
|
|
|
878a2b |
|
|
|
d4d4d3 |
|
|
|
d4d4d3 |
|
|
|
878a2b |
local GIMP_DIR=${HOME}/.$(rpm -q gimp | cut -d. -f-2)
|
|
|
878a2b |
local GIMP_DIR_BRUSHES=${GIMP_DIR}/brushes
|
|
|
878a2b |
local GIMP_DIR_PALETTES=${GIMP_DIR}/palettes
|
|
|
878a2b |
local GIMP_DIR_PATTERNS=${GIMP_DIR}/patterns
|
|
|
878a2b |
local INKS_DIR=${HOME}/.inkscape
|
|
|
878a2b |
local INKS_DIR_PALETTES=${INKS_DIR}/palettes
|
|
|
878a2b |
local FONT_DIR=${HOME}/.fonts
|
|
|
878a2b |
local APPS_DIR=${HOME}/bin
|
|
|
878a2b |
|
|
|
d4d4d3 |
|
|
|
d4d4d3 |
|
|
|
1b3621 |
local WCDIR=${TCAR_WORKDIR}/trunk/Identity
|
|
|
878a2b |
local WCDIR_BRUSHES=${WCDIR}/Brushes
|
|
|
878a2b |
local WCDIR_PALETTES=${WCDIR}/Palettes
|
|
|
878a2b |
local WCDIR_PATTERNS=${WCDIR}/Patterns
|
|
|
878a2b |
local WCDIR_FONTS=${WCDIR}/Fonts
|
|
|
878a2b |
local WCDIR_EDITOR=${PREPARE_CONFIG_DIR}
|
|
|
878a2b |
|
|
|
d4d4d3 |
|
|
|
d4d4d3 |
|
|
|
d4d4d3 |
|
|
|
d4d4d3 |
|
|
|
d4d4d3 |
for DIR in $(echo "Brushes Palettes Patterns Fonts");do
|
|
|
e9c25e |
cli_checkFiles ${WCDIR}/${DIR} ]];then
|
|
|
d4d4d3 |
done
|
|
|
d4d4d3 |
|
|
|
878a2b |
|
|
|
02dc08 |
LINKS_SRC[((++${#LINKS_SRC[*]}))]=${APPS_DIR}/${CLI_NAME}
|
|
|
02dc08 |
LINKS_DST[((++${#LINKS_DST[*]}))]=${CLI_BASEDIR}/${CLI_NAME}.sh
|
|
|
02dc08 |
USERFILES="${APPS_DIR}/${CLI_NAME}"
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
for FONT in $(cli_getFilesList "${WCDIR_FONTS}" --pattern='.+\.ttf');do
|
|
|
878a2b |
LINKS_SRC[((++${#LINKS_SRC[*]}))]=${FONT_DIR}/$(basename $FONT)
|
|
|
878a2b |
LINKS_DST[((++${#LINKS_DST[*]}))]=${FONT}
|
|
|
878a2b |
done
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
for PALETTE in $(cli_getFilesList "${WCDIR_PALETTES}" --pattern=".+\.gpl");do
|
|
|
878a2b |
LINKS_SRC[((++${#LINKS_SRC[*]}))]=${GIMP_DIR_PALETTES}/$(prepare_getLinkName ${WCDIR_PALETTES} ${PALETTE})
|
|
|
878a2b |
LINKS_DST[((++${#LINKS_DST[*]}))]=${PALETTE}
|
|
|
878a2b |
LINKS_SRC[((++${#LINKS_SRC[*]}))]=${INKS_DIR_PALETTES}/$(prepare_getLinkName ${WCDIR_PALETTES} ${PALETTE})
|
|
|
878a2b |
LINKS_DST[((++${#LINKS_DST[*]}))]=${PALETTE}
|
|
|
878a2b |
done
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
for BRUSH in $(cli_getFilesList "${WCDIR_BRUSHES}" --pattern=".+\.(gbr|gih)");do
|
|
|
878a2b |
LINKS_SRC[((++${#LINKS_SRC[*]}))]=${GIMP_DIR_BRUSHES}/$(prepare_getLinkName ${WCDIR_BRUSHES} ${BRUSH})
|
|
|
878a2b |
LINKS_DST[((++${#LINKS_DST[*]}))]=${BRUSH}
|
|
|
878a2b |
done
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
for PATTERN in $(cli_getFilesList "${WCDIR_PATTERNS}" --pattern=".+\.png");do
|
|
|
878a2b |
LINKS_SRC[((++${#LINKS_SRC[*]}))]=${GIMP_DIR_PATTERNS}/$(prepare_getLinkName ${WCDIR_BRUSHES} ${BRUSH})
|
|
|
878a2b |
LINKS_DST[((++${#LINKS_DST[*]}))]=${PATTERN}
|
|
|
878a2b |
done
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
if [[ $EDITOR == '/usr/bin/vim' ]];then
|
|
|
878a2b |
LINKS_SRC[((++${#LINKS_SRC[*]}))]=${HOME}/.vimrc
|
|
|
878a2b |
LINKS_DST[((++${#LINKS_DST[*]}))]=${WCDIR_EDITOR}/vim.conf
|
|
|
878a2b |
USERFILES="${USERFILES} ${HOME}/.vimrc"
|
|
|
878a2b |
fi
|
|
|
878a2b |
|
|
|
3fc0ea |
|
|
|
3fc0ea |
|
|
|
3fc0ea |
|
|
|
3fc0ea |
|
|
|
3fc0ea |
|
|
|
3fc0ea |
|
|
|
3fc0ea |
|
|
|
61bb0b |
LINKS_SRC[((++${#LINKS_SRC[*]}))]=${TCAR_WORKDIR}/trunk/Identity/Webenv/Themes/Default/Docbook/1.69.1/Css/reset.css
|
|
|
61bb0b |
LINKS_DST[((++${#LINKS_DST[*]}))]=${TCAR_WORKDIR}/trunk/Identity/Webenv/Themes/Default/Style-guide/0.0.1/Css/reset.css
|
|
|
3fc0ea |
|
|
|
3fc0ea |
|
|
|
3fc0ea |
|
|
|
3fc0ea |
|
|
|
3fc0ea |
|
|
|
3fc0ea |
|
|
|
61bb0b |
LINKS_SRC[((++${#LINKS_SRC[*]}))]=${TCAR_WORKDIR}/trunk/Identity/Webenv/Themes/Default/Style-guide/0.0.1/Images
|
|
|
3fc0ea |
LINKS_DST[((++${#LINKS_DST[*]}))]=${TCAR_WORKDIR}/trunk/Identity/Images/Webenv
|
|
|
3fc0ea |
|
|
|
61bb0b |
|
|
|
61bb0b |
|
|
|
61bb0b |
LINKS_SRC[((++${#LINKS_SRC[*]}))]=${TCAR_WORKDIR}/trunk/Identity/Images/Webenv/Manuals
|
|
|
61bb0b |
LINKS_DST[((++${#LINKS_DST[*]}))]=${TCAR_WORKDIR}/trunk/Identity/Images/Manuals
|
|
|
61bb0b |
|
|
|
3fc0ea |
|
|
|
3fc0ea |
|
|
|
3fc0ea |
LINKS_SRC[((++${#LINKS_SRC[*]}))]=${TCAR_WORKDIR}/trunk/Identity/Images/Webenv/logo-centos.png
|
|
|
3fc0ea |
LINKS_DST[((++${#LINKS_DST[*]}))]=${TCAR_WORKDIR}/trunk/Identity/Images/Brands/Logos/White/78/centos.png
|
|
|
3fc0ea |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
USERFILES=$(echo "$USERFILES";
|
|
|
878a2b |
cli_getFilesList ${APPS_DIR} --pattern='.+\.sh';
|
|
|
878a2b |
cli_getFilesList ${FONT_DIR} --pattern='.+\.ttf';
|
|
|
878a2b |
cli_getFilesList ${GIMP_DIR_BRUSHES} --pattern='.+\.(gbr|gih)';
|
|
|
878a2b |
cli_getFilesList ${GIMP_DIR_PATTERNS} --pattern='.+\.(pat|png|jpg|bmp)';
|
|
|
878a2b |
cli_getFilesList ${GIMP_DIR_PALETTES} --pattern='.+\.gpl';
|
|
|
878a2b |
cli_getFilesList ${INKS_DIR_PALETTES} --pattern='.+\.gpl';)
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
3fc0ea |
|
|
|
3fc0ea |
|
|
|
3fc0ea |
|
|
|
878a2b |
if [[ "$USERFILES" != '' ]];then
|
|
|
878a2b |
rm -r $USERFILES
|
|
|
878a2b |
fi
|
|
|
878a2b |
|
|
|
878a2b |
while [[ $COUNT -lt ${#LINKS_SRC[*]} ]];do
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
cli_printMessage "${LINKS_SRC[$COUNT]}" --as-creating-line
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
if [[ ! -d $(dirname ${LINKS_SRC[$COUNT]}) ]];then
|
|
|
878a2b |
mkdir -p $(dirname ${LINKS_SRC[$COUNT]})
|
|
|
878a2b |
fi
|
|
|
878a2b |
|
|
|
3fc0ea |
|
|
|
3fc0ea |
|
|
|
3fc0ea |
|
|
|
3fc0ea |
if [[ -a ${LINKS_SRC[$COUNT]} ]];then
|
|
|
3fc0ea |
rm ${LINKS_SRC[$COUNT]}
|
|
|
3fc0ea |
fi
|
|
|
3fc0ea |
|
|
|
878a2b |
|
|
|
878a2b |
ln ${LINKS_DST[$COUNT]} ${LINKS_SRC[$COUNT]} --symbolic --force
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
COUNT=$(($COUNT + 1))
|
|
|
878a2b |
|
|
|
878a2b |
done
|
|
|
878a2b |
|
|
|
878a2b |
}
|