# Update the desktop database:
if [ -x usr/bin/update-desktop-database ]; then
  chroot . /usr/bin/update-desktop-database usr/share/applications > /dev/null
2>&1
fi

# Update hicolor theme cache:
if [ -d usr/share/icons/hicolor ]; then
  if [ -x /usr/bin/gtk-update-icon-cache ]; then
    chroot . /usr/bin/gtk-update-icon-cache -f -t usr/share/icons/hicolor 1> /dev/null 2> /dev/null
  fi
fi

# Update the mime database:
if [ -x usr/bin/update-mime-database ]; then
  chroot . /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
fi

# Remove old cache data and regenerate the file:
chroot . <<EOCR 2>/dev/null
cd /usr/lib64/vlc
find . -name "plugins*.dat" -exec rm -f {} \;
echo "Generating VLC plugins cache data..."
DISPLAY="" ./vlc-cache-gen -f .
EOCR

( cd usr/share/vlc/projectM/fonts ; rm -rf VeraMono.ttf )
( cd usr/share/vlc/projectM/fonts ; ln -sf /usr/share/fonts/TTF/DejaVuSansMono.ttf VeraMono.ttf )
( cd usr/share/vlc/projectM/fonts ; rm -rf Vera.ttf )
( cd usr/share/vlc/projectM/fonts ; ln -sf /usr/share/fonts/TTF/DejaVuSans.ttf Vera.ttf )
( cd usr/lib64 ; rm -rf libvlc.so.5 )
( cd usr/lib64 ; ln -sf libvlc.so.5.5.1 libvlc.so.5 )
( cd usr/lib64/vlc ; rm -rf libvlc_vdpau.so )
( cd usr/lib64/vlc ; ln -sf libvlc_vdpau.so.0.0.0 libvlc_vdpau.so )
( cd usr/lib64/vlc ; rm -rf libvlc_vdpau.so.0 )
( cd usr/lib64/vlc ; ln -sf libvlc_vdpau.so.0.0.0 libvlc_vdpau.so.0 )
( cd usr/lib64 ; rm -rf libvlccore.so )
( cd usr/lib64 ; ln -sf libvlccore.so.8.0.1 libvlccore.so )
( cd usr/lib64 ; rm -rf libvlccore.so.8 )
( cd usr/lib64 ; ln -sf libvlccore.so.8.0.1 libvlccore.so.8 )
( cd usr/lib64 ; rm -rf libvlc.so )
( cd usr/lib64 ; ln -sf libvlc.so.5.5.1 libvlc.so )
