Sophie

Sophie

distrib > Mageia > 7 > i586 > media > core-release > by-pkgid > 98bdc9a654d0d3007f1d2bb1027737fb > scriptlet

grub2-mageia-theme-2.02.0-15.mga7.noarch.rpm

POSTIN

/bin/sh
# Don't install if updating
if [ $1 -eq 1 ] ; then
# Remove trailing blank lines from /etc/default/grub
sed -i -e :a -e '/^\n*$/{$d;N;};/\n$/ba' /etc/default/grub
# Check that /etc/default/grub ends in a linefeed
[ "$(tail -n 1 /etc/default/grub | wc --lines)" = "1" ] || echo >> /etc/default/grub
# Add theme
echo "GRUB_THEME=/boot/grub2/themes/maggy/theme.txt" >> /etc/default/grub

# If installing theme outside installer then update menu 
if [ "x${DURING_INSTALL}" != "x1" ]; then
grub2-mkconfig -o /boot/grub2/grub.cfg && rm -f /boot/grub2/grub.cfg.rpmsave
fi
fi

# Copy system default background at correct aspect ratio to grub2 default theme
if [ -h /usr/share/mga/backgrounds/default.png ] && [ "$DURING_INSTALL" != "1" ]; then
cp -f /usr/share/mga/backgrounds/default.png /boot/grub2/themes/grub2-mageia-default.png
fi

POSTUN

/bin/sh
# Only if uninstalling theme
if [ $1 -eq 0 ]; then
# Remove theme from config
sed -i '/GRUB_THEME=\/boot\/grub2\/themes\/maggy\/theme.txt/d' /etc/default/grub
fi

Triggers

grub2-mageia-theme < 2.02-0.git10463.5.mga6

/bin/sh
# Run install.sh to replace /boot/grub2/fonts/unicode.pf2
   if [ -f /boot/grub2/install.sh -a -x /usr/sbin/detectloader ] && [ "$DURING_INSTALL" != "1" ]; then
		LOADER=$(/usr/sbin/detectloader)
		[ "$LOADER" = "GRUB2" ] && /boot/grub2/install.sh ||:
   fi

# If updating from below 2.02-0.git10101.4 then re-make grub.cfg once.
# grub2 dropped ownership of grub.cfg to avoid rpmnew being created.
# Remove rpmnew and after new grub.cfg is created remove rpmsave. Mga#17263