cpio 534 B

1234567891011121314151617181920212223242526272829
  1. #!/usr/bin/env bash
  2. # This file is part of the OpenADK project. OpenADK is copyrighted
  3. # material, please see the LICENCE file in the top-level directory.
  4. set -x
  5. opt=
  6. user="-R 0:0"
  7. os=$(uname)
  8. case $os in
  9. NetBSD|MirBSD|OpenBSD)
  10. cmd="$@ -Mdist"
  11. ;;
  12. Darwin)
  13. user="-R root:"
  14. cmd=$(echo "$@"|sed -e "s#-Hnewc#--format newc#")
  15. ;;
  16. *)
  17. cmd="$@ -Mdist --quiet"
  18. ;;
  19. esac
  20. if [ "$2" = "r" ];then
  21. opt=$user
  22. fi
  23. cmd=$(echo "$cmd"|sed -e "s# r # #")
  24. if [ -x /usr/bin/cpio ];then
  25. /usr/bin/cpio $cmd $opt
  26. else
  27. /bin/cpio $cmd $opt
  28. fi