diff --git a/Scripts/Bash/Functions/Identity/identity_checkAbsolutePaths.sh b/Scripts/Bash/Functions/Identity/identity_checkAbsolutePaths.sh new file mode 100755 index 0000000..1e942e5 --- /dev/null +++ b/Scripts/Bash/Functions/Identity/identity_checkAbsolutePaths.sh @@ -0,0 +1,54 @@ +#!/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/Functions/Identity/identity_renderAbsolutePaths.sh b/Scripts/Bash/Functions/Identity/identity_renderAbsolutePaths.sh deleted file mode 100755 index 459081c..0000000 --- a/Scripts/Bash/Functions/Identity/identity_renderAbsolutePaths.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash -# -# identity_renderAbsolutePaths.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_renderAbsolutePaths { - - 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/Functions/Identity/identity_renderBase.sh b/Scripts/Bash/Functions/Identity/identity_renderBase.sh index 53ad274..2b4205d 100755 --- a/Scripts/Bash/Functions/Identity/identity_renderBase.sh +++ b/Scripts/Bash/Functions/Identity/identity_renderBase.sh @@ -168,7 +168,7 @@ function identity_renderBase { # artistic motif background images. If such external files # doesn't exist, print a message and stop script execution. # We cannot continue without background information. - identity_renderAbsolutePaths "$INSTANCE" + identity_checkAbsolutePaths "$INSTANCE" # Render template instance and modify the inkscape output to # reduce the amount of characters used in description column