| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function render_doIdentityImages { |
| |
| local EXPORTID='' |
| local EXTERNALFILES='' |
| local EXTERNALFILE='' |
| local COMMONDIRCOUNT=0 |
| |
| |
| |
| EXPORTID='CENTOSARTWORK' |
| |
| |
| |
| for FILE in $FILES; do |
| |
| |
| render_getIdentityDefs |
| |
| |
| grep "id=\"$EXPORTID\"" $INSTANCE > /dev/null |
| if [[ $? -gt 0 ]];then |
| cli_printMessage "`eval_gettext "Can't found the export id (\\\$EXPORTID) inside \\\$TEMPLATE."`" "AsErrorLine" |
| cli_printMessage '-' 'AsSeparatorLine' |
| continue |
| fi |
| |
| # Define final image width. If FILE name is a number, asume it |
| # as the width value of the image being rendered. Otherwise |
| # use design template default width value. |
| WIDTH=$(basename $FILE) |
| if [[ $WIDTH =~ '^[0-9]+$' ]];then |
| WIDTH="--export-width=$WIDTH" |
| else |
| WIDTH='' |
| fi |
| |
| # Check existence of external files. 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. |
| |
| EXTERNALFILES="(xlink:href|sodipodi:absref)=\"$(cli_getRepoTLDir $TEMPLATE)" |
| EXTERNALFILES=$(egrep "${EXTERNALFILES}" "${INSTANCE}" \ |
| | sed -r 's!^[[:space:]]+!!' \ |
| | sed -r 's!^(xlink:href|sodipodi:absref)="!!' \ |
| | sed -r 's!".*$!!' | sort | uniq) |
| for EXTERNALFILE in $EXTERNALFILES;do |
| cli_checkFiles $EXTERNALFILE |
| done |
| |
| |
| |
| |
| cli_printMessage "$(inkscape $INSTANCE \ |
| --export-id=$EXPORTID $WIDTH --export-png=$FILE.png | sed -r \ |
| -e "s!Area !`gettext "Area"`: !" \ |
| -e "s!Background RRGGBBAA:!`gettext "Background"`: RRGGBBAA!" \ |
| -e "s!Bitmap saved as:!`gettext "Saved as"`:!")" \ |
| 'AsRegularLine' |
| |
| |
| if [[ -a $INSTANCE ]];then |
| rm $INSTANCE |
| fi |
| |
| |
| for ACTION in "${POSTACTIONS[@]}"; do |
| |
| case "$ACTION" in |
| |
| renderSyslinux* ) |
| render_doIdentityImageSyslinux "$FILE" "$ACTION" |
| ;; |
| |
| renderGrub* ) |
| render_doIdentityImageGrub "$FILE" "$ACTION" |
| ;; |
| |
| renderFormats:* ) |
| render_doIdentityImageFormats "$FILE" "$ACTION" |
| ;; |
| |
| renderBrands:* ) |
| render_doIdentityImageBrands "$FILE" "$ACTION" |
| ;; |
| |
| groupByType:* ) |
| render_doIdentityGroupByType "$FILE" "$ACTION" |
| ;; |
| |
| esac |
| |
| done |
| |
| |
| cli_printMessage '-' 'AsSeparatorLine' |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| if [[ ${COMMONDIRS[$((COMMONDIRCOUNT + 1))]} != $(dirname $TRANSLATION) ]];then |
| |
| |
| |
| |
| |
| for ACTION in "${LASTACTIONS[@]}"; do |
| |
| case "$ACTION" in |
| |
| renderKSplash ) |
| render_doIdentityImageKsplash |
| ;; |
| |
| renderDm:* ) |
| render_doIdentityImageDm "$ACTION" |
| ;; |
| |
| groupByType:* ) |
| render_doIdentityGroupByType "$ACTION" |
| ;; |
| |
| esac |
| done |
| fi |
| |
| |
| COMMONDIRCOUNT=$(($COMMONDIRCOUNT + 1)) |
| |
| done |
| |
| } |