diff --git a/Scripts/Bash/Cli/Functions/Identity/identity_checkAbsolutePaths.sh b/Scripts/Bash/Cli/Functions/Identity/identity_checkAbsolutePaths.sh deleted file mode 100755 index 1e942e5..0000000 --- a/Scripts/Bash/Cli/Functions/Identity/identity_checkAbsolutePaths.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash -# -# identity_checkAbsolutePaths.sh -- This function retrives absolute -# files and checks their existence. In order for design templates to -# point different artistic motifs, design templates make use of -# external files that point to specific artistic motif background -# images. If such external files doesn't exist, print a message and -# stop script execution. We cannot continue without background -# information. -# -# Copyright (C) 2009-2011 Alain Reguera Delgado -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -# USA. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function identity_checkAbsolutePaths { - - local FILE='' - local ABSPATHS='' - - # Define absolute path of file we need to retrive absolute paths - # from. - FILE="$1" - - # Verify existence of file we need to retrive absolute paths from. - cli_checkFiles $FILE 'f' - - # Retrive absolute paths from file. - ABSPATHS=$(egrep '="/[a-zA-Z0-9_./-]+" ' $FILE \ - | sed -r "s/ /\n/g" | egrep '(sodipodi:absref|xlink:href)=' \ - | sed -r "s/.+=\"(\/.+)\".*/\1/" | sort | uniq) - - # Verify absolute paths retrived from file. - for FILE in $ABSPATHS;do - cli_checkFiles $FILE - done - -} diff --git a/Scripts/Bash/Cli/Functions/Identity/identity_checkSvgAbsref.sh b/Scripts/Bash/Cli/Functions/Identity/identity_checkSvgAbsref.sh new file mode 100755 index 0000000..7cb27bd --- /dev/null +++ b/Scripts/Bash/Cli/Functions/Identity/identity_checkSvgAbsref.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# +# identity_checkSvgAbsref.sh -- This function retrives absolute files +# and checks their existence. In order for design templates to point +# different artistic motifs, design templates make use of external +# files that point to specific artistic motif background images. If +# such external files doesn't exist, print a message and stop script +# execution. We cannot continue without background information. +# +# Copyright (C) 2009-2011 Alain Reguera Delgado +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function identity_checkSvgAbsref { + + local FILE='' + local ABSPATHS='' + + # Define absolute path of file we need to retrive absolute paths + # from. + FILE="$1" + + # Verify existence of file we need to retrive absolute paths from. + cli_checkFiles $FILE 'f' + + # Retrive absolute paths from file. + ABSPATHS=$(egrep '="/[a-zA-Z0-9_./-]+" ' $FILE \ + | sed -r "s/ /\n/g" | egrep '(sodipodi:absref|xlink:href)=' \ + | sed -r "s/.+=\"(\/.+)\".*/\1/" | sort | uniq) + + # Verify absolute paths retrived from file. + for FILE in $ABSPATHS;do + cli_checkFiles $FILE + done + +} diff --git a/Scripts/Bash/Cli/Functions/Identity/identity_renderSvg.sh b/Scripts/Bash/Cli/Functions/Identity/identity_renderSvg.sh index d13e9a8..01b6558 100644 --- a/Scripts/Bash/Cli/Functions/Identity/identity_renderSvg.sh +++ b/Scripts/Bash/Cli/Functions/Identity/identity_renderSvg.sh @@ -44,7 +44,7 @@ function identity_renderSvg { # background information is not available the image is produced # without background information. This is something that need to # be avoided. - identity_checkAbsolutePaths "$INSTANCE" + identity_checkSvgAbsref "$INSTANCE" # Render template instance using inkscape. Modify the inkscape # output to reduce the amount of characters used in description