1
0

reloc.sh 625 B

123456789101112131415161718
  1. #!/usr/bin/env bash
  2. # execute this after relocation of adk directory
  3. olddir=$(grep "^ADK_TOPDIR" prereq.mk 2>/dev/null |cut -d '=' -f 2)
  4. newdir=$(pwd)
  5. if [ ! -z "$olddir" ];then
  6. if [ "$olddir" != "$newdir" ];then
  7. echo "adk directory relocated!"
  8. echo "old directory: $olddir"
  9. echo "new directory: $newdir"
  10. sed -i -e "s#$olddir#$newdir#g" $(find target_* -name \*.pc|xargs)
  11. sed -i -e "s#$olddir#$newdir#g" $(find target_* -name \*.la|xargs)
  12. sed -i -e "s#$olddir#$newdir#g" $(find target_*/scripts -type f|xargs)
  13. sed -i -e "s#$olddir#$newdir#" target_*/etc/ipkg.conf
  14. sed -i -e "s#$olddir#$newdir#" prereq.mk
  15. fi
  16. fi