]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[plymouth-set-default-theme] handle old symlink configuration file
authorFrederic Crozat <fcrozat@mandriva.com>
Wed, 24 Mar 2010 21:03:50 +0000 (17:03 -0400)
committerFrederic Crozat <fcrozat@mandriva.com>
Thu, 25 Mar 2010 16:30:41 +0000 (17:30 +0100)
scripts/plymouth-set-default-theme.in

index dd0b915a00a8eac55d5e54de38be85288ba42161..e85119f6d5103f1d95d1b3c562607a7737ae3d75 100755 (executable)
@@ -58,10 +58,14 @@ function read_theme_name_from_file ()
 
 function get_default_theme ()
 {
-        THEME_NAME=$(read_theme_name_from_file ${PLYMOUTH_CONFDIR}/plymouthd.conf)
-        if [ -z "$THEME_NAME" ]; then
-                THEME_NAME=$(read_theme_name_from_file ${PLYMOUTH_POLICYDIR}/plymouthd.defaults)
+       THEME_NAME=$(read_theme_name_from_file ${PLYMOUTH_CONFDIR}/plymouthd.conf)
+       if [ -z "$THEME_NAME" -o ! -r "${PLYMOUTH_DATADIR}/plymouth/themes/$THEME_NAME/$THEME_NAME.plymouth" ]; then
+               THEME_NAME=$(read_theme_name_from_file ${PLYMOUTH_POLICYDIR}/plymouthd.defaults)
         fi
+
+       if [ -z "$THEME_NAME" -o ! -r "${PLYMOUTH_DATADIR}/plymouth/themes/$THEME_NAME/$THEME_NAME.plymouth" ]; then
+               THEME_NAME=$(basename $(readlink ${PLYMOUTH_DATADIR}/plymouth/themes/default.plymouth) .plymouth)
+       fi
         [ -z "$THEME_NAME" ] || echo $THEME_NAME && exit 1
 }
 
@@ -176,6 +180,8 @@ if [ ! -e ${PLYMOUTH_PLUGIN_PATH}${MODULE_NAME}.so ]; then
         exit 1
 fi
 
+[ -L ${PLYMOUTH_DATADIR}/plymouth/themes/default.plymouth ] && rm -f ${PLYMOUTH_DATADIR}/plymouth/themes/default.plymouth
+
 [ -d ${PLYMOUTH_CONFDIR} ] || mkdir -p ${PLYMOUTH_CONFDIR}
 grep -q '^[[]Daemon[]]' ${PLYMOUTH_CONFDIR}/plymouthd.conf 2> /null || echo '[Daemon]' >> ${PLYMOUTH_CONFDIR}/plymouthd.conf
 sed -i -e '/^Theme[[:blank:]]*=.*/d' ${PLYMOUTH_CONFDIR}/plymouthd.conf