From ae8a10de72f6d0331094c58b53e5f2ed8b70a554 Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Oct 14 2010 17:24:55 +0000 Subject: Add render_doIdentityImageGdm.sh (last-rendering) functionality to produce gdm tar.gz theme files for different artistic motifs and major releases of CentOS distribution. Update GDM render.conf.sh pre-rendering configuration script to use render_doIdentityImageGdm functionality as last-rendering action. In this commit, tar.gz files are produced for the following screen resolutions: 800x600 1024x768 1280x1024 1360x768 1680x1050 2048x1536 2560x960 2560x1240 3271x1227. Replace `sanitize' word to `sanitate'. --- diff --git a/Scripts/Bash/Functions/Render/Config/Identity/Themes/Distro/BootUp/GDM/render.conf.sh b/Scripts/Bash/Functions/Render/Config/Identity/Themes/Distro/BootUp/GDM/render.conf.sh index eae40bc..76b3f3b 100755 --- a/Scripts/Bash/Functions/Render/Config/Identity/Themes/Distro/BootUp/GDM/render.conf.sh +++ b/Scripts/Bash/Functions/Render/Config/Identity/Themes/Distro/BootUp/GDM/render.conf.sh @@ -28,9 +28,8 @@ function render_loadConfig { # Define rendering actions. ACTIONS[0]='BASE:renderImage' - ACTIONS[1]='LAST:renderGdmTgz: 1024x768 1280x1024 1360x250 1360x768 - 160x600 1680x1050 2048x1536 2560x1240 2560x960 260x130 3271x1227 - 800x600' + ACTIONS[1]="LAST:renderGdmTgz: 800x600 1024x768 1280x1024 1360x768 \ + 1680x1050 2048x1536 2560x960 2560x1240 3271x1227" # Define matching list. #MATCHINGLIST='' diff --git a/Scripts/Bash/Functions/Render/render_doIdentityGroupByType.sh b/Scripts/Bash/Functions/Render/render_doIdentityGroupByType.sh index 94710e2..9bf6a51 100755 --- a/Scripts/Bash/Functions/Render/render_doIdentityGroupByType.sh +++ b/Scripts/Bash/Functions/Render/render_doIdentityGroupByType.sh @@ -85,7 +85,7 @@ function render_doIdentityGroupByType { cli_printMessage $(caller) "AsToKnowMoreLine" fi - # Sanitize file types passed from render.conf.sh pre-rendering + # Sanitate file types passed from render.conf.sh pre-rendering # configuration script. FORMATS=$(echo "${FORMATS}" \ | cut -d: -f2- \ diff --git a/Scripts/Bash/Functions/Render/render_doIdentityImageFormats.sh b/Scripts/Bash/Functions/Render/render_doIdentityImageFormats.sh index d18ba83..087753c 100644 --- a/Scripts/Bash/Functions/Render/render_doIdentityImageFormats.sh +++ b/Scripts/Bash/Functions/Render/render_doIdentityImageFormats.sh @@ -35,7 +35,7 @@ function render_doIdentityImageFormats { # Get image formats. local FORMATS=$(echo "$2" | cut -d: -f2-) - # Sanitize image formats. + # Sanitate image formats. FORMATS=$(echo "${FORMATS}" \ | sed -r 's!^ *!!g' \ | sed -r 's!( |:|,|;) *! !g' \ diff --git a/Scripts/Bash/Functions/Render/render_doIdentityImageGdm.sh b/Scripts/Bash/Functions/Render/render_doIdentityImageGdm.sh new file mode 100755 index 0000000..09da82e --- /dev/null +++ b/Scripts/Bash/Functions/Render/render_doIdentityImageGdm.sh @@ -0,0 +1,135 @@ +#!/bin/bash +# +# render_doIdentityImageGdm.sh -- This function creates gdm tar.gz +# files for different motifs, screen resolutions and major releases of +# CentOS distribution. +# +# Copyright (C) 2009-2010 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 render_doIdentityImageGdm { + + local RESOLUTIONS='' + local VERSIONS='' + local TPL='' + local BGS='' + local TMP='' + local SYMBOL='' + + # Get screen resolutions passed from render.conf.sh pre-rendering + # configuration script. + RESOLUTIONS=$(echo "$1" | cut -d: -f2-) + + # Sanitate screen resolutions. + RESOLUTIONS=$(echo "${RESOLUTIONS}" \ + | sed -r 's!^ *!!g' \ + | sed -r 's!( |:|,|;) *! !g' \ + | sed -r 's! *$!!g') + + # Check sanitated screen resolutions. + if [[ "$RESOLUTIONS" == "" ]];then + cli_printMessage "`gettext "render_doIdentityImageGdm: There is no resolution information to process."`" + cli_printMessage $(caller) "AsToKnowMoreLine" + fi + + # Define release-specific directories we want to produce gdm for. + VERSIONS=$(find $OPTIONVAL -regextype posix-egrep \ + -maxdepth 1 -type d -regex "^.*/${RELEASE_FORMAT}$" \ + | egrep $REGEX) + + # Define directory where design models (e.g., GdmGreeterTheme.xml, + # GdmGreeterTheme.desktop) are stored. + TPL=/home/centos/artwork/trunk/Identity/Themes/Models/${THEMEMODEL}/Distro/BootUp/GDM/ + + # Define directory holding backgrounds. + BGS=/home/centos/artwork/trunk/Identity/Themes/Motifs/$(cli_getThemeName)/Backgrounds/Img + + # Define directory where temporal files are stored. + TMP=$(cli_getThemeName) + + # Define png image file used as CentOS symbol. We are using the + # symbol at 48x48 pixels. + SYMBOL=/home/centos/artwork/trunk/Identity/Brands/Img/CentOS/Symbol/5c-a/48.png + cli_checkFiles $SYMBOL 'f' + + for VERSION in $VERSIONS;do + + VERSION=$(basename $VERSION) + + # Define directory to store release-specific images. + IMG=$OPTIONVAL/$VERSION/Img + + # Define directory to store release-specific tar.gz files. + TGZ=$OPTIONVAL/$VERSION/Tgz + + # Check existence of release-specific directory. + cli_checkFiles $TGZ 'd' '' '--quiet' + if [[ $? -ne 0 ]];then + mkdir -p $TGZ + fi + + # Move into working directory. + pushd $TGZ > /dev/null + + for RESOLUTION in $RESOLUTIONS;do + + cli_printMessage "$TGZ/${TMP}-${RESOLUTION}.tar.gz" "AsCreatingLine" + + # Check background existence for specified resolution. + cli_checkFiles $BGS/$RESOLUTION.png 'f' '' '--quiet' + if [[ $? -ne 0 ]];then + cli_printMessage "`eval_gettext "There is not background for \\\$RESOLUTION resolution."`" + cli_printMessage "$(caller)" "AsToKnowMoreLine" + fi + + # Create temporal directory. + if [[ ! -d $TMP ]]; then + mkdir $TMP + fi + + # Copy gdm theme files into temporal directory. + cp $SYMBOL $TMP/centos-symbol.png + cp $IMG/release.png $TMP/centos-release.png + cp $IMG/screenshot.png $TMP/screenshot.png + cp $BGS/$RESOLUTION.png $TMP/background.png + cp $TPL/*.png $TMP/ + cp $TPL/GdmGreeterTheme.xml $TMP/${TMP}.xml + cp $TPL/GdmGreeterTheme.desktop $TMP/ + + # Translate markers from design model files. + sed -i "s!=THEME=!${TMP}!g" \ + $TMP/GdmGreeterTheme.desktop \ + $TMP/${TMP}.xml + + # Create tar.gz file. + tar -czf "${TMP}-${RESOLUTION}.tar.gz" $TMP + + # Remove temporal directory. + rm -r $TMP + + done + + # Return to where we were initially. + popd > /dev/null + + done + +} diff --git a/Scripts/Bash/Functions/Render/render_doIdentityImages.sh b/Scripts/Bash/Functions/Render/render_doIdentityImages.sh index 6a46bfd..d0a4a75 100644 --- a/Scripts/Bash/Functions/Render/render_doIdentityImages.sh +++ b/Scripts/Bash/Functions/Render/render_doIdentityImages.sh @@ -138,13 +138,14 @@ function render_doIdentityImages { render_doIdentityImageKsplash ;; + renderGdmTgz:* ) + render_doIdentityImageGdm "$ACTION" + ;; + groupByType:* ) render_doIdentityGroupByType "$ACTION" ;; - renderGdmTgz:* ) - render_doIdentityGdmTgz "$ACTION" - ;; esac diff --git a/Scripts/Bash/Functions/cli_getRepoName.sh b/Scripts/Bash/Functions/cli_getRepoName.sh index a986e21..3cf546c 100755 --- a/Scripts/Bash/Functions/cli_getRepoName.sh +++ b/Scripts/Bash/Functions/cli_getRepoName.sh @@ -3,7 +3,7 @@ # cli_getRepoName.sh -- This function sets naming convenction. Inside # CentOS Artowrk Repository, regular files are written in lower case # and directories are written in lower case but with the first letter -# in upper case. Use this function to sanitize the name of regular +# in upper case. Use this function to sanitate the name of regular # files and directories you work with. # # Copyright (C) 2009-2010 Alain Reguera Delgado