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/mke2fs.conf.new

if [ -x /usr/bin/install-info ]; then
  install-info --info-dir=/usr/info /usr/info/libext2fs.info.gz 2> /dev/null
fi


( cd sbin ; rm -rf mkfs.ext4dev )
( cd sbin ; ln -sf mke2fs mkfs.ext4dev )
( cd sbin ; rm -rf mkfs.ext4 )
( cd sbin ; ln -sf mke2fs mkfs.ext4 )
( cd sbin ; rm -rf mkfs.ext2 )
( cd sbin ; ln -sf mke2fs mkfs.ext2 )
( cd sbin ; rm -rf e2label )
( cd sbin ; ln -sf tune2fs e2label )
( cd sbin ; rm -rf mkfs.ext3 )
( cd sbin ; ln -sf mke2fs mkfs.ext3 )
( cd usr/lib64 ; rm -rf libcom_err.so )
( cd usr/lib64 ; ln -sf /lib64/libcom_err.so.2 libcom_err.so )
( cd usr/lib64 ; rm -rf libext2fs.so )
( cd usr/lib64 ; ln -sf /lib64/libext2fs.so.2 libext2fs.so )
( cd usr/lib64 ; rm -rf libss.so )
( cd usr/lib64 ; ln -sf /lib64/libss.so.2 libss.so )
( cd usr/lib64 ; rm -rf libe2p.so )
( cd usr/lib64 ; ln -sf /lib64/libe2p.so.2 libe2p.so )
( cd usr/man/man8 ; rm -rf fsck.ext2.8.gz )
( cd usr/man/man8 ; ln -sf e2fsck.8.gz fsck.ext2.8.gz )
( cd usr/man/man8 ; rm -rf mkfs.ext3.8.gz )
( cd usr/man/man8 ; ln -sf mke2fs.8.gz mkfs.ext3.8.gz )
( cd usr/man/man8 ; rm -rf mkfs.ext4dev.8.gz )
( cd usr/man/man8 ; ln -sf mke2fs.8.gz mkfs.ext4dev.8.gz )
( cd usr/man/man8 ; rm -rf fsck.ext4dev.8.gz )
( cd usr/man/man8 ; ln -sf e2fsck.8.gz fsck.ext4dev.8.gz )
( cd usr/man/man8 ; rm -rf mkfs.ext4.8.gz )
( cd usr/man/man8 ; ln -sf mke2fs.8.gz mkfs.ext4.8.gz )
( cd usr/man/man8 ; rm -rf fsck.ext4.8.gz )
( cd usr/man/man8 ; ln -sf e2fsck.8.gz fsck.ext4.8.gz )
( cd usr/man/man8 ; rm -rf fsck.ext3.8.gz )
( cd usr/man/man8 ; ln -sf e2fsck.8.gz fsck.ext3.8.gz )
( cd usr/man/man8 ; rm -rf mkfs.ext2.8.gz )
( cd usr/man/man8 ; ln -sf mke2fs.8.gz mkfs.ext2.8.gz )
( cd usr/man/man3 ; rm -rf uuid_generate_time.3.gz )
( cd usr/man/man3 ; ln -sf uuid_generate.3.gz uuid_generate_time.3.gz )
( cd usr/man/man3 ; rm -rf uuid_generate_random.3.gz )
( cd usr/man/man3 ; ln -sf uuid_generate.3.gz uuid_generate_random.3.gz )
( cd lib64 ; rm -rf libcom_err.so.2 )
( cd lib64 ; ln -sf libcom_err.so.2.1 libcom_err.so.2 )
( cd lib64 ; rm -rf libext2fs.so.2 )
( cd lib64 ; ln -sf libext2fs.so.2.4 libext2fs.so.2 )
( cd lib64 ; rm -rf libss.so.2 )
( cd lib64 ; ln -sf libss.so.2.0 libss.so.2 )
( cd lib64 ; rm -rf libe2p.so.2 )
( cd lib64 ; ln -sf libe2p.so.2.3 libe2p.so.2 )
