mk_distr_syms 606 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. : Utility to make a tree of symbolic links to source tree.
  2. : Mount the source tree read-only, use this script, and then try installation.
  3. case $# in
  4. 2) ;;
  5. *) echo "Usage: $0 <source-tree> <symlink-tree>" 1>&2
  6. exit 1
  7. ;;
  8. esac
  9. if [ -f $1/.distr ]
  10. then
  11. for i in `cat $1/.distr`
  12. do
  13. if [ -d $1/$i ]
  14. then
  15. if mkdir $2/$i && $0 $1/$i $2/$i
  16. then
  17. :
  18. else
  19. exit 2
  20. fi
  21. else
  22. if [ -f $1/$i ]
  23. then
  24. if ln -s $1/$i $2/$i
  25. then
  26. :
  27. else
  28. exit 3
  29. fi
  30. else
  31. echo "Missing file $1/$i" 1>&2
  32. exit 4
  33. fi
  34. fi
  35. done
  36. else
  37. echo "No .distr file in $1" 1>&2
  38. exit 5
  39. fi