- Ensure upgrade-only section of fonts-base rpm post script only executes

on upgrades using -gt instead of -ge.
This commit is contained in:
mharris 2006-03-04 11:04:29 +00:00
parent b66234b2c3
commit e1ee338eb8

View File

@ -30,7 +30,7 @@
Summary: X.Org X11 fonts
Name: xorg-x11-fonts
Version: 7.0
Release: 2
Release: 3
License: Various licenses
Group: User Interface/X
URL: http://www.x.org
@ -495,7 +495,38 @@ done
%post base
{
FONTDIR=%{_x11fontdir}/misc
ENCODINGSDIR=%{_datadir}/X11/fonts/encodings
XFSCONFIG=/etc/X11/fs/config
#-------------------------------------------------------------------
# Upgrade section - during upgrades only
if [ "$1" -gt "1" ] ; then
# Remove the Speedo directory from xfs config as X.Org no longer provides
# Speedo font support.
/usr/sbin/chkfontpath -qr %{_x11fontdir}/Speedo
# NOTE: Remove the non :unscaled version of misc font directory from
# configuration to undo a temporary workaround that was added in 0.99.0-5
# XFS config file upgrade munging
if [ -f $XFSCONFIG ] ; then
# FIXME: chkfontpath is broken, and removes both misc and misc:unscaled
# /usr/sbin/chkfontpath -qr %{_x11fontdir}/misc
# On upgrades, remove 'misc' without :unscaled from the XFS config
# file to avoid ugly scaled bitmap fonts. chkfontpath can't be used
# as it is buggy and will remove the :unscaled entry also.
if grep -q "%{_x11fontdir}/misc," $XFSCONFIG &> /dev/null ; then
for fpe in misc ; do
sed -ie "\#^.*%{_x11fontdir}/${fpe},.*#d" $XFSCONFIG
done
fi
fi
fi
#-------------------------------------------------------------------
# Both installs and upgrades
# Generate the encodings.dir files in the encodings directories during
# install time to work around bugs in upstream Makefiles. This is more
# consistent with how we generate fonts.dir files anyway. Fixes bugs:
@ -509,35 +540,9 @@ done
done
}
FONTDIR=%{_x11fontdir}/misc
mkfontdir $FONTDIR
# NOTE: We add the ":unscaled" suffix to avoid ugly bitmap fonts.
/usr/sbin/chkfontpath -qa %{_x11fontdir}/misc:unscaled
if [ "$1" -ge "1" ] ; then
# Remove the Speedo directory from xfs config as X.Org no longer provides
# Speedo font support.
/usr/sbin/chkfontpath -qr %{_x11fontdir}/Speedo
# NOTE: Remove the non :unscaled version of misc font directory from
# configuration to undo a temporary workaround that was added in 0.99.0-5
XFSCONFIG=/etc/X11/fs/config
# XFS config file upgrade munging
if [ -f $XFSCONFIG ] ; then
# On upgrades, remove 'misc' without :unscaled from the XFS config
# file to avoid ugly scaled bitmap fonts. chkfontpath can't be used
# as it is buggy and will remove the :unscaled entry also.
if grep -q "%{_x11fontdir}/misc," $XFSCONFIG &> /dev/null ; then
for fpe in misc ; do
sed -ie "\#^.*%{_x11fontdir}/${fpe},.*#d" $XFSCONFIG
done
fi
fi
fi
# FIXME: chkfontpath is broken, and removes both misc and misc:unscaled
# /usr/sbin/chkfontpath -qr %{_x11fontdir}/misc
fc-cache $FONTDIR
}
# || :
@ -1523,6 +1528,10 @@ rm -rf $RPM_BUILD_ROOT
%ghost %verify(not md5 size mtime) %{_x11fontdir}/cyrillic/fonts.cache-*
%changelog
* Sat Mar 04 2006 Mike A. Harris <mharris@redhat.com> 7.0-3
- Ensure upgrade-only section of fonts-base rpm post script only executes on
upgrades using -gt instead of -ge.
* Fri Feb 24 2006 Mike A. Harris <mharris@redhat.com> 7.0-2
- Generate encodings.dir files in the encodings dirs with mkfontscale from the
base fonts package post install script, to work around bug (#173875)