Sophie

Sophie

distrib > Fedora > 14 > i386 > by-pkgid > 5b55f899f3880b6230de916e6000b6f6 > scriptlet

xorg-x11-xfs-1.0.5-8.fc14.i686.rpm

PREIN

/bin/sh
{
  /usr/sbin/useradd -c "X Font Server" -r -s /sbin/nologin -u 43 -d /etc/X11/fs xfs || :
  # Upgrade path:
  if [ "$1" -gt "1" ] ; then
    if [ -e "/usr/X11R6/lib/X11/fs/config" ] ; then
      cat <<-EOF > "/etc/X11/fs/xfs-migrate"
	On upgrades, we now must determine if we are upgrading from monolithic
	xfs or modular xfs by checking for the existance of the old monolithic
	xfs config file.  If found, we know it is a monolith->modular upgrade,
	so we set this flag file in order for xfs.init to perform a "restart"
	instead of a "reload" in the 'condrestart'.  See bug #173271 for
	details.
EOF
    fi
  fi
} &> /dev/null || : # Silence output, and ignore errors (Bug #91822)

PREUN

/bin/sh
{
  if [ "$1" = "0" ]; then
    /sbin/service xfs stop &> /dev/null || :
# FIXME: The chkconfig call below works properly if uninstalling the package,
#        but it will cause xfs to be de-chkconfig'd if upgrading from one X11
#        implementation to another, as witnessed in the transition from
#        XFree86 to Xorg X11.  If this call is removed however, then xfs will
#        remain visible in ntsysv and similar utilities even after xfs is
#        uninstalled from the system in non-upgrade scenarios.  Not sure how
#        to fix this yet.
    /sbin/chkconfig --del xfs || :
# userdel/groupdel removed because they cause the user/group to get destroyed
# when upgrading from one X11 implementation to another, ie: XFree86 -> Xorg
#    /usr/sbin/userdel xfs 2>/dev/null || :
#    /usr/sbin/groupdel xfs 2>/dev/null || :
  fi
}

POSTIN

/bin/sh
{
  # Install section
  /sbin/chkconfig --add xfs
  #------------------------------------------------------------------------
  # Upgrade section
  if [ "$1" -gt "1" ] ; then
    XORG_CONFIG=/etc/X11/xorg.conf
    XFSCONFIG=/etc/X11/fs/config

    # XFS config file upgrade munging
    if [ -f $XFSCONFIG ] ; then
      # Remove Speedo font directories from xfs config if present to avoid
      # bug reports about xfs complaining about empty directories in syslog.
      perl -p -i -e 's#^.*/.*/Speedo.*\n##' $XFSCONFIG

      # On upgrades, remove /usr/X11R6 font path elements from the XFS config file
      if grep -q "/usr/X11R6/lib/X11/fonts" $XFSCONFIG &> /dev/null ; then
        for fpe in misc:unscaled 75dpi:unscaled 100dpi:unscaled Type1 ; do
          perl -p -i -e "s#/usr/X11R6/lib/X11/fonts/${fpe}#%{_x11fontdir}/${fpe}#g" $XFSCONFIG
        done
      fi
    fi
  fi ; # End Upgrade section
}

POSTUN

/bin/sh
{
  if [ "$1" -gt "1" ]; then
    /sbin/service xfs condrestart &> /dev/null || :
  fi
}