Blame Functions/Brand/brandAnaconda.sh

4c79b5
#!/bin/bash
4c79b5
#
4c79b5
# brandAnaconda - Anaconda branding script.
4c79b5
#
c28d1b
# Copyright (C) 2009-2011 Alain Reguera Delgado
4c79b5
# 
7cd8e9
# This program is free software; you can redistribute it and/or
7cd8e9
# modify it under the terms of the GNU General Public License as
7cd8e9
# published by the Free Software Foundation; either version 2 of the
7cd8e9
# License, or (at your option) any later version.
4c79b5
# 
4c79b5
# This program is distributed in the hope that it will be useful, but
4c79b5
# WITHOUT ANY WARRANTY; without even the implied warranty of
4c79b5
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4c79b5
# General Public License for more details.
4c79b5
#
4c79b5
# You should have received a copy of the GNU General Public License
4c79b5
# along with this program; if not, write to the Free Software
4c79b5
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
4c79b5
# USA.
4c79b5
# 
4c79b5
# ----------------------------------------------------------------------
418249
# $Id$
4c79b5
# ----------------------------------------------------------------------
4c79b5
4c79b5
function brandAnaconda {
4c79b5
4c79b5
   # Define file's source and target.
fe1b62
   local ARTDIR=~/artwork/trunk/Identity/Themes/$(cli_getPathComponent '--theme')/Distro/Anaconda
4c79b5
   local PIXMAP=/usr/share/anaconda/pixmaps
4c79b5
   local SOURCE=''
4c79b5
   local TARGET=''
4c79b5
4c79b5
   # Define list of files used as base to determine which files may
4c79b5
   # need to be updated.  Remove target from file path. Do not use
4c79b5
   # basename command. We may need the directory structure (if any)
4c79b5
   # under target, for further evaluation.
4c79b5
   local FILES=$(find ${PIXMAP}/ | sort | uniq | sed "s!${PIXMAP}/!!g")
4c79b5
   local FILE=''
4c79b5
4c79b5
   for FILE in $FILES;do
4c79b5
4c79b5
      # Define which file is release-specific, and specify the correct
4c79b5
      # path on source.
4c79b5
      case $FILE in
4c79b5
         anaconda_header.png )
4c79b5
         SOURCE=$ARTDIR/Header/Img/$MAJOR_RELEASE/$FILE 
4c79b5
         TARGET=$PIXMAP/$FILE
4c79b5
         ;;
4c79b5
4c79b5
         progress_first*.png | first*.png )
4c79b5
         SOURCE=$ARTDIR/Progress/Img/$MAJOR_RELEASE/$FILE
4c79b5
         TARGET=$PIXMAP/$FILE
4c79b5
         ;;
4c79b5
4c79b5
         rnotes | rnotes/?? | rnotes/??_?? )
4c79b5
         continue
4c79b5
         ;;
4c79b5
4c79b5
         rnotes/??-*.png )
4c79b5
         FILE=$(basename $FILE | sed -r 's!-centos[0-9]+!!')
4c79b5
         SOURCE=$ARTDIR/Progress/Img/$MAJOR_RELEASE/en/$FILE
4c79b5
         TARGET=$PIXMAP/rnotes/$FILE
4c79b5
         ;;
4c79b5
4c79b5
         rnotes/*/??-*.png )
4c79b5
         LANGUAGE=$(echo $FILE | sed -r 's!rnotes/(.+)/.*!\1!')
4c79b5
         FILE=$(basename $FILE | sed -r 's!-centos[0-9]+!!')
4c79b5
         SOURCE=$ARTDIR/Progress/Img/$MAJOR_RELEASE/$LANGUAGE/$FILE
4c79b5
         TARGET=$PIXMAP/rnotes/$LANGUAGE/$FILE
4c79b5
         ;;
4c79b5
4c79b5
         splash.png )
4c79b5
         SOURCE=$ARTDIR/Splash/Img/$MAJOR_RELEASE/$FILE
4c79b5
         TARGET=$PIXMAP/$FILE
4c79b5
         ;;
4c79b5
4c79b5
         syslinux-splash.png )
4c79b5
         TARGET=$PIXMAP/$FILE
4c79b5
         FILE=$(echo $FILE | sed -r 's!\.png$!-16c.png!')
4c79b5
         SOURCE=$ARTDIR/Prompt/Img/$MAJOR_RELEASE/$FILE
4c79b5
         ;;
4c79b5
4c79b5
         * )
4c79b5
         TARGET=$PIXMAP/$FILE
4c79b5
         SOURCE=$ARTDIR/$FILE
4c79b5
      esac
4c79b5
4c79b5
      # Check if file exists on source. If file doesn't exist on the
4c79b5
      # source it is not updated on target. Go to next file in the
4c79b5
      # loop and check again. Only file names on source that match
4c79b5
      # those in target are updated.
4c79b5
      cli_checkFiles "$SOURCE"
4c79b5
   
4c79b5
      # File exists and will be installed on target.
4c79b5
      cli_printMessage "$TARGET" "AsUpdatingLine"
4c79b5
4c79b5
      # Update file.
4c79b5
      #cp $SOURCE $TARGET
4c79b5
4c79b5
      # Set file's access rights.
4c79b5
      #chown root:root $TARGET
4c79b5
      #chmod 755 $TARGET
4c79b5
      #chcon system_u:object_r:usr_t $TARGET
4c79b5
4c79b5
done
4c79b5
}