chroot . /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas/ > /dev/null 2>&1
chroot . /usr/bin/gio-querymodules /usr/lib64/gio/modules/ > /dev/null 2>&1
config() {
  NEW="$1"
  OLD="$(dirname $NEW)/$(basename $NEW .new)"
  # If there's no config file by that name, mv it over:
  if [ ! -r $OLD ]; then
    mv $NEW $OLD
  elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
    # toss the redundant copy
    rm $NEW
  fi
  # Otherwise, we leave the .new copy for the admin to consider...
}
config etc/xdg/autostart/pulseaudio.desktop.new
config etc/dbus-1/system.d/pulseaudio-system.conf.new
config etc/pulse/client.conf.new
config etc/pulse/system.pa.new
config etc/pulse/default.pa.new
config etc/pulse/daemon.conf.new
( cd usr/bin ; rm -rf pamon )
( cd usr/bin ; ln -sf pacat pamon )
( cd usr/bin ; rm -rf paplay )
( cd usr/bin ; ln -sf pacat paplay )
( cd usr/bin ; rm -rf parec )
( cd usr/bin ; ln -sf pacat parec )
( cd usr/bin ; rm -rf parecord )
( cd usr/bin ; ln -sf pacat parecord )
( cd usr/lib64 ; rm -rf libpulse-mainloop-glib.so )
( cd usr/lib64 ; ln -sf libpulse-mainloop-glib.so.0.0.5 libpulse-mainloop-glib.so )
( cd usr/lib64 ; rm -rf libpulse-mainloop-glib.so.0 )
( cd usr/lib64 ; ln -sf libpulse-mainloop-glib.so.0.0.5 libpulse-mainloop-glib.so.0 )
( cd usr/lib64 ; rm -rf libpulse-simple.so )
( cd usr/lib64 ; ln -sf libpulse-simple.so.0.1.1 libpulse-simple.so )
( cd usr/lib64 ; rm -rf libpulse-simple.so.0 )
( cd usr/lib64 ; ln -sf libpulse-simple.so.0.1.1 libpulse-simple.so.0 )
( cd usr/lib64 ; rm -rf libpulse.so )
( cd usr/lib64 ; ln -sf libpulse.so.0.20.3 libpulse.so )
( cd usr/lib64 ; rm -rf libpulse.so.0 )
( cd usr/lib64 ; ln -sf libpulse.so.0.20.3 libpulse.so.0 )
( cd usr/man/man1 ; rm -rf pamon.1 )
( cd usr/man/man1 ; ln -sf pacat.1 pamon.1 )
( cd usr/man/man1 ; rm -rf paplay.1 )
( cd usr/man/man1 ; ln -sf pacat.1 paplay.1 )
( cd usr/man/man1 ; rm -rf parec.1 )
( cd usr/man/man1 ; ln -sf pacat.1 parec.1 )
( cd usr/man/man1 ; rm -rf parecord.1 )
( cd usr/man/man1 ; ln -sf pacat.1 parecord.1 )
( cd usr/share/bash-completion/completions ; rm -rf pacat )
( cd usr/share/bash-completion/completions ; ln -sf pulseaudio pacat )
( cd usr/share/bash-completion/completions ; rm -rf pacmd )
( cd usr/share/bash-completion/completions ; ln -sf pulseaudio pacmd )
( cd usr/share/bash-completion/completions ; rm -rf pactl )
( cd usr/share/bash-completion/completions ; ln -sf pulseaudio pactl )
( cd usr/share/bash-completion/completions ; rm -rf padsp )
( cd usr/share/bash-completion/completions ; ln -sf pulseaudio padsp )
( cd usr/share/bash-completion/completions ; rm -rf paplay )
( cd usr/share/bash-completion/completions ; ln -sf pulseaudio paplay )
( cd usr/share/bash-completion/completions ; rm -rf parec )
( cd usr/share/bash-completion/completions ; ln -sf pulseaudio parec )
( cd usr/share/bash-completion/completions ; rm -rf parecord )
( cd usr/share/bash-completion/completions ; ln -sf pulseaudio parecord )
( cd usr/share/bash-completion/completions ; rm -rf pasuspender )
( cd usr/share/bash-completion/completions ; ln -sf pulseaudio pasuspender )
