if [ ! -r var/lib/rpm/Packages ]; then
  ( cd var/lib/rpm/tmp ; cp -a * .. )
fi
( cd var/lib/rpm && rm -f tmp/* && rmdir tmp )
# Symlinks:
( cd bin ; rm -rf rpm )
( cd bin ; ln -sf ../usr/bin/rpm rpm )
( cd usr/bin ; rm -rf rpmquery )
( cd usr/bin ; ln -sf rpm rpmquery )
( cd usr/bin ; rm -rf rpmverify )
( cd usr/bin ; ln -sf rpm rpmverify )
( cd usr/lib64 ; rm -rf librpm.so )
( cd usr/lib64 ; ln -sf librpm.so.9.1.0 librpm.so )
( cd usr/lib64 ; rm -rf librpm.so.9 )
( cd usr/lib64 ; ln -sf librpm.so.9.1.0 librpm.so.9 )
( cd usr/lib64 ; rm -rf librpmbuild.so )
( cd usr/lib64 ; ln -sf librpmbuild.so.9.1.0 librpmbuild.so )
( cd usr/lib64 ; rm -rf librpmbuild.so.9 )
( cd usr/lib64 ; ln -sf librpmbuild.so.9.1.0 librpmbuild.so.9 )
( cd usr/lib64 ; rm -rf librpmio.so )
( cd usr/lib64 ; ln -sf librpmio.so.9.1.0 librpmio.so )
( cd usr/lib64 ; rm -rf librpmio.so.9 )
( cd usr/lib64 ; ln -sf librpmio.so.9.1.0 librpmio.so.9 )
( cd usr/lib64 ; rm -rf librpmsign.so )
( cd usr/lib64 ; ln -sf librpmsign.so.9.1.0 librpmsign.so )
( cd usr/lib64 ; rm -rf librpmsign.so.9 )
( cd usr/lib64 ; ln -sf librpmsign.so.9.1.0 librpmsign.so.9 )
