Blame Scripts/Functions/Brand/brandAnaconda.sh

4c79b5
#!/bin/bash
4c79b5
#
4c79b5
# brandAnaconda - Anaconda branding script.
4c79b5
#
2d3646
# Copyright (C) 2009, 2010, 2011 The CentOS Project
fa95b1
#
fa95b1
# This program is free software; you can redistribute it and/or modify
fa95b1
# it under the terms of the GNU General Public License as published by
dcd347
# the Free Software Foundation; either version 2 of the License, or (at
dcd347
# your option) any later version.
fa95b1
#
74a058
# This program is distributed in the hope that it will be useful, but
74a058
# 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
dcd347
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
7ac5a5
#
4c79b5
# ----------------------------------------------------------------------
418249
# $Id$
4c79b5
# ----------------------------------------------------------------------
4c79b5
4c79b5
function brandAnaconda {
4c79b5
4c79b5
   # Define file's source and target.
c23c37
   local ARTDIR=$(cli_getRepoTLDir $ACTIONVAL)/Identity/Images/Themes/$(cli_getPathComponent $ACTIONVAL --motif)/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.
1895cf
      cli_printMessage "$TARGET" --as-updating-line
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
}