Blame tcar-scripts-locale/modules/files/modules/update/modules/svg/svg_createSvgInstance.sh

Alain Reguera Delgado f23b0d
#!/bin/bash
Alain Reguera Delgado f23b0d
######################################################################
Alain Reguera Delgado f23b0d
#
Alain Reguera Delgado f23b0d
#   svg_createSvgInstance.sh -- This function verifies whether the
Alain Reguera Delgado f23b0d
#   file being processed is compressed or not, then uses that
Alain Reguera Delgado f23b0d
#   information to read the file and create an instance of it.
Alain Reguera Delgado f23b0d
#
Alain Reguera Delgado f23b0d
#   Written by:
Alain Reguera Delgado f23b0d
#   * Alain Reguera Delgado <al@centos.org.cu>, 2009-2013
Alain Reguera Delgado f23b0d
#
Alain Reguera Delgado f23b0d
# Copyright (C) 2009-2013 The CentOS Artwork SIG
Alain Reguera Delgado f23b0d
#
Alain Reguera Delgado f23b0d
# This program is free software; you can redistribute it and/or modify
Alain Reguera Delgado f23b0d
# it under the terms of the GNU General Public License as published by
Alain Reguera Delgado f23b0d
# the Free Software Foundation; either version 2 of the License, or (at
Alain Reguera Delgado f23b0d
# your option) any later version.
Alain Reguera Delgado f23b0d
#
Alain Reguera Delgado f23b0d
# This program is distributed in the hope that it will be useful, but
Alain Reguera Delgado f23b0d
# WITHOUT ANY WARRANTY; without even the implied warranty of
Alain Reguera Delgado f23b0d
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Alain Reguera Delgado f23b0d
# General Public License for more details.
Alain Reguera Delgado f23b0d
#
Alain Reguera Delgado f23b0d
# You should have received a copy of the GNU General Public License
Alain Reguera Delgado f23b0d
# along with this program; if not, write to the Free Software
Alain Reguera Delgado f23b0d
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Alain Reguera Delgado f23b0d
#
Alain Reguera Delgado f23b0d
######################################################################
Alain Reguera Delgado f23b0d
Alain Reguera Delgado f23b0d
function svg_createSvgInstance {
Alain Reguera Delgado f23b0d
Alain Reguera Delgado f23b0d
    if [[ $(/usr/bin/file -b -i ${RENDER_FROM}) =~ '^application/x-gzip$' ]];then
Alain Reguera Delgado f23b0d
        /bin/zcat ${RENDER_FROM} > ${SVG_INSTANCE}
Alain Reguera Delgado f23b0d
    else
Alain Reguera Delgado f23b0d
        /bin/cat ${RENDER_FROM} > ${SVG_INSTANCE}
Alain Reguera Delgado f23b0d
    fi
Alain Reguera Delgado f23b0d
Alain Reguera Delgado f23b0d
}