|
|
8af4d8 |
#!/bin/bash
|
|
|
8af4d8 |
#
|
|
|
ab1d67 |
# render_doSvgPostActions.sh -- This function performs
|
|
|
8af4d8 |
# post-rendition actions for SVG files.
|
|
|
8af4d8 |
#
|
|
|
8af4d8 |
# Copyright (C) 2009-2011 Alain Reguera Delgado
|
|
|
8af4d8 |
#
|
|
|
8af4d8 |
# This program is free software; you can redistribute it and/or
|
|
|
8af4d8 |
|
|
|
8af4d8 |
|
|
|
8af4d8 |
|
|
|
8af4d8 |
#
|
|
|
8af4d8 |
|
|
|
8af4d8 |
|
|
|
8af4d8 |
|
|
|
8af4d8 |
# General Public License for more details.
|
|
|
8af4d8 |
#
|
|
|
8af4d8 |
|
|
|
8af4d8 |
# along with this program; if not, write to the Free Software
|
|
|
8af4d8 |
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
8af4d8 |
# USA.
|
|
|
8af4d8 |
#
|
|
|
8af4d8 |
# ----------------------------------------------------------------------
|
|
|
8af4d8 |
# $Id$
|
|
|
8af4d8 |
# ----------------------------------------------------------------------
|
|
|
8af4d8 |
|
|
|
ab1d67 |
function render_doSvgPostActions {
|
|
|
8af4d8 |
|
|
|
8af4d8 |
local ACTION=''
|
|
|
8af4d8 |
|
|
|
05d9ae |
|
|
|
05d9ae |
# as local to this function. Otherwise it may confuse command-line
|
|
|
05d9ae |
|
|
|
05d9ae |
local -a POSTACTIONS
|
|
|
05d9ae |
|
|
|
dc167f |
|
|
|
05d9ae |
# list of post actions and last actions. This is required in order
|
|
|
05d9ae |
|
|
|
05d9ae |
|
|
|
05d9ae |
|
|
|
05d9ae |
|
|
|
266fd5 |
if [[ $TEMPLATE =~ "Backgrounds/.+\.svg$" ]];then
|
|
|
dc167f |
POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngTo: jpg'
|
|
|
ddd73c |
POSTACTIONS[((++${#POSTACTIONS[*]}))]='groupSimilarFiles: png jpg'
|
|
|
05d9ae |
elif [[ $TEMPLATE =~ "Distro/$(cli_getPathComponent '--release-pattern')/Syslinux/.+\.svg$" ]];then
|
|
|
5f7579 |
POSTACTIONS[((++${#POSTACTIONS[*]}))]='renderSyslinux'
|
|
|
5f7579 |
POSTACTIONS[((++${#POSTACTIONS[*]}))]='renderSyslinux:-floyd'
|
|
|
05d9ae |
elif [[ $TEMPLATE =~ "Grub" ]];then
|
|
|
5f7579 |
POSTACTIONS[((++${#POSTACTIONS[*]}))]='renderGrub'
|
|
|
5f7579 |
POSTACTIONS[((++${#POSTACTIONS[*]}))]='renderGrub:-floyd'
|
|
|
05d9ae |
elif [[ $TEMPLATE =~ "Distro/$(cli_getPathComponent '--release-pattern')/Ksplash/.+\.svg$" ]];then
|
|
|
5f7579 |
POSTACTIONS[((++${#POSTACTIONS[*]}))]='renderKsplash'
|
|
|
05d9ae |
fi
|
|
|
dc167f |
|
|
|
61bb5b |
|
|
|
61bb5b |
# command-line and add them, if any, to post-rendition list of
|
|
|
61bb5b |
|
|
|
61bb5b |
if [[ $FLAG_CONVERT != '' ]];then
|
|
|
61bb5b |
POSTACTIONS[((++${#POSTACTIONS[*]}))]="convertPngTo:${FLAG_CONVERT}"
|
|
|
61bb5b |
fi
|
|
|
61bb5b |
if [[ $FLAG_ROTATE != '' ]];then
|
|
|
61bb5b |
POSTACTIONS[((++${#POSTACTIONS[*]}))]="rotatePngTo:${FLAG_ROTATE}"
|
|
|
61bb5b |
fi
|
|
|
61bb5b |
if [[ $FLAG_RESIZE != '' ]];then
|
|
|
61bb5b |
POSTACTIONS[((++${#POSTACTIONS[*]}))]="resizePngTo:${FLAG_RESIZE}"
|
|
|
dc167f |
fi
|
|
|
dc167f |
|
|
|
61bb5b |
|
|
|
8af4d8 |
for ACTION in "${POSTACTIONS[@]}"; do
|
|
|
8af4d8 |
|
|
|
8af4d8 |
case "${ACTION}" in
|
|
|
8af4d8 |
|
|
|
dc167f |
convertPngTo:* )
|
|
|
ab1d67 |
render_convertPngTo
|
|
|
dc167f |
|
|
|
dc167f |
|
|
|
61bb5b |
rotatePngTo:* )
|
|
|
61bb5b |
render_rotatePngTo
|
|
|
61bb5b |
|
|
|
61bb5b |
|
|
|
61bb5b |
resizePngTo:* )
|
|
|
61bb5b |
render_resizePngTo
|
|
|
61bb5b |
|
|
|
61bb5b |
|
|
|
8af4d8 |
renderSyslinux* )
|
|
|
ab1d67 |
render_doSyslinux
|
|
|
8af4d8 |
|
|
|
8af4d8 |
|
|
|
8af4d8 |
renderGrub* )
|
|
|
ab1d67 |
render_doGrub
|
|
|
8af4d8 |
|
|
|
8af4d8 |
|
|
|
8af4d8 |
renderBrands )
|
|
|
ab1d67 |
render_doBrands
|
|
|
8af4d8 |
|
|
|
8af4d8 |
|
|
|
266fd5 |
groupSimilarFiles:* )
|
|
|
266fd5 |
render_groupSimilarFiles
|
|
|
266fd5 |
|
|
|
266fd5 |
|
|
|
8af4d8 |
esac
|
|
|
8af4d8 |
|
|
|
8af4d8 |
done
|
|
|
8af4d8 |
|
|
|
8af4d8 |
}
|