FIXUPHACK 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. rm -rf ./usr/share/zoneinfo #100526
  2. #130307 arch has moved libs from /lib to /usr/lib, which breaks chroot. move them back to proper place...
  3. if [ "$DISTRO_BINARY_COMPAT" = "arch" ];then #exported from 2createpackages.
  4. mkdir -p lib
  5. mkdir -p usr/lib
  6. FNDCLIBS="$(find usr/lib -mindepth 1 -maxdepth 1 -name '*.so*')"
  7. if [ "$FNDCLIBS" != "" ];then
  8. for ONECLIB in $FNDCLIBS
  9. do
  10. [ "$ONECLIB" = "" ] && continue
  11. BASECLIB="$(basename $ONECLIB)"
  12. #it seems, traditionally, these stay in /usr/lib...
  13. [ "$BASECLIB" = "libc.so" ] && [ ! -h $ONECLIB ] && continue
  14. [ "$BASECLIB" = "libpthread.so" ] && [ ! -h $ONECLIB ] && continue
  15. cp -a -f --remove-destination $ONECLIB ./lib/
  16. rm -f $ONECLIB
  17. done
  18. #traditionally, there are some symlinks in /usr/lib, recreate...
  19. FNDSYMLINKS="$(find lib -mindepth 1 -maxdepth 1 -name '*.so.[0-9]')"
  20. if [ "$FNDSYMLINKS" != "" ];then
  21. for ONESYMLINK in $FNDSYMLINKS
  22. do
  23. [ "$ONESYMLINK" = "" ] && continue
  24. if [ -h $ONESYMLINK ];then
  25. #TARGETLINK="$(readlink $ONESYMLINK)"
  26. TARGETLINK="$(basename $ONESYMLINK)"
  27. BASESYM="$(basename $ONESYMLINK | rev | cut -f 2-9 -d '.' | rev)"
  28. [ -e usr/lib/$BASESYM ] && continue
  29. ln -s ../../lib/$TARGETLINK usr/lib/$BASESYM
  30. fi
  31. done
  32. fi
  33. fi
  34. fi