#!/bin/bash
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 [ "$( md5sum < $OLD )" = "$( md5sum < $NEW )" ]; then # toss the redundant copy
    rm $NEW
  fi
  # Otherwise, we leave the .new copy for the admin to consider...
}

config etc/asciidoc/lang-el.conf.new
config etc/asciidoc/lang-pt-BR.conf.new
config etc/asciidoc/latex.conf.new
config etc/asciidoc/xhtml11.conf.new
config etc/asciidoc/lang-cs.conf.new
config etc/asciidoc/help.conf.new
config etc/asciidoc/lang-ca.conf.new
config etc/asciidoc/xhtml11-quirks.conf.new
config etc/asciidoc/lang-id.conf.new
config etc/asciidoc/html5.conf.new
config etc/asciidoc/lang-de.conf.new
config etc/asciidoc/docbook5.conf.new
config etc/asciidoc/filters/source/source-highlight-filter.conf.new
config etc/asciidoc/filters/code/code-filter.conf.new
config etc/asciidoc/filters/music/music-filter.conf.new
config etc/asciidoc/filters/graphviz/graphviz-filter.conf.new
config etc/asciidoc/filters/latex/latex-filter.conf.new
config etc/asciidoc/lang-sv.conf.new
config etc/asciidoc/html4.conf.new
config etc/asciidoc/lang-hu.conf.new
config etc/asciidoc/lang-fi.conf.new
config etc/asciidoc/lang-uk.conf.new
config etc/asciidoc/asciidoc.conf.new
config etc/asciidoc/slidy.conf.new
config etc/asciidoc/lang-es.conf.new
config etc/asciidoc/lang-ro.conf.new
config etc/asciidoc/lang-nl.conf.new
config etc/asciidoc/text.conf.new
config etc/asciidoc/lang-ja.conf.new
config etc/asciidoc/lang-fr.conf.new
config etc/asciidoc/lang-zh-CN.conf.new
config etc/asciidoc/lang-en.conf.new
config etc/asciidoc/lang-pl.conf.new
config etc/asciidoc/lang-ru.conf.new
config etc/asciidoc/docbook45.conf.new
config etc/asciidoc/lang-it.conf.new
( cd usr/bin ; rm -rf a2x )
( cd usr/bin ; ln -sf a2x.py a2x )
( cd usr/bin ; rm -rf asciidoc )
( cd usr/bin ; ln -sf asciidoc.py asciidoc )
( cd usr/bin ; rm -rf db2dvi )
( cd usr/bin ; ln -sf docbook2dvi db2dvi )
( cd usr/bin ; rm -rf db2html )
( cd usr/bin ; ln -sf docbook2html db2html )
( cd usr/bin ; rm -rf db2pdf )
( cd usr/bin ; ln -sf docbook2pdf db2pdf )
( cd usr/bin ; rm -rf db2ps )
( cd usr/bin ; ln -sf docbook2ps db2ps )
( cd usr/bin ; rm -rf db2rtf )
( cd usr/bin ; ln -sf docbook2rtf db2rtf )
( cd usr/bin ; rm -rf jade )
( cd usr/bin ; ln -sf openjade jade )
( cd usr/bin ; rm -rf nsgmls )
( cd usr/bin ; ln -sf onsgmls nsgmls )
( cd usr/bin ; rm -rf osx )
( cd usr/bin ; ln -sf osgml2xml osx )
( cd usr/bin ; rm -rf sgml2html )
( cd usr/bin ; ln -sf linuxdoc sgml2html )
( cd usr/bin ; rm -rf sgml2info )
( cd usr/bin ; ln -sf linuxdoc sgml2info )
( cd usr/bin ; rm -rf sgml2latex )
( cd usr/bin ; ln -sf linuxdoc sgml2latex )
( cd usr/bin ; rm -rf sgml2lyx )
( cd usr/bin ; ln -sf linuxdoc sgml2lyx )
( cd usr/bin ; rm -rf sgml2rtf )
( cd usr/bin ; ln -sf linuxdoc sgml2rtf )
( cd usr/bin ; rm -rf sgml2txt )
( cd usr/bin ; ln -sf linuxdoc sgml2txt )
( cd usr/bin ; rm -rf sgml2xml )
( cd usr/bin ; ln -sf osgml2xml sgml2xml )
( cd usr/bin ; rm -rf sgmlcheck )
( cd usr/bin ; ln -sf linuxdoc sgmlcheck )
( cd usr/bin ; rm -rf sgmlnorm )
( cd usr/bin ; ln -sf osgmlnorm sgmlnorm )
( cd usr/bin ; rm -rf spam )
( cd usr/bin ; ln -sf ospam spam )
( cd usr/bin ; rm -rf spent )
( cd usr/bin ; ln -sf ospent spent )
( cd usr/lib ; rm -rf libgrove.so )
( cd usr/lib ; ln -sf libogrove.so libgrove.so )
( cd usr/lib ; rm -rf libogrove.so )
( cd usr/lib ; ln -sf libogrove.so.0.0.1 libogrove.so )
( cd usr/lib ; rm -rf libogrove.so.0 )
( cd usr/lib ; ln -sf libogrove.so.0.0.1 libogrove.so.0 )
( cd usr/lib ; rm -rf libosp.so )
( cd usr/lib ; ln -sf libosp.so.5.0.0 libosp.so )
( cd usr/lib ; rm -rf libosp.so.5 )
( cd usr/lib ; ln -sf libosp.so.5.0.0 libosp.so.5 )
( cd usr/lib ; rm -rf libospgrove.so )
( cd usr/lib ; ln -sf libospgrove.so.0.0.1 libospgrove.so )
( cd usr/lib ; rm -rf libospgrove.so.0 )
( cd usr/lib ; ln -sf libospgrove.so.0.0.1 libospgrove.so.0 )
( cd usr/lib ; rm -rf libostyle.so )
( cd usr/lib ; ln -sf libostyle.so.0.0.1 libostyle.so )
( cd usr/lib ; rm -rf libostyle.so.0 )
( cd usr/lib ; ln -sf libostyle.so.0.0.1 libostyle.so.0 )
( cd usr/lib ; rm -rf libsp.so )
( cd usr/lib ; ln -sf libosp.so libsp.so )
( cd usr/lib ; rm -rf libspgrove.so )
( cd usr/lib ; ln -sf libospgrove.so libspgrove.so )
( cd usr/lib ; rm -rf libstyle.so )
( cd usr/lib ; ln -sf libostyle.so libstyle.so )
( cd usr/man/man1 ; rm -rf db2dvi.1.gz )
( cd usr/man/man1 ; ln -sf jw.1.gz db2dvi.1.gz )
( cd usr/man/man1 ; rm -rf db2html.1.gz )
( cd usr/man/man1 ; ln -sf jw.1.gz db2html.1.gz )
( cd usr/man/man1 ; rm -rf db2pdf.1.gz )
( cd usr/man/man1 ; ln -sf jw.1.gz db2pdf.1.gz )
( cd usr/man/man1 ; rm -rf db2ps.1.gz )
( cd usr/man/man1 ; ln -sf jw.1.gz db2ps.1.gz )
( cd usr/man/man1 ; rm -rf db2rtf.1.gz )
( cd usr/man/man1 ; ln -sf jw.1.gz db2rtf.1.gz )
( cd usr/man/man1 ; rm -rf docbook2dvi.1.gz )
( cd usr/man/man1 ; ln -sf jw.1.gz docbook2dvi.1.gz )
( cd usr/man/man1 ; rm -rf docbook2html.1.gz )
( cd usr/man/man1 ; ln -sf jw.1.gz docbook2html.1.gz )
( cd usr/man/man1 ; rm -rf docbook2man.1.gz )
( cd usr/man/man1 ; ln -sf jw.1.gz docbook2man.1.gz )
( cd usr/man/man1 ; rm -rf docbook2pdf.1.gz )
( cd usr/man/man1 ; ln -sf jw.1.gz docbook2pdf.1.gz )
( cd usr/man/man1 ; rm -rf docbook2ps.1.gz )
( cd usr/man/man1 ; ln -sf jw.1.gz docbook2ps.1.gz )
( cd usr/man/man1 ; rm -rf docbook2rtf.1.gz )
( cd usr/man/man1 ; ln -sf jw.1.gz docbook2rtf.1.gz )
( cd usr/man/man1 ; rm -rf docbook2tex.1.gz )
( cd usr/man/man1 ; ln -sf jw.1.gz docbook2tex.1.gz )
( cd usr/man/man1 ; rm -rf docbook2texi.1.gz )
( cd usr/man/man1 ; ln -sf jw.1.gz docbook2texi.1.gz )
( cd usr/man/man1 ; rm -rf jade.1.gz )
( cd usr/man/man1 ; ln -sf openjade.1.gz jade.1.gz )
( cd usr/share/entity-map/0.1.0 ; rm -rf GFextra.2l1b )
( cd usr/share/entity-map/0.1.0 ; ln -sf GFextra.2ab GFextra.2l1b )
( cd usr/share/entity-map/0.1.0 ; rm -rf GFextra.2l1s )
( cd usr/share/entity-map/0.1.0 ; ln -sf GFextra.2as GFextra.2l1s )
( cd usr/share/entity-map/0.1.0 ; rm -rf GFextra.2rtf )
( cd usr/share/entity-map/0.1.0 ; ln -sf GFextra.2ab GFextra.2rtf )
( cd usr/share/entity-map/0.1.0 ; rm -rf GFextra.2u8b )
( cd usr/share/entity-map/0.1.0 ; ln -sf GFextra.2ab GFextra.2u8b )
( cd usr/share/entity-map/0.1.0 ; rm -rf ISOdia.2l1b )
( cd usr/share/entity-map/0.1.0 ; ln -sf ISOdia.2ab ISOdia.2l1b )
( cd usr/share/entity-map/0.1.0 ; rm -rf ISOdia.2l1s )
( cd usr/share/entity-map/0.1.0 ; ln -sf ISOdia.2as ISOdia.2l1s )
( cd usr/share/entity-map/0.1.0 ; rm -rf ISOdia.2l1tr )
( cd usr/share/entity-map/0.1.0 ; ln -sf ISOdia.2tr ISOdia.2l1tr )
( cd usr/share/entity-map/0.1.0 ; rm -rf ISOdia.2rtf )
( cd usr/share/entity-map/0.1.0 ; ln -sf ISOdia.2ab ISOdia.2rtf )
( cd usr/share/entity-map/0.1.0 ; rm -rf ISOdia.2texi )
( cd usr/share/entity-map/0.1.0 ; ln -sf ISOdia.2ab ISOdia.2texi )
( cd usr/share/entity-map/0.1.0 ; rm -rf ISOdia.2u8b )
( cd usr/share/entity-map/0.1.0 ; ln -sf ISOdia.2ab ISOdia.2u8b )
( cd usr/share/entity-map/0.1.0 ; rm -rf ISOlat1.2l1s )
( cd usr/share/entity-map/0.1.0 ; ln -sf ISOlat1.2l1b ISOlat1.2l1s )
( cd usr/share/entity-map/0.1.0 ; rm -rf ISOlat1.2l1tr )
( cd usr/share/entity-map/0.1.0 ; ln -sf ISOlat1.2l1b ISOlat1.2l1tr )
( cd usr/share/entity-map/0.1.0 ; rm -rf ISOlat1.2rtf )
( cd usr/share/entity-map/0.1.0 ; ln -sf ISOlat1.2ab ISOlat1.2rtf )
( cd usr/share/entity-map/0.1.0 ; rm -rf ISOlat1.2texi )
( cd usr/share/entity-map/0.1.0 ; ln -sf ISOlat1.2ab ISOlat1.2texi )
( cd usr/share/entity-map/0.1.0 ; rm -rf ISOlat1.2tr )
( cd usr/share/entity-map/0.1.0 ; ln -sf ISOlat1.2ab ISOlat1.2tr )
( cd usr/share/entity-map/0.1.0 ; rm -rf ISOlat1.2u8s )
( cd usr/share/entity-map/0.1.0 ; ln -sf ISOlat1.2u8b ISOlat1.2u8s )
( cd usr/share/entity-map/0.1.0 ; rm -rf ISOlat1.2u8tr )
( cd usr/share/entity-map/0.1.0 ; ln -sf ISOlat1.2u8b ISOlat1.2u8tr )
( cd usr/share/entity-map/0.1.0 ; rm -rf ISOlat2.2l1b )
( cd usr/share/entity-map/0.1.0 ; ln -sf ISOlat2.2ab ISOlat2.2l1b )
( cd usr/share/entity-map/0.1.0 ; rm -rf ISOlat2.2l1s )
( cd usr/share/entity-map/0.1.0 ; ln -sf ISOlat2.2as ISOlat2.2l1s )
( cd usr/share/entity-map/0.1.0 ; rm -rf ISOpub.2l1tr )
( cd usr/share/entity-map/0.1.0 ; ln -sf ISOpub.2tr ISOpub.2l1tr )
( cd usr/share/entity-map/0.1.0 ; rm -rf ISOtech.2l1tr )
( cd usr/share/entity-map/0.1.0 ; ln -sf ISOtech.2tr ISOtech.2l1tr )
( cd usr/share/entity-map/0.1.0 ; rm -rf LDextra.2l1tr )
( cd usr/share/entity-map/0.1.0 ; ln -sf LDextra.2tr LDextra.2l1tr )
( cd usr/share/linuxdoc-tools/dtd ; rm -rf linuxdoc.dtd )
( cd usr/share/linuxdoc-tools/dtd ; ln -sf linuxdoc96.dtd linuxdoc.dtd )
( cd usr/share/linuxdoc-tools/dtd ; rm -rf linuxdoctr.dtd )
( cd usr/share/linuxdoc-tools/dtd ; ln -sf linuxdoctr96.dtd linuxdoctr.dtd )
( cd usr/share/linuxdoc-tools/mappings/latin1 ; rm -rf mapping )
( cd usr/share/linuxdoc-tools/mappings/latin1 ; ln -sf ../groff/mapping mapping )
( cd usr/share/linuxdoc-tools/mappings/nippon ; rm -rf mapping )
( cd usr/share/linuxdoc-tools/mappings/nippon ; ln -sf ../groff/tr-mapping mapping )
( cd usr/share/xml/docbook/stylesheet ; rm -rf docbook-xsl )
( cd usr/share/xml/docbook/stylesheet ; ln -sf ../xsl-stylesheets-1.79.2 docbook-xsl )
( cd usr/share/xml/docbook/xml-dtd-4.5/ent ; rm -rf isogrk4.ent )
( cd usr/share/xml/docbook/xml-dtd-4.5/ent ; ln -sf ../../../../sgml/xml-iso-entities-8879.1986/ISOgrk4.ent isogrk4.ent )
( cd usr/share/xml/docbook ; rm -rf xsl-stylesheets )
( cd usr/share/xml/docbook ; ln -sf xsl-stylesheets-1.79.2 xsl-stylesheets )
